The following allows gimple_fold_stmt_to_constant_1 in SCCVN to follow SSA edges. This fixes regressions caused by no longer dispatching to fold_unary from it.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2014-11-27 Richard Biener <rguent...@suse.de> * tree-ssa-sccvn.c (try_to_simplify): Allow gimple_fold_stmt_to_constant_1 to follow SSA edges. Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (revision 218114) +++ gcc/tree-ssa-sccvn.c (working copy) @@ -3461,7 +3461,7 @@ try_to_simplify (gassign *stmt) return NULL_TREE; /* First try constant folding based on our current lattice. */ - tem = gimple_fold_stmt_to_constant_1 (stmt, vn_valueize); + tem = gimple_fold_stmt_to_constant_1 (stmt, vn_valueize, vn_valueize); if (tem && (TREE_CODE (tem) == SSA_NAME || is_gimple_min_invariant (tem)))