https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96596
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- The following change avoids the ICE: diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index b31d99fcfaf..0d2a95f63d5 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -1712,7 +1712,10 @@ match_builtin_function_types (tree newtype, tree oldtype, return NULL_TREE; tree oldtype = TYPE_MAIN_VARIANT (TREE_VALUE (oldargs)); - tree newtype = TYPE_MAIN_VARIANT (TREE_VALUE (newargs)); + tree newtype = TREE_VALUE (newargs); + if (newtype == error_mark_node) + return NULL_TREE; + newtype = TYPE_MAIN_VARIANT (newtype); if (!types_close_enough_to_match (oldtype, newtype)) return NULL_TREE; The code above was introduced in r268348 but the ICE predates it.