This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR libmudflap/53359] don't register symbols not emitted
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 21 Dec 2012 10:55:06 +0100
- Subject: Re: [PR libmudflap/53359] don't register symbols not emitted
- References: <ory5gsufym.fsf@livre.localdomain> <CAFiYyc3EjmPGg1eiEVK+b3K9-k-U3FGrothtGk18VdLuF4cdkQ@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot 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.
Yeah, asan.c also tests TREE_ASM_WRITTEN and doesn't register
!TREE_ASM_WRITTEN decls for instrumentation.
Jakub