]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/6706 (ICE with variable-sized arrays and DWARF-1 output)
authorMark Mitchell <mark@codesourcery.com>
Fri, 5 Jul 2002 16:37:44 +0000 (16:37 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 5 Jul 2002 16:37:44 +0000 (16:37 +0000)
PR c++/6706
* dwarfout.c (output_reg_number): Fix warning message.
(output_bound_representation): Check SAVE_EXPR_RTL is not NULL
before using it.

PR c++/6706
* g++.dg/debug/debug6.C: New test.
* g++.dg/debug/debug7.C: New test.

From-SVN: r55263

gcc/ChangeLog
gcc/dwarfout.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/debug6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/debug7.C [new file with mode: 0644]

index d33b6fbd66861750c2ec7d2b3823e9c62dc04cf6..411d825e1e3619f1b78b3cad1ec849b81be7f788 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-03  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/6706
+       * dwarfout.c (output_reg_number): Fix warning message.
+       (output_bound_representation): Check SAVE_EXPR_RTL is not NULL
+       before using it.
+       
 2002-07-03  Richard Henderson  <rth@redhat.com>
 
        * config/i386/i386.md (prologue_get_pc): Issue pop here ...
index 76b5b75383b4c8f5a64136dbdf07fc75cd646360..481d0c0441a34b3f77a55b10997842980b81af8c 100644 (file)
@@ -2086,7 +2086,8 @@ output_reg_number (rtl)
 
   if (regno >= DWARF_FRAME_REGISTERS)
     {
-      warning_with_decl (dwarf_last_decl, "internal regno botch: regno = %d\n",
+      warning_with_decl (dwarf_last_decl, 
+                        "internal regno botch: `%s' has regno = %d\n",
                         regno);
       regno = 0;
     }
@@ -2303,7 +2304,8 @@ output_bound_representation (bound, dim_num, u_or_l)
                   || TREE_CODE (bound) == CONVERT_EXPR)
              bound = TREE_OPERAND (bound, 0);
 
-           if (TREE_CODE (bound) == SAVE_EXPR)
+           if (TREE_CODE (bound) == SAVE_EXPR 
+               && SAVE_EXPR_RTL (bound))
              output_loc_descriptor
                (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX));
          }
index 56d9ea13c244a0a6cd4419416e7307ce6b501fa1..afbd316398a3bb632df25bf83ce00d1e093ac7d6 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-03  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/6706
+       * g++.dg/debug/debug6.C: New test.
+       * g++.dg/debug/debug7.C: New test.
+
 2002-07-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/6944
diff --git a/gcc/testsuite/g++.dg/debug/debug6.C b/gcc/testsuite/g++.dg/debug/debug6.C
new file mode 100644 (file)
index 0000000..64f121b
--- /dev/null
@@ -0,0 +1,7 @@
+// { dg-do compile }
+
+void foo()
+{
+  int i=1, x[i];
+}
+
diff --git a/gcc/testsuite/g++.dg/debug/debug7.C b/gcc/testsuite/g++.dg/debug/debug7.C
new file mode 100644 (file)
index 0000000..78faa20
--- /dev/null
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+void f (int);
+
+int
+main() {
+
+  int a = 4;
+  int b = 5;
+  int (*x)[b] = new int[a][b];
+
+  x[2][1] = 7;
+
+  for (int i = 0; i < a; ++i)
+    for (int j = 0; j < b; ++j)
+      f (x[i][j]);
+  delete [] x;
+}