https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94346
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Known to fail| |10.0, 9.2.0 Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- The change below avoids the ICE with no regressions in the attribute or warning tests: diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 9abf81d0248..c1294de2f49 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -2625,7 +2625,7 @@ handle_copy_attribute (tree *node, tree name, tree args, /* Copy type attributes from REF to DECL. */ for (tree at = attrs; at; at = TREE_CHAIN (at)) - decl_attributes (node, at, flags, ref); + decl_attributes (node, at, flags, DECL_P (ref) ? ref : NULL_TREE); return NULL_TREE; }