aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2016-12-01 23:40:57 -0700
committerJeff Law <law@gcc.gnu.org>2016-12-01 23:40:57 -0700
commitb06496b1617ffcaec0e82fd4cca9eae5e0301cd5 (patch)
treedb4227fedc3e30224dcba3cad2e37c3e156c0c61 /gcc/tree-ssa-threadedge.c
parentf3adbf9e9355aff989bd5b0c6ba227cc01bf57ec (diff)
downloadgcc-b06496b1617ffcaec0e82fd4cca9eae5e0301cd5.zip
gcc-b06496b1617ffcaec0e82fd4cca9eae5e0301cd5.tar.gz
gcc-b06496b1617ffcaec0e82fd4cca9eae5e0301cd5.tar.bz2
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts_at_dest): Avoid temporary propagation of operands if there are no operands. From-SVN: r243152
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r--gcc/tree-ssa-threadedge.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 534292c..3fdd59e 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -328,9 +328,10 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
SSA_NAME_VALUE in addition to its own lattice. */
cached_lhs = gimple_fold_stmt_to_constant_1 (stmt,
threadedge_valueize);
- if (!cached_lhs
- || (TREE_CODE (cached_lhs) != SSA_NAME
- && !is_gimple_min_invariant (cached_lhs)))
+ if (NUM_SSA_OPERANDS (stmt, SSA_OP_ALL_USES) != 0
+ && (!cached_lhs
+ || (TREE_CODE (cached_lhs) != SSA_NAME
+ && !is_gimple_min_invariant (cached_lhs))))
{
/* We're going to temporarily copy propagate the operands
and see if that allows us to simplify this statement. */