diff options
author | Ian Lance Taylor <iant@google.com> | 2007-05-24 22:12:31 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-05-24 22:12:31 +0000 |
commit | 88d1c2ad47c6c456d90c349f8dc3ec680514cdb8 (patch) | |
tree | a51eee538bf4275a5d41a75397a09c881803929e | |
parent | 0f17a91f46ff2fe1c6ba75e02fe06993fa987eb2 (diff) | |
download | gcc-88d1c2ad47c6c456d90c349f8dc3ec680514cdb8.zip gcc-88d1c2ad47c6c456d90c349f8dc3ec680514cdb8.tar.gz gcc-88d1c2ad47c6c456d90c349f8dc3ec680514cdb8.tar.bz2 |
re PR rtl-optimization/32069 (segfault in regclass() with -O0 -fsplit-wide-types)
PR rtl-optimization/32069
* regclass.c (regclass): Don't crash if the entry in regno_reg_rtx
is NULL.
From-SVN: r125043
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/regclass.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr32069.c | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb66eff..745e89a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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__ diff --git a/gcc/regclass.c b/gcc/regclass.c index 635f2d3..23fd092 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -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 index 0000000..2ec37c6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr32069.c @@ -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; +} |