http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46149
--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2010-10-23 14:57:10 UTC --- Created attachment 22134 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22134 hopefully reduced testcase OK with -O0: $ g++ -O0 pr46149.C $ ./a.out && echo $? 0 (no valgrind errors) OK with -O2: $ g++ -O2 pr46149.C $ ./a.out && echo $? 0 (no valgrind errors) crashes with -O2 -fno-tree-sra: $ g++ -O2 -fno-tree-sra pr46149.C $ ./a.out Segmentation fault