------- Comment #12 from aoliva at gcc dot gnu dot org 2010-01-08 05:27 ------- It is a bug. The compiler shouldn't generate different code depending on -g, and that's what's (potentially) going on here. That the code is undefined per a language standard shouldn't take precedence over a more general design principle in GCC: we should still emit the same code, crash or exhibit otherwise undefined behavior in just the same way. Surely you wouldn't like to have a surprise such as finding out the crash or the bug you're hunting disappears when you recompile the program with -g, would you? That's the kind of bug that -fcompare-debug is designed to catch, and that's what it just did. Now, since leaving the bug in *would* do harm (as above), the question is whether to fix it in DF or in web. I'm ambivalent, but I'd rather not put time into either one if it's going to be rejected in favor of the other.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42631