This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix match-and-simplify regression
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Nov 2014 10:53:25 +0100 (CET)
- Subject: [PATCH] Fix match-and-simplify regression
- Authentication-results: sourceware.org; auth=none
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 <rguenther@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)))