aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-01-19 13:19:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-01-19 13:19:01 +0000
commite2c768b6440a76c5850ce9fcf5e4e7c395f750db (patch)
tree0f5dc0fcb1d195f9aea40cb224df6113c27ccc84 /gcc
parentd20c47fc8613b26cd7d2c28996474bf910d865c5 (diff)
downloadgcc-e2c768b6440a76c5850ce9fcf5e4e7c395f750db.zip
gcc-e2c768b6440a76c5850ce9fcf5e4e7c395f750db.tar.gz
gcc-e2c768b6440a76c5850ce9fcf5e4e7c395f750db.tar.bz2
re PR tree-optimization/69352 (profiledbootstrap failure with --with-build-config=bootstrap-lto)
2016-01-19 Richard Biener <rguenther@suse.de> PR tree-optimization/69352 * tree-ssa-scopedtables.c (avail_expr_hash): Check for size == -1. (equal_mem_array_ref_p): Constrain size and max size properly. Compare the reverse flag. * gcc.dg/torture/pr69352.c: New testcase. From-SVN: r232557
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69352.c40
-rw-r--r--gcc/tree-ssa-scopedtables.c16
4 files changed, 64 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6cf6bbc..fbf3e76 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69352
+ * tree-ssa-scopedtables.c (avail_expr_hash): Check for size == -1.
+ (equal_mem_array_ref_p): Constrain size and max size properly.
+ Compare the reverse flag.
+
2016-01-19 Bernd Schmidt <bschmidt@redhat.com>
* ira.c (ira): Update regstat data if we deleted insns.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b9365f0..2a60659 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69352
+ * gcc.dg/torture/pr69352.c: New testcase.
+
2016-01-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/68955
diff --git a/gcc/testsuite/gcc.dg/torture/pr69352.c b/gcc/testsuite/gcc.dg/torture/pr69352.c
new file mode 100644
index 0000000..ad718b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69352.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+
+int a[10][14], b, c, d, e, f, g, h, i;
+void bar (void);
+int
+foo (int x)
+{
+ unsigned j;
+ int k = 0, l;
+ int m;
+ if (h)
+ m = 12;
+ else
+ m = 13;
+ if (a[x][m])
+ l = (long) foo;
+ a[x][i] = l;
+ while (c)
+ {
+ if (b)
+ {
+ if (f)
+ k = 1;
+ bar ();
+ }
+ for (; d;)
+ j++;
+ }
+ while (c)
+ {
+ if (a[x][12])
+ {
+ if (g)
+ k = 1;
+ j++;
+ }
+ c = e;
+ }
+ return k;
+}
diff --git a/gcc/tree-ssa-scopedtables.c b/gcc/tree-ssa-scopedtables.c
index af79535..c421f43 100644
--- a/gcc/tree-ssa-scopedtables.c
+++ b/gcc/tree-ssa-scopedtables.c
@@ -225,7 +225,8 @@ avail_expr_hash (class expr_hash_elt *p)
&reverse);
/* Strictly, we could try to normalize variable-sized accesses too,
but here we just deal with the common case. */
- if (size == max_size)
+ if (size != -1
+ && size == max_size)
{
enum tree_code code = MEM_REF;
hstate.add_object (code);
@@ -261,15 +262,22 @@ equal_mem_array_ref_p (tree t0, tree t1)
bool rev0;
HOST_WIDE_INT off0, sz0, max0;
tree base0 = get_ref_base_and_extent (t0, &off0, &sz0, &max0, &rev0);
+ if (sz0 == -1
+ || sz0 != max0)
+ return false;
bool rev1;
HOST_WIDE_INT off1, sz1, max1;
tree base1 = get_ref_base_and_extent (t1, &off1, &sz1, &max1, &rev1);
+ if (sz1 == -1
+ || sz1 != max1)
+ return false;
+
+ if (rev0 != rev1)
+ return false;
- /* Types were compatible, so these are sanity checks. */
+ /* Types were compatible, so this is a sanity check. */
gcc_assert (sz0 == sz1);
- gcc_assert (max0 == max1);
- gcc_assert (rev0 == rev1);
return (off0 == off1) && operand_equal_p (base0, base1, 0);
}