[Bug c/123461] [16 Regression] ICE in mark_decl_used with some unsized array types

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 9 22:30:36 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123461

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have a fix, introduced by r16-3747-gafa74d37e8170d .

diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 10b4d77daee..98249b92269 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -13065,10 +13065,10 @@ declspecs_add_type (location_t loc, struct
c_declspecs *specs,
     error_at (loc, "two or more data types in declaration specifiers");
   else if (TREE_CODE (type) == TYPE_DECL)
     {
-      mark_decl_used (type, false);
       specs->type = TREE_TYPE (type);
       if (TREE_TYPE (type) != error_mark_node)
        {
+         mark_decl_used (type, false);
          specs->decl_attr = DECL_ATTRIBUTES (type);
          specs->typedef_p = true;
          specs->explicit_signed_p = C_TYPEDEF_EXPLICITLY_SIGNED (type);


More information about the Gcc-bugs mailing list