https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98198
--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> --- This simple patch avoids the ICE: diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 1d2ab7c..8847932 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -767,6 +767,10 @@ decl_or_type_attrs (tree node) return attrs; tree type = TREE_TYPE (node); + + if (type == error_mark_node) + return NULL_TREE; + return TYPE_ATTRIBUTES (type); }