The following properly skips labels as we no longer generate
stmt_vec_info structures for those.

Will push as obvious after a smoke cc1-build.

        * config/rs6000/rs6000.cc (rs6000_cost_data::density_test):
        Start BB walk after labels.
---
 gcc/config/rs6000/rs6000.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index c620d1a31e8..00029534006 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -5301,7 +5301,7 @@ rs6000_cost_data::density_test (loop_vec_info loop_vinfo)
       basic_block bb = bbs[i];
       gimple_stmt_iterator gsi;
 
-      for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+      for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
        {
          gimple *stmt = gsi_stmt (gsi);
          if (is_gimple_debug (stmt))
-- 
2.51.0

Reply via email to