http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59083
--- Comment #13 from Markus Trippelsdorf <octoploid at yandex dot com> --- (In reply to Jeffrey A. Law from comment #11) > Damn it. Tested the wrong compiler. > > The problem with your testcase Markus is you're simply not allowed to pass a > null pointer to sprintf, memcpy and a variety of other functions. Once you > execute code which attempts that, you've walked into the realm of undefined > behaviour. > > Once you cross that boundary the compiler is allowed to do these kinds of > transformations. Your testcode is fundamentally flawed in that it relies > upon undefined behaviour. Understood. But the problem is that "the kernel" and "x.org" still fail. I will try to come up with testcases for those two and see if it's also caused by the same undefined behavior.