* tree-ssa-threadedge.c
authorJeff Law <law@redhat.com>
Fri, 2 Dec 2016 06:40:57 +0000 (23:40 -0700)
committerJeff Law <law@gcc.gnu.org>
Fri, 2 Dec 2016 06:40:57 +0000 (23:40 -0700)
(record_temporary_equivalences_from_stmts_at_dest): Avoid temporary
propagation of operands if there are no operands.

From-SVN: r243152

gcc/ChangeLog
gcc/tree-ssa-threadedge.c

index c3170c0ebf3cc2ce4069f743bd0acf1eb1dc289a..75881ee7ace3b66fa1cbcbc5e8d0d8bc713a5821 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-01  Jeff Law  <law@redhat.com>
+
+       * tree-ssa-threadedge.c
+       (record_temporary_equivalences_from_stmts_at_dest): Avoid temporary
+       propagation of operands if there are no operands.
+
 2016-12-02  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/78586
index 534292c19e5a4ce3c6b0ae129adcacdc9635bc89..3fdd59e6804212ec3be8f745431c062b52fe3a8c 100644 (file)
@@ -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.  */