[patch] Disable LTO note about strict aliasing
Richard Biener
richard.guenther@gmail.com
Mon Nov 14 10:16:00 GMT 2016
On Sun, Nov 13, 2016 at 11:31 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> It's the note issued by the -Wlto-type-mismatch warning:
>
> q.ads:7:13: warning: type of 'q__proc' does not match original declaration [-
> Wlto-type-mismatch]
> procedure Proc (A : Arr);
> ^
> q.adb:7:3: note: 'q__proc' was previously declared here
> procedure Proc (A : Arr) is begin null; end;
> ^
> q.adb:7:3: note: code may be misoptimized unless -fno-strict-aliasing is used
>
> and it's a bit surprising that -fno-strict-aliasing cannot silence it.
The issue is that we can have different -fstrict-aliasing status on
different functions
(from individual TUs). I'm not sure if a -fno-strict-aliasing at
link/WPA time will
put them to that state.
> Tested on x86_64-suse-linux, OK for the mainline and 6 branch?
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? We're also still
in a very weird state
of fixing TU compile flags via the optimize/target attribute to link
time while at the
same time still going through lto-opts.c and lto-wrapper "merging" of
those options.
That said, -Wno-lto-type-mismatch can be used to disable the warning as well.
Thanks,
Richard.
>
> 2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
>
> lto/
> * lto-symtab.c (lto_symtab_merge_decls_2): Only issue note on strict
> aliasing if -fstrict-aliasing is enabled.
>
> --
> Eric Botcazou
More information about the Gcc-patches
mailing list