------- Comment #21 from rguenth at gcc dot gnu dot org 2008-01-14 17:08 ------- Another testcase we miscompile due to the fact in comment #20 (w/o the temporary tmp fold converts the comparison to a comparision with a BIT_FIELD_REF, which is handled correctly (not optimized)):
extern "C" void abort (void); struct s { unsigned long long f1 : 40; unsigned int f2 : 24; }; s sv; void __attribute__((noinline)) foo(unsigned int i) { unsigned int tmp; sv.f2 = i; tmp = sv.f2; if (tmp != 0) abort (); } int main() { foo (0xff000000u); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33887