This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5] Make ipa-sra observe the used parameter.
- From: Martin Jambor <mjambor at suse dot cz>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 14 Sep 2009 23:00:07 +0200
- Subject: Re: [PATCH 5/5] Make ipa-sra observe the used parameter.
- References: <20090805152128.023505229@virgil.suse.cz> <20090805152152.607359090@virgil.suse.cz> <alpine.LNX.2.00.0908061359490.16347@zhemvz.fhfr.qr> <Pine.LNX.4.64.0908061331260.3792@digraph.polyomino.org.uk> <20090806140944.GC24310@virgil.suse.cz> <Pine.LNX.4.64.0908061448350.3792@digraph.polyomino.org.uk>
Hi,
On Thu, Aug 06, 2009 at 02:50:13PM +0000, Joseph S. Myers wrote:
> On Thu, 6 Aug 2009, Martin Jambor wrote:
>
> > I wrote this patch after I read the following message in the thread
> > about debug unwinder hooks approximately two months ago:
> >
> > http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01048.html
> >
> > I am no expert in this area but as far as I understand it, there is
> > now a hook for the debugger in libgcc which is static and its address
> > does not escape and which has a parameter which is not used because
> > the function doesn't do much on its own. However (some version of)
> > gdb expects it to be called and passed information by the means of the
> > otherwise unused parameters at some point when handling exceptions so
> > that it can intercept each run and learn whatever it needs to from the
> > arguments. Thus, IPA-SRA should not prevent passing the values to an
> > otherwise perfectly local function. Jakub suggested the used
> > parameter and I think it is sensible.
> >
> > I do not think that ordinary users will find this attribute usage very
> > useful and I do expect all uses to be hacks like this.
> >
> > I am not sure whether the above explanation is something for the
> > documentation, though. I will be glad for any suggestions in this
> > regard.
> >
> > Does it make sense now?
>
> The above suggests to me that what you actually want is an attribute on
> the function, not a parameter, to keep the function and preserve its ABI.
> Why not make "used", on the function, mean that? It's defined to mean the
> function is used in some way behind the compiler's back, so making it
> preserve the ABI seems reasonable.
And it even works without any further code because the necessary bit
in the callgraph is set. Thanks for the suggestion. Thus I have only
retained the testcase from the original patch and discarded the rest.
Should we document this somehow or is the used documentation
suffucuent?
Thanks,
Martin