From mboxrd@z Thu Jan 1 00:00:00 1970 From: dewar@gnat.com (Robert Dewar) To: gcc-bugs@gcc.gnu.org, js@convergence.de, sirl@gcc.gnu.org Cc: gcc@gcc.gnu.org Subject: Re: optimization/7557: gcc-3.1.1 (debian/i386): wrong code with -O2 / bitfields / pointer aliasing Date: Mon, 12 Aug 2002 15:05:00 -0000 Message-id: <20020812220548.7462CF2D45@nile.gnat.com> X-SW-Source: 2002-08/msg00695.html > I wonder: Thousands of software packages use -O2 by default. > How many of them will fail mysteriously when compiled with gcc-3.1, > just because of the implied -fstrict-aliasing? Who knows? But it is just a special case of the general phenomenon that junk code which people get away with often falls foul of perfectly legitimate optimizations, and as compilers improve, such code fails. It is nice of GCC to provide facilities for keeping old junk code running (there is certainly no requirement for a C compiler to do so), but it seems clear that the default for the highest optimization level should be to take advantage of the aliasing rules, which are after all there *precisely* to enable effective optimization.