News for hackers. Stuff that matters.
Re:When you see a Heisenbug in C, change your compiler's opt... by GFK_of_xmaspast on Saturday March 01, 2014 @10:47PM (#7327614)
The only "compiler bugs" I have ever seen in 20+ years of coding have all, with the exception of the times the compiler itself crashed, all been user error, and most of those errors are things like using uninitialized values (-g, at least on some compilers, sets memory to 0, instead of 'whatever's on the stack at the moment') or stack corruption that corrupted different parts of the stack at different optimization levels.
Re:When you see a Heisenbug in C, change your compiler's opt... by to3m on Sunday March 02, 2014 @08:05AM (#7329002)
-g should really be controlling the emission of debug info, and nothing else, I would have thought? This is independent of the amount of optimization being performed.

In fact the code part of the result should be identical in both cases, and ideally at runtime it should be impossible to tell the difference between -g and not (since presumably the loader won't load/map the debug info even if it's embedded).