This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] Make ipa-sra observe the used parameter.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]