[patch] Disable LTO note about strict aliasing

Eric Botcazou ebotcazou@adacore.com
Tue Nov 15 09:47:00 GMT 2016


> Can you verify that a TU compiled with -fstrict-aliasing will link as
> if -fno-strict-aliasing if -fno-strict-aliasing is specified at link time?

Yes, it does:

eric@polaris:~/build/gcc/native> ~/install/gcc/bin/gcc -c t.c -O2 -flto
eric@polaris:~/build/gcc/native> ~/install/gcc/bin/gcc -o t t.o -O2 -save-
temps -fverbose-asm && grep strict-aliasing t.ltrans0.s
# -fstore-merging -fstrict-aliasing -fstrict-overflow
eric@polaris:~/build/gcc/native> ~/install/gcc/bin/gcc -o t t.o -O2 -fno-
strict-aliasing -save-temps -fverbose-asm && grep strict-aliasing t.ltrans0.s
# -fno-strict-aliasing -fverbose-asm -fltrans t.ltrans0.o

> That said, -Wno-lto-type-mismatch can be used to disable the warning as
> well.

Right, but the wording ("code may be misoptimized") is a bit scaring so I'd 
rather avoid it when possible.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list