the attached testcase shows that sizeof(int) is not identical to a compile time constant of 4. the first testcase uses sizeof(int) as a bound check, and somehow the call to the non-existing function is not optimized out.
in the second testcase sizeof(int) is replaced by "4" and the optimization suddenly works. -- Summary: sizeof(int) is not a compile time constant?? Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: arjan at linux dot intel dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41516