This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix partition WRT static variables taking address of labels
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2015 20:53:55 +0200
- Subject: Re: Fix partition WRT static variables taking address of labels
- Authentication-results: sourceware.org; auth=none
- References: <20150330073201 dot GA42058 at kam dot mff dot cuni dot cz> <20150330090714 dot GA60421 at kam dot mff dot cuni dot cz> <CAFiYyc0Jqm3WNZFKGQ7QO-csMJEo0L7nsnO67tX2J3ts--SvgQ at mail dot gmail dot com> <5519580A dot 7060308 at redhat dot com> <20150330171934 dot GC14471 at atrey dot karlin dot mff dot cuni dot cz> <551996FC dot 4070201 at redhat dot com> <20150330183643 dot GF14471 at atrey dot karlin dot mff dot cuni dot cz> <55199972 dot 5050101 at redhat dot com>
> On 03/30/2015 02:36 PM, Jan Hubicka wrote:
> >Will there be only one copy even on targets that do not support aliases?
>
> Yes, on those targets we use thunks.
I see, and only if thinks fails on variadic arguments we lose, right?
>
> >Still, it would be great if we can make context to be the actual function.
>
> That sounds messy.
>
> >Otherwise I will need to figure out some way to represent the link in between
> >static variable and function it takes label of...
>
> Check DECL_ORIGIN of the label's function?
What I am trying to do is to easily get a way IPA code can group the function
with static variables referring its initializers without actually needing to
introduce new representation by ipa-ref.
So I added a flag to static variables and when walking symbol table I only have
the static variable decl at hand (no constructor) and want to get back to the
containing function that define its label.
I hoped we are safe to use the decl_function_context, because these functions are
never cloned, but here we just get ready for cloning without actually doing it ;).
Can you thnk of way of doing so easily?
I suppose I may just go with patch as it is and silecne the ICE for this stage4
or develop more involved fix with the extra reference represented somehow
which may be better to wait for next stage1 and be backported. I will try to think
about it bit more today.
Honza
>
> Jason