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] Fix ICF with error/warning attribute (PR ipa/84628)


On Fri, 2 Mar 2018, Jakub Jelinek wrote:

> On Fri, Mar 02, 2018 at 09:15:07AM +0100, Richard Biener wrote:
> > You probably need a virtual return thunk as otherwise we expand them
> > directly to asm?
> 
> I was trying x86_64 -m32 -fpic regparm (3) method with thunks so that
> the asm isn't emitted.  But the thunk was still using call to .LTHUNKN
> rather than the actual method FUNCTION_DECL.  Perhaps on targets without
> proper alias support...
> 
> > > Would you prefer just being silent in all thunks?
> > 
> > Yes, I think all warnings from thunks are ultimately going to be bogus...
> 
> Ok, I'll change the patch.
> 
> > > That said, wonder about thunks (the non-ICF ones) from false-negative
> > > diagnostic point as well, if I have some method with error/warning attribute
> > > and call a thunk instead, wonder if we get the diagnostic or not, thunks
> > > likely don't have the attribute copied over to them.
> > 
> > True...
> > 
> > I guess we should not warn from thunks but instead move those attributes
> > to the thunks so see if those get called in the end.
> 
> Or in the expr.c code look through thunks to find the underlying function
> and take DECL_ARGUMENTS from there.

If that's easily possible that sounds good as well of course.

Richard.


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