public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "andysem at mail dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/61043] LTO accumulates CPU requirements from all input objects
Date: Sun, 04 May 2014 09:22:00 -0000	[thread overview]
Message-ID: <bug-61043-4-Z7Br2g6BZv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61043-4@http.gcc.gnu.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).


  parent reply	other threads:[~2014-05-04  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2014-05-04 17:18 ` andi-gcc at firstfloor dot org
2014-05-05  9:10 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61043-4-Z7Br2g6BZv@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).