This is the mail archive of the gcc@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: [RFC] noipa attribute (was Re: How to avoid constant propagation into functions?)


On Thu, Dec 15, 2016 at 07:11:09PM +0100, Florian Weimer wrote:
> * Jakub Jelinek:
> 
> > +      if (lookup_attribute ("used", attributes) == NULL)
> > +	attributes = tree_cons (get_identifier ("used"),  NULL, attributes);
> 
> Attribute “used” seems different to me from the rest.  Based on the
> documentation, I wouldn't expect it to have any action-at-a-distance
> effect, just that an out-of-line copy is always emitted.  It will
> disable unused-function warnings, too, I think.

"used" means the function may be used behind compiler's back in some other
ways, so it sets DECL_PRESERVE_P which causes it not to be removed as
unused, but also affects various other properties we want from the noipa
functions.  I'll have to test whether it e.g. disables the changing of
argument/return value passing (e.g. on i686 we sometimes decide to use
regparm convention, that is keyed on the can_change_signature flag,
I'd have to figure out if DECL_PRESERVE_P actually disables that, but
if not, that would be a bug).

	Jakub


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