http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54945
Michael Matz <matz at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matz at gcc dot gnu.org --- Comment #10 from Michael Matz <matz at gcc dot gnu.org> 2012-10-18 15:48:29 UTC --- (In reply to comment #9) > Hmm, the fix isn't enough: > int > main (void) > { > int x = 30; > int y = 31; > int *p = &x + 1; > int *q = &y; > return p == q; > } > > $ gcc -O2 pr54945.c && ./a.out ; echo $? > 0 This testcase is clearly invalid. I would argue that also the initial testcase is invalid, but I'm fine if the compiler can be changed in a way to not pessimize valid testcases and still do what the author probably intended. But the last testcase doesn't do anything meaningful and GCC shouldn't be changed to do something else than what it does right now.