aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-11-04 14:07:48 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-11-04 14:07:48 +0000
commit844d5fca1fcf3c1adf83b7c0b8e0d8e4141b5c33 (patch)
tree9dfb1a2c2186d79896700632d2853ce4acacea9e /gcc
parente9fcdd9fdfccb59cf22574bb091575f9e5b38ff2 (diff)
downloadgcc-844d5fca1fcf3c1adf83b7c0b8e0d8e4141b5c33.zip
gcc-844d5fca1fcf3c1adf83b7c0b8e0d8e4141b5c33.tar.gz
gcc-844d5fca1fcf3c1adf83b7c0b8e0d8e4141b5c33.tar.bz2
re PR tree-optimization/45991 (ICE: verify_stmts failed: Invalid address operand in in TARGET_MEM_REF. with -fstrict-overflow)
2010-11-04 Richard Guenther <rguenther@suse.de> PR tree-optimization/45991 * gimplify.c (force_gimple_operand_1): Use the provded test function in the initial test. * gcc.dg/pr45991.c: New testcase. From-SVN: r166312
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr45991.c20
4 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12f72b8..705c9ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/45991
+ * gimplify.c (force_gimple_operand_1): Use the provded test
+ function in the initial test.
+
2010-11-04 Jeff Law <law@redhat.com>
* ira.c (validate_equiv_mem): Remove code to avoid invalidation
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d5a633c..f490349 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8047,7 +8047,11 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts,
*stmts = NULL;
- if (is_gimple_val (expr))
+ /* gimple_test_f might be more strict than is_gimple_val, make
+ sure we pass both. Just checking gimple_test_f doesn't work
+ because most gimple predicates do not work recursively. */
+ if (is_gimple_val (expr)
+ && (*gimple_test_f) (expr))
return expr;
push_gimplify_context (&gctx);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d20cee4..c5ce28b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2010-11-04 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/45991
+ * gcc.dg/pr45991.c: New testcase.
+
+2010-11-04 Richard Guenther <rguenther@suse.de>
+
PR tree-optimization/46154
* g++.dg/torture/pr46154.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/pr45991.c b/gcc/testsuite/gcc.dg/pr45991.c
new file mode 100644
index 0000000..eefce44
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr45991.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow" } */
+
+struct S
+{
+ int i;
+};
+
+char A[64];
+
+void foo (char **dst, int i)
+{
+ char *p = A + 16;
+ while (i--)
+ {
+ int b = ((struct S *) (&p[i * 16 + 4]))->i;
+ char *c = A + i * 16;
+ dst[i] = c + b;
+ }
+}