-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ret-bang variant trips llvm assert "Invalid constantexpr cast!" #777
Comments
Switch the operands around and we get a different error message:
Assertion failed: (getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"), function ICmpInst, file /Users/jruderman/code/llvm/include/llvm/Instructions.h, line 643. |
Here's a version that uses early-ret instead of bang:
It's interesting that if I replace "==" with "+" I get "error: binary operation + cannot be applied to type |
"error: binary operation + cannot be applied to type |
The first two programs enjoyed different results because trans was assuming both sides of the If it chooses If it chooses uint, then we see the second error message, because it tries to generate an unsigned int comparison but So far as I can tell, the correct thing to do is to just not generate code for the comparison if one operand is divergently typed. I have a fix which I'm about to check in. Next I'll look at the early-ret version. |
Add clock_gettime related functions to macOS Fixes rust-lang/libc#776. The constants were retrieved on macOS 10.12.6. Tried adding `clock_nanosleep` too, but it doesn't seem like macOS' libc includes that yet.
…ransition Update rustc-guide to rustc-dev-guide
Assertion failed: (CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"), function getCast, file Constants.cpp, line 1217.
The text was updated successfully, but these errors were encountered: