http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55478
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenther at suse dot de --- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-27 10:57:04 UTC --- With the patch attached (or with main() renamed to something else) I now get at -O3 int main() () { struct FixedString empty; int _16; const char pretmp_18; int _20; char _24; char _25; const char pretmp_26; <bb 2>: MEM[(char &)&empty + 8] = 97; MEM[(char &)&empty + 9] = 98; _24 = empty.contents[0]; _16 = (int) _24; printf ("%d\n", _16); _25 = empty.contents[1]; _20 = (int) _25; printf ("%d\n", _20); empty ={v} {CLOBBER}; return 0; } seems like inconsistency in SRA is causing missing constant porpagation here. 97 and 98 should be propagated into the load. Richard/Martin, can you take a look, please? Also notice the stale pretmp declarations.