This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/61043] LTO accumulates CPU requirements from all input objects
- From: "andysem at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 May 2014 09:22:36 +0000
- Subject: [Bug lto/61043] LTO accumulates CPU requirements from all input objects
- Auto-submitted: auto-generated
- References: <bug-61043-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61043
--- Comment #2 from andysem at mail dot ru ---
(In reply to Andi Kleen from comment #1)
> Yes LTO doesn't support different options for different files, and combines
> some of them (which happens in your case) and ignores some others.
>
> You could use tag the functions in the different file with
>
> __attribute__(target("..."))
>
> This will also allow automatic switching.
>
> Arguably gcc should do this automatically for LTO, but unfortunately it
> doesn't
Unfortunately, gcc does not allow using SIMD intrinsics if not enabled by
compiler switches, so leaving the compiler options for a generic target CPU
wouldn't work. At least that is the case with gcc 4.8.
> Or alternatively don't compile the file that needs the changed options with
> LTO
Yes, I'm currently not using LTO in my real world project that exhibits this
problem. But users of my project would like to enable LTO, and currently this
silently produces incorrect binaries. The purpose of this ticket is to indicate
the problem and suggest a possible solution (automatically marking each
function in every translation unit with the target options).