re PR tree-optimization/24689 (operand_equal_p does not return true for some equivale...
authorRichard Guenther <rguenther@suse.de>
Thu, 12 Apr 2007 09:15:53 +0000 (09:15 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 12 Apr 2007 09:15:53 +0000 (09:15 +0000)
commit5852948c5b998dc8ddd9073ca68c097b96180838
tree03bea213dba9cc1181e65e0dcad9f2ea2208af80
parentd51347f96ce3765c6fad1c4e50c2b911e350339f
re PR tree-optimization/24689 (operand_equal_p does not return true for some equivalent ARRAY_REF)

2007-04-12  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/24689
PR tree-optimization/31307
* fold-const.c (operand_equal_p): Compare INTEGER_CST array
indices by value.
* gimplify.c (canonicalize_addr_expr): To be consistent with
gimplify_compound_lval only set operands two and three of
ARRAY_REFs if they are not gimple_min_invariant.  This makes
it never at this place.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise.

* g++.dg/tree-ssa/pr31307.C: New testcase.
* gcc.dg/tree-ssa/pr24689.c: Likewise.

From-SVN: r123736
gcc/ChangeLog
gcc/fold-const.c
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr31307.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr24689.c [new file with mode: 0644]
gcc/tree-ssa-ccp.c