2005-05-11 Richard Guenther <rguenth@gcc.gnu.org>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 May 2005 08:14:44 +0000 (08:14 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 May 2005 08:14:44 +0000 (08:14 +0000)
commitad1f9c12743b531bfe3077bc366ce0a5d73f94ff
tree1f93266ba272ee270a6ad7b854a342625fa9c228
parentea538e0692ec5ff2e6a1e983b72092eedfd3ad84
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
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr19807.C [new file with mode: 0644]
gcc/tree-ssa-propagate.c