First Last Prev Next    No search results available
Details
: [llvmgcc] llvmgcc emits invalid constant exprs!
Bug#: 424
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.4

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-08-17 12:10
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

First Last Prev Next    No search results available