re PR rtl-optimization/32069 (segfault in regclass() with -O0 -fsplit-wide-types)
authorIan Lance Taylor <iant@google.com>
Thu, 24 May 2007 22:12:31 +0000 (22:12 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 May 2007 22:12:31 +0000 (22:12 +0000)
PR rtl-optimization/32069
* regclass.c (regclass): Don't crash if the entry in regno_reg_rtx
is NULL.

From-SVN: r125043

gcc/ChangeLog
gcc/regclass.c
gcc/testsuite/gcc.dg/pr32069.c [new file with mode: 0644]

index eb66eff..745e89a 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-24  Ian Lance Taylor  <iant@google.com>
+
+       PR rtl-optimization/32069
+       * regclass.c (regclass): Don't crash if the entry in regno_reg_rtx
+       is NULL.
+
 2007-05-24  Ollie Wild  <aaw@google.com>
 
        * doc/cpp.texi (Common Predefined Macros): Add __COUNTER__
index 635f2d3..23fd092 100644 (file)
@@ -1214,6 +1214,9 @@ regclass (rtx f, int nregs)
          int class;
          struct costs *p = &costs[i];
 
+         if (regno_reg_rtx[i] == NULL)
+           continue;
+
          /* In non-optimizing compilation REG_N_REFS is not initialized
             yet.  */
          if (optimize && !REG_N_REFS (i) && !REG_N_SETS (i))
diff --git a/gcc/testsuite/gcc.dg/pr32069.c b/gcc/testsuite/gcc.dg/pr32069.c
new file mode 100644 (file)
index 0000000..2ec37c6
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do-compile } */
+/* { dg-options "-O0 -fsplit-wide-types" } */
+
+long long int segfault (long long int a, long long int b)
+{
+  return a ^ b;
+}