This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH COMMITTED: Fix for PR 32069: -O0 -fsplit-wide-types


PR 32069 is about an ICE when using -fsplit-wide-types -O0.  This is
an odd combination.  But of course the compiler should not crash.
This patch fixes it.

Bootstrapped and tested on i686-pc-linux-gnu.  Committed.

Ian


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.


Index: regclass.c
===================================================================
--- regclass.c	(revision 125032)
+++ regclass.c	(working copy)
@@ -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))
Index: testsuite/gcc.dg/pr32069.c
===================================================================
--- testsuite/gcc.dg/pr32069.c	(revision 0)
+++ testsuite/gcc.dg/pr32069.c	(revision 0)
@@ -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;
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]