News for hackers. Stuff that matters.
Re:When you see a Heisenbug in C, change your compiler's opt... by aidenn0 on Saturday March 01, 2014 @08:12PM (#7327153)
In the embedded industry, the most common reason for things working when disabling optimizations is violating the ANSI aliasing rules. Embedded programmers type-pun all the time and don't realize it's undefined behavior in C. Most compilers have an option to disable the ANSI aliasing rules, but it really hurts optimization opportunities.

I saw a large codebase completely break when turning on intermodule inlining. The cause: more opportunities for the compiler to find pointers that aren't allowed to alias.

Re:When you see a Heisenbug in C, change your compiler's opt... by cnvogel on Sunday March 02, 2014 @04:52AM (#7328504)
Yes, and most often it's clearly warned about, up to the point where lines are completely burried in type-casts, just to shut up the (well meaning) compiler. Because, you know, we thrive for 0-warning compilations!