public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Alexandre Oliva <aoliva@redhat.com>,
	gcc-patches@gcc.gnu.org,	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PR libmudflap/53359] don't register symbols not emitted
Date: Fri, 21 Dec 2012 10:42:00 -0000	[thread overview]
Message-ID: <20121221104219.GE7055@kam.mff.cuni.cz> (raw)
In-Reply-To: <20121221095506.GE2315@tucnak.redhat.com>

> On Fri, Dec 21, 2012 at 10:50:58AM +0100, Richard Biener wrote:
> > On Fri, Dec 21, 2012 at 6:33 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> > > libmudflap emits a global initializer that registers memory ranges for
> > > global data symbols.  However, even if IPA decides not to emit a symbol
> > > because it's unused, we'd still emit registration sequences for them in
> > > some cases, which, in the PR testcase, would result in TOC references to
> > > the undefined symbols.
> > >
> > > This patch fixes the problem, avoiding registration for symbols that are
> > > not present in the varpool.
> > >
> > > Regstrapped on x86_64-linux-gnu and i686-linux-gnu; I've also verified
> > > that it removes the TOC references on a ppc64-linux-gnu cross.
> > >
> > > Ok to install?
> > 
> > Hmm, I think that at this point of the compilation you are looking for
> > TREE_ASM_WRITTEN instead.  I'm not sure we will never end up
> > having a symtab node that not ends up being emitted.

Ones representing external vars, but that probably doesn't count. 
Also for constant pool the decision whether to emit or not is still
done behind symtab's back.   All other nodes should be removed.
> 
> Yeah, asan.c also tests TREE_ASM_WRITTEN and doesn't register
> !TREE_ASM_WRITTEN decls for instrumentation.

Note that FEs sometimes play dirty games setting TREE_ASM_WRITTEN
to true to avoid fake symbols being output.

Probably none of these matters at this point.  Just to point it out.

Honza
> 
> 	Jakub

  reply	other threads:[~2012-12-21 10:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  5:34 Alexandre Oliva
2012-12-21  9:51 ` Richard Biener
2012-12-21  9:55   ` Jakub Jelinek
2012-12-21 10:42     ` Jan Hubicka [this message]
2012-12-30  0:23   ` Alexandre Oliva
2013-01-02 14:53     ` Richard Biener
2013-01-06 19:48       ` Alexandre Oliva
2013-01-07  9:28         ` Richard Biener
2013-01-16  9:29           ` Alexandre Oliva
2013-01-16 10:24             ` Jan Hubicka
2013-01-16 13:17               ` Alexandre Oliva
2013-01-16 13:48                 ` Richard Biener
2013-01-18 11:44               ` Alexandre Oliva

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=20121221104219.GE7055@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=aoliva@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.guenther@gmail.com \
    /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).