Hi!
I've noticed a bogus attribute (stack_protector) on a function with noipa
attribute.
The reason seems to be misapplied patch of mine, the 4 lines below were
actually from handle_stack_protect_attribute, but instead of moving those
there, I'd like to remove them because they make no sense to me.
When handle_*_attribute doesn't set *no_add_attrs, the attribute is added
by the caller, so there is no point in it adding it by hand.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2017-09-29 Jakub Jelinek
* c-attribs.c (handle_noipa_attribute): Don't add "stack_protect"
attribute.
--- gcc/c-family/c-attribs.c.jj 2017-09-29 09:57:12.0 +0200
+++ gcc/c-family/c-attribs.c2017-09-29 14:17:11.014438213 +0200
@@ -730,10 +730,6 @@ handle_noipa_attribute (tree *node, tree
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
}
- else
-DECL_ATTRIBUTES (*node)
- = tree_cons (get_identifier ("stack_protect"),
- NULL_TREE, DECL_ATTRIBUTES (*node));
return NULL_TREE;
}
Jakub