re PR tree-optimization/65650 (CCP does not propgate copies)
authorRichard Biener <rguenther@suse.de>
Tue, 21 Apr 2015 12:52:43 +0000 (12:52 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 21 Apr 2015 12:52:43 +0000 (12:52 +0000)
commit0ff093d85530159d74f77edc0da5d8bd176fe953
tree2360651c91e90b4d553f511d0ad13639ea0d08ca
parent9588d24871d34967389a1396e3df16c61eacd54c
re PR tree-optimization/65650 (CCP does not propgate copies)

2015-04-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/65650
* tree-ssa-ccp.c (valid_lattice_transition): Allow lattice
transitions involving copies.
(set_lattice_value): Adjust for copy lattice state.
(ccp_lattice_meet): Do not merge UNDEFINED and a copy to the copy
if that doesn't dominate the merge point.
(bit_value_unop): Adjust what we treat as varying mask.
(bit_value_binop): Likewise.
(bit_value_assume_aligned): Likewise.
(evaluate_stmt): When we simplified to a SSA name record a copy
instead of dropping to varying.
(visit_assignment): Simplify.

* gimple-match.h (gimple_simplify): Add another callback.
* gimple-fold.c (fold_stmt_1): Adjust caller.
(gimple_fold_stmt_to_constant_1): Likewise - pass valueize
for the 2nd callback.
* gimple-match-head.c (gimple_simplify): Add a callback that is
used to valueize the stmt operands and use it that way.

* gcc.dg/tree-ssa/ssa-ccp-37.c: New testcase.
* gcc.dg/tree-ssa/forwprop-11.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-3.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-4.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-5.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-32.c: Likewise.

From-SVN: r222267
12 files changed:
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-match-head.c
gcc/gimple-match.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/forwprop-11.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-37.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-32.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c
gcc/tree-ssa-ccp.c