diff options
author | Richard Guenther <rguenther@suse.de> | 2006-03-07 16:23:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-03-07 16:23:38 +0000 |
commit | 6f1be8e1f461e5e7595470be4c27c0de4f261d03 (patch) | |
tree | 8aaa4a0f71961547de981e292cec51d6b54f37c8 /gcc/tree-ssa-structalias.c | |
parent | 6410fb814b1aa1d01aa99919769f9079b2773c4e (diff) | |
download | gcc-6f1be8e1f461e5e7595470be4c27c0de4f261d03.zip gcc-6f1be8e1f461e5e7595470be4c27c0de4f261d03.tar.gz gcc-6f1be8e1f461e5e7595470be4c27c0de4f261d03.tar.bz2 |
re PR tree-optimization/26587 (strict aliasing incorrectly pre-loads an array element with loops)
2006-03-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26587
* tree-ssa-structalias.c (handle_ptr_arith): Handle MINUS_EXPR.
* gcc.dg/torture/pr26587.c: New testcase.
From-SVN: r111808
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index a9032a3..b5e0830 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3182,7 +3182,8 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr) VEC (ce_s, heap) *temp = NULL; unsigned int rhsoffset = 0; - if (TREE_CODE (expr) != PLUS_EXPR) + if (TREE_CODE (expr) != PLUS_EXPR + && TREE_CODE (expr) != MINUS_EXPR) return false; op0 = TREE_OPERAND (expr, 0); @@ -3190,7 +3191,8 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr) get_constraint_for (op0, &temp); if (POINTER_TYPE_P (TREE_TYPE (op0)) - && TREE_CODE (op1) == INTEGER_CST) + && TREE_CODE (op1) == INTEGER_CST + && TREE_CODE (expr) == PLUS_EXPR) { rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT; } |