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

Martin Sebor <msebor at gcc dot gnu.org> changed:

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

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks. I can see the problem(s) now.

Working on a patch (the file compiles with the following otherwise untested
fix).

Index: cp/mangle.c
===================================================================
--- cp/mangle.c (revision 232296)
+++ cp/mangle.c (working copy)
@@ -3296,6 +3296,9 @@ write_array_type (const tree type)
       /* The INDEX_TYPE gives the upper and lower bounds of the
         array.  */
       max = TYPE_MAX_VALUE (index_type);
+      if (max == NULL_TREE)
+         max = build_all_ones_cst (size_type_node);
+
       if (TREE_CODE (max) == INTEGER_CST)
        {
          /* The ABI specifies that we should mangle the number of
Index: cp/pt.c
===================================================================
--- cp/pt.c     (revision 232296)
+++ cp/pt.c     (working copy)
@@ -19108,7 +19108,13 @@ unify_array_domain (tree tparms, tree ta
       parm_max = TREE_OPERAND (parm_max, 0);
     }
   arg_max = TYPE_MAX_VALUE (arg_dom);
-  arg_cst = TREE_CODE (arg_max) == INTEGER_CST;
+  if (arg_max)
+    arg_cst = TREE_CODE (arg_max) == INTEGER_CST;
+  else
+    {
+      arg_max = build_all_ones_cst (size_type_node);
+      arg_cst = true;
+    }
   if (!arg_cst)
     {
       /* The ARG_MAX may not be a simple MINUS_EXPR, if we are

Reply via email to