https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #7 from ma.jiang at zte dot com.cn --- (In reply to Markus Trippelsdorf from comment #5) Hi Markus, > These optimizations are not dangerous if you use standard conforming code. I think these optimizations are dangerous because they create wrong binaries silently, even if we use standard conforming codes. Let us just look at the "-fstrict-aliasing". This optimization assume "In particular, an object of one type is assumed never to reside at the same address as an object of a different type, unless the types are almost the same". But this restriction *IS NOT* required by the C-standard. So codes that conformed to C-standard could also be translated to wrong binaries by GCC with "-fstrict-aliasing", in silence... > > We could have a discussion if it might be better to enable some -Wall > warnings > by default like Clang. But I'm not sure if this gives huge benefits to users. I do not know whether it's a good idea to enable warnings such as Wstrict-aliasing by default. But I believe we should enable these warnings when corresponding optimizations are turned on, this do give huge benefits to users.