Bugzilla – Bug 424
[llvmgcc] llvmgcc emits invalid constant exprs!
Last modified: 2004-11-27 13:46:05
You need to log in before you can comment on or make changes to this bug.
In this example (cut down from povray): ------------------- struct foo { int Y; char X[100]; } F; int test(char *Y) { return Y - F.X; } ------------------- llvmgcc is emitting the following invalid constantexpr: %tmp.5 = add int %tmp.1, sub (int cast (%struct.foo* sub (%struct.foo* null, %struct.foo* %F) to int), int 4) The problem is the pointer subtract operation, which is not a kosher constant expr (subtract only works for integral and fp types). -Chris
Fixed. Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021363.html Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021362.html -Chris