public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/61043] LTO accumulates CPU requirements from all input objects
       [not found] <bug-61043-4@http.gcc.gnu.org/bugzilla/>
@ 2014-05-04  3:48 ` andi-gcc at firstfloor dot org
  2014-05-04  9:22 ` andysem at mail dot ru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-05-04  3:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot org

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
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

Or alternatively don't compile the file that needs the changed options with LTO


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/61043] LTO accumulates CPU requirements from all input objects
       [not found] <bug-61043-4@http.gcc.gnu.org/bugzilla/>
  2014-05-04  3:48 ` [Bug lto/61043] LTO accumulates CPU requirements from all input objects andi-gcc at firstfloor dot org
@ 2014-05-04  9:22 ` andysem at mail dot ru
  2014-05-04 17:18 ` andi-gcc at firstfloor dot org
  2014-05-05  9:10 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: andysem at mail dot ru @ 2014-05-04  9:22 UTC (permalink / raw)
  To: gcc-bugs

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).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/61043] LTO accumulates CPU requirements from all input objects
       [not found] <bug-61043-4@http.gcc.gnu.org/bugzilla/>
  2014-05-04  3:48 ` [Bug lto/61043] LTO accumulates CPU requirements from all input objects andi-gcc at firstfloor dot org
  2014-05-04  9:22 ` andysem at mail dot ru
@ 2014-05-04 17:18 ` andi-gcc at firstfloor dot org
  2014-05-05  9:10 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-05-04 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andi Kleen <andi-gcc at firstfloor dot org> ---
>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.

This has been fixed in 4.9


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/61043] LTO accumulates CPU requirements from all input objects
       [not found] <bug-61043-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-05-04 17:18 ` andi-gcc at firstfloor dot org
@ 2014-05-05  9:10 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-05  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Known issue (there are duplicate bugs for this AFAIK).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-05  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-61043-4@http.gcc.gnu.org/bugzilla/>
2014-05-04  3:48 ` [Bug lto/61043] LTO accumulates CPU requirements from all input objects andi-gcc at firstfloor dot org
2014-05-04  9:22 ` andysem at mail dot ru
2014-05-04 17:18 ` andi-gcc at firstfloor dot org
2014-05-05  9:10 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).