diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a5a83ee..8c642d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-07-01 Daniel Berlin <dberlin@dberlin.org> + Fix PR tree-optimization/32571 + * tree-ssa-sccvn.c (visit_use): Shortcut copies to avoid + simplifying them. + +2007-07-01 Daniel Berlin <dberlin@dberlin.org> + * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants and other expected operations explicitly, change default to gcc_unreachable. diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 45ebe08..b0db122 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1545,6 +1545,13 @@ visit_use (tree use) STRIP_USELESS_TYPE_CONVERSION (rhs); + /* Shortcut for copies. Simplifying copies is pointless, + since we copy the expression and value they represent. */ + if (TREE_CODE (rhs) == SSA_NAME && TREE_CODE (lhs) == SSA_NAME) + { + changed = visit_copy (lhs, rhs); + goto done; + } simplified = try_to_simplify (stmt, rhs); if (simplified && simplified != rhs) { @@ -1623,8 +1630,6 @@ visit_use (tree use) VN_INFO (lhs)->expr = rhs; changed = set_ssa_val_to (lhs, rhs); } - else if (TREE_CODE (rhs) == SSA_NAME) - changed = visit_copy (lhs, rhs); else { switch (TREE_CODE_CLASS (TREE_CODE (rhs))) |