Bugzilla – Bug 490
[cbackend] Logical constant expressions (and/or/xor) not implemented
Last modified: 2004-12-28 22:17:29
You need to log in before you can comment on or make changes to this bug.
The attached program generates an internal error. CWriter Error: Unhandled constant expression: int and (int 1, int select (bool setlt (uint sub (uint cast (void ()* %test_2_end to uint), uint cast (uint (uint)* %test_2_start to uint)), uint 32), int -1, int select (bool setlt (uint sub (uint cast (void ()* %test_1_end to uint), uint cast (uint (uint)* %test_1_start to uint)), uint 32), int -1, int 3))) llvm 1.3 generates a similar but not identical error.
Created an attachment (id=192) [details] File to reproduce the error (on linux/i386).
Created an attachment (id=195) [details] Reduced test case This is LLVM assembly code that I reduced from the previous test case. Assembling it and running llc should re-generate the error. I believe an optimization pass in gccas or gccld is creating this code. I got this code by compiling the program and disassembling it with llvm-dis. Using llvm-gcc -S to generate assembly and using llvm-as to assemble it does not produce the same bytecode file.
Fixed. Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022732.html Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022733.html Thanks for finding this, and major thanks to John for reducing the testcase. -Chris
I should note, however, that the code triggering the problem is NOT a portable way to get the size of a function (there is none). LLVM may choose to rearrange functions as it wants, so you can't really count on layout like this. In practice it will probably work most of the time though. -Chris