buggy optimization levels...

LLeweLLyn Reese llewelly at lifesupport.shutdown.com
Mon Jul 14 18:39:32 PDT 2003


Chuck Swiger <cswiger at mac.com> writes:

> Hi, all--
> 
> The "known bugs" section of the GCC info documentation lists 5 issues;
> "man gcc" lists none.  Can someone provide a test case for a bug
> involving "cc -O" versus "cc -O3" under FreeBSD 4-STABLE for the x86
> architecture?

You could probably find a few by searching the bug data base at:
    http://gcc.gnu.org/bugzilla/

> 
> What is the preferred solution?  The Dragon book and other compiler
> references have a definition of safe versus unsafe "optimizations"; is
> the problem that -O3 enables something unsafe?

I believe that none of -O[0-3s] are intended to enable unsafe
    optimizations. (There are some optimization flags, which are *not*
    enabled by any -O opt, like -ffast-math, which are documented to
    be unsafe in some fashion or another; see
http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Optimize-Options.html#Optimize%20Options)

> Who is responsible
> (FreeBSD, GNU compiler team, others?) for changing the compiler
> defaults so that -Ox will not produce known-invalid results, for any x?
[snip]

If gcc produces invalid results or bad code at any optimization level,
    I think you should report it as a bug according to the
    instructions at http://gcc.gnu.org/bugs.html


More information about the freebsd-questions mailing list