diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-11 08:14:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-11 08:14:44 +0000 |
commit | ad1f9c12743b531bfe3077bc366ce0a5d73f94ff (patch) | |
tree | 1f93266ba272ee270a6ad7b854a342625fa9c228 /gcc/tree-ssa-propagate.c | |
parent | ea538e0692ec5ff2e6a1e983b72092eedfd3ad84 (diff) | |
download | gcc-ad1f9c12743b531bfe3077bc366ce0a5d73f94ff.tar.gz |
2005-05-11 Richard Guenther <rguenth@gcc.gnu.org>
PR middle-end/19807
PR tree-optimization/19639
* fold-const.c (try_move_mult_to_index): Handle INTEGER_CST
and generic summands for char* as s * delta, too, folding &a[i]
CODE x to &a[i CODE x/s]. Use tree_int_cst_equal
for comparison of steps. Convert types for index addition.
(fold_binary): Adjust the callers to always dispatch to
try_move_mult_to_index.
* tree-ssa-propagate.c (set_rhs): Avoid setting rhs to
expr with non-gimple ARRAY_REF offset.
* g++.dg/tree-ssa/pr19807.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index 9f9fef100fa..c83d2cdff9d 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -576,6 +576,12 @@ set_rhs (tree *stmt_p, tree expr) if (!is_gimple_val (TREE_OPERAND (expr, 0))) return false; } + else if (code == ADDR_EXPR) + { + if (TREE_CODE (TREE_OPERAND (expr, 0)) == ARRAY_REF + && !is_gimple_val (TREE_OPERAND (TREE_OPERAND (expr, 0), 1))) + return false; + } else if (code == COMPOUND_EXPR) return false; |