https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101313
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This fixes the ICE: ``` [apinski@xeond2 gcc]$ git diff diff --git a/gcc/expr.cc b/gcc/expr.cc index 2918c469735..06f640009c6 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -7014,7 +7014,7 @@ count_type_elements (const_tree type, bool for_ctor_p) of the fields. */ n = 1; for (f = TYPE_FIELDS (type); f ; f = DECL_CHAIN (f)) - if (TREE_CODE (f) == FIELD_DECL) + if (TREE_CODE (f) == FIELD_DECL && !error_operand_p (f)) { m = count_type_elements (TREE_TYPE (f), false); /* If the field doesn't span the whole union, add an extra ``` Since this function is only called from the FE or while gimplifying, the check for error_operand should be ok.