This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/7557: gcc-3.1.1 (debian/i386): wrong code with -O2 / bitfields / pointer aliasing


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]