http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56061

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-01-30 
11:29:02 UTC ---
(In reply to comment #3)
> Does it make sense to allow "-O0 -flto" at all?

Answering myself, the docs have this example:

Additionally, the optimization flags used to compile individual files are not
necessarily related to those used at link time. For instance,

          gcc -c -O0 -flto foo.c
          gcc -c -O0 -flto bar.c
          gcc -o myprog -flto -O3 foo.o bar.o


This produces individual object files with unoptimized assembler code, but the
resulting binary myprog is optimized at -O3. If, instead, the final binary is
generated without -flto, then myprog is not optimized.

However, I still don't see the point of "-O0 -flto" at link-time. We should
either force it to be at least -O1 or (in my opinion better) give an error.

Reply via email to