On Thu, 23 Feb 2017, Richard Biener wrote:

> 
> This PR shows another defect in path-splittings cost model which the
> following patch tries to improve further.
> 
> Bootstrap and regtest running on x86_64-unknown-linux-gnu.

It has been pointed out this causes compare-debug issues.  Whoops.

Fixed as follows, bootstrapped on x86_64-unknown-linux-gnu, testing in
progress.

Richard.

2017-02-24  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/79389
        * gimple-ssa-split-paths.c (is_feasible_trace): Properly skip
        debug insns.

Index: gcc/gimple-ssa-split-paths.c
===================================================================
--- gcc/gimple-ssa-split-paths.c        (revision 245696)
+++ gcc/gimple-ssa-split-paths.c        (working copy)
@@ -249,6 +249,8 @@ is_feasible_trace (basic_block bb)
                  imm_use_iterator iter2;
                  FOR_EACH_IMM_USE_FAST (use2_p, iter2, gimple_phi_result 
(stmt))
                    {
+                     if (is_gimple_debug (USE_STMT (use2_p)))
+                       continue;
                      basic_block use_bb = gimple_bb (USE_STMT (use2_p));
                      if (use_bb != bb
                          && dominated_by_p (CDI_DOMINATORS, bb, use_bb))
@@ -280,11 +282,15 @@ is_feasible_trace (basic_block bb)
            use_operand_p use_p;
            imm_use_iterator iter;
            FOR_EACH_IMM_USE_FAST (use_p, iter, op)
-             if (gimple_bb (USE_STMT (use_p)) == bb)
-               {
-                 found_cprop_opportunity = true;
-                 break;
-               }
+             {
+               if (is_gimple_debug (USE_STMT (use_p)))
+                 continue;
+               if (gimple_bb (USE_STMT (use_p)) == bb)
+                 {
+                   found_cprop_opportunity = true;
+                   break;
+                 }
+             }
          }
        if (found_cprop_opportunity)
          break;

Reply via email to