public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/61886] [4.8/4.9/5 Regression] LTO breaks fread with _FORTIFY_SOURCE=2
Date: Wed, 08 Oct 2014 17:49:00 -0000	[thread overview]
Message-ID: <bug-61886-4-MXwLOah1Ex@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61886-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61886

--- Comment #26 from Jan Hubicka <hubicka at ucw dot cz> ---
> But is warning/error attribute the only thing on aliases that can hold extra
> semantics info (now or in the future)?  I'd say LTO symtab merging should merge
> what is mergeable, and should leave leave as separate decls with the same
> asm-name what holds non-mergeable semantics on it.
> Say, if you declare some function (or different, just with same asm name) with
> warning attribute in one TU, with error attribute in another TU and without it
> on another TU, IMHO those three decls shouldn't be merged together, you should
> note in cgraph that you have aliases that have the same asm name but different
> semantics and just ensure that you use the right cgraph nodes and decls in the
> corresponding callers.

A I tried to explain, it is currently design decision to have  one declaration
and one symtam node for one symbol.  The one decl rule was introduced by
Codesourcery (Zack) in 2003-4. He updated frontends to avoid copying and
dropped code that dealt with duplicated declarations.  Due to lack of sanity
checking some cases remained, like this one (because at that time we did not
really have proper asm name hash).  There are couple open PRs since that time
that was never corrected.

So either we need to fix remaining cases or revisit the decision and audit
backend/middleend for duplicated decls.  There are cases I know that would need
updating
 - symbol equality folding
 - alias analysis
 - Symbol table allowing many to one mapping for symtab entries.
   I think it would be better to avoid duplicated entries in symbol table,
   so we will need way to associate all declarations with a given symbol.
   Probably ont that big deal except for updating code that deals with 
   changing declaration associated with the node and we need to decide what
   declaration control symbol's visibility. 

   Obviously if user provide two declarations, one is static and ohter public,
   we either want to error or do someting sane.
 - we need to produce errors when user defines two different symbols of same
name
   (currently we produce invalid asm)
 - anchors
 - Zack dropped some code from dwarf2out
 - Visibility in varasm - those need to follow the main declaration.  I had
great
   fun fixing effects of this on AIX

I definitly found the one decl scheme somewhat restrictive, but it also makes
things easier and avoids weird bugs. We could revert this decision, but that is
a project.

Concerning Richards plan to annotate statements with warning strings, I think
we could follow same scheme as EH regions and histograms does - i.e. have on
side hash table annotating statements.

For IPA I am trying to convince Martin Liska to introduce symtab annotation
template
for me that makes it easy to add data to a symbol that is removed/duplicated
along with
the symbol.  Cgraph has the hook API for it, but convenient C++ wrap would be
great.

Here I think we want something similar and convert the existing EH/histograms
to it.

Honza


  parent reply	other threads:[~2014-10-08 17:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61886-4@http.gcc.gnu.org/bugzilla/>
2014-07-23 10:58 ` [Bug lto/61886] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-07-23 11:13 ` rguenth at gcc dot gnu.org
2014-07-23 13:08 ` rguenth at gcc dot gnu.org
2014-07-23 13:37 ` hubicka at gcc dot gnu.org
2014-08-27 10:00 ` [Bug lto/61886] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2014-08-27 14:51 ` hubicka at ucw dot cz
2014-08-28  8:20 ` rguenther at suse dot de
2014-09-08  0:42 ` hubicka at ucw dot cz
2014-09-08  7:53 ` rguenther at suse dot de
2014-10-06 20:23 ` hubicka at ucw dot cz
2014-10-06 20:34 ` jakub at redhat dot com
2014-10-06 22:08 ` jakub at redhat dot com
2014-10-06 22:19 ` hubicka at ucw dot cz
2014-10-06 22:38 ` jakub at redhat dot com
2014-10-06 22:44 ` hubicka at ucw dot cz
2014-10-07  5:46 ` hubicka at ucw dot cz
2014-10-07  9:24 ` jakub at gcc dot gnu.org
2014-10-07  9:35 ` jakub at gcc dot gnu.org
2014-10-07 19:49 ` hubicka at ucw dot cz
2014-10-08  7:37 ` rguenther at suse dot de
2014-10-08  8:25 ` jakub at gcc dot gnu.org
2014-10-08 10:42 ` rguenther at suse dot de
2014-10-08 17:49 ` hubicka at ucw dot cz [this message]
2014-12-01 12:31 ` rguenth at gcc dot gnu.org
2014-12-19 13:37 ` jakub at gcc dot gnu.org
2015-01-19 13:16 ` rguenth at gcc dot gnu.org
2015-02-11  8:29 ` rguenth at gcc dot gnu.org
2015-02-11  8:33 ` rguenth at gcc dot gnu.org
2015-02-11  9:15 ` hubicka at ucw dot cz
2015-02-11 10:05 ` rguenther at suse dot de
2015-02-11 16:30 ` zackw at panix dot com
2015-03-03 19:12 ` hubicka at gcc dot gnu.org
2015-03-20 21:00 ` hubicka at gcc dot gnu.org
2015-06-23  8:21 ` [Bug lto/61886] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 20:10 ` [Bug lto/61886] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:35 ` jakub 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-61886-4-MXwLOah1Ex@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).