aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-12-30 09:24:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-12-30 09:24:58 +0100
commit87ebde38c04dcb4511e6081e916a6c910ae39e8d (patch)
tree617d95c0b654fc903f9cc9b4e34e82b0b90227f3 /gcc
parentdad6bca98ab71f35eebe7fe9690cca0c105573f7 (diff)
downloadgcc-87ebde38c04dcb4511e6081e916a6c910ae39e8d.zip
gcc-87ebde38c04dcb4511e6081e916a6c910ae39e8d.tar.gz
gcc-87ebde38c04dcb4511e6081e916a6c910ae39e8d.tar.bz2
re PR tree-optimization/47060 (ICE: SIGSEGV in reduction_phi (tree-parloops.c:212) with -O -ffast-math -ftree-parallelize-loops=2 -fno-tree-dce)
PR tree-optimization/47060 * tree-parloops.c (reduction_phi): Return NULL if PHI is NULL. * gcc.dg/autopar/pr47060.c: New test. From-SVN: r168336
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr47060.c21
-rw-r--r--gcc/tree-parloops.c2
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4f29072..067ed75 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47060
+ * tree-parloops.c (reduction_phi): Return NULL if PHI is NULL.
+
2010-12-29 Paul Koning <ni1d@arrl.net>
* config/pdp11/pdp11-protos.h (pdp11_asm_output_var): Declare.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a364a4e..43b5afb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47060
+ * gcc.dg/autopar/pr47060.c: New test.
+
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/enhanced-proto-2.m: Updated.
diff --git a/gcc/testsuite/gcc.dg/autopar/pr47060.c b/gcc/testsuite/gcc.dg/autopar/pr47060.c
new file mode 100644
index 0000000..e8cdfd66
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr47060.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/47060 */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -ftree-parallelize-loops=2 -fno-tree-dce" } */
+
+struct S
+{
+ int n;
+ float *a;
+};
+
+float
+foo (struct S *b)
+{
+ float c, d;
+ int j;
+ for (j = 0; j < b->n; j++)
+ d += b->a[j];
+ for (j = 0; j < b->n; j++)
+ c += b->a[j];
+ return d;
+}
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 9ece887..96759cb 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -201,7 +201,7 @@ reduction_phi (htab_t reduction_list, gimple phi)
{
struct reduction_info tmpred, *red;
- if (htab_elements (reduction_list) == 0)
+ if (htab_elements (reduction_list) == 0 || phi == NULL)
return NULL;
tmpred.reduc_phi = phi;