[gcc r17-2822] [rs6000] Fixup stmt_vinfo walk

Richard Biener via Gcc-cvs <[email protected]> Thu, 30 Jul 2026 10:36:20 +0000 (GMT)
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:415b253df42e9ff5188135aa72caa694b7ea9f34

commit r17-2822-g415b253df42e9ff5188135aa72caa694b7ea9f34
Author: Richard Biener <[email protected]>
Date:   Thu Jul 30 12:33:05 2026 +0200

    [rs6000] Fixup stmt_vinfo walk
    
    The following properly skips labels as we no longer generate
    stmt_vec_info structures for those.
    
            * config/rs6000/rs6000.cc (rs6000_cost_data::density_test):
            Start BB walk after labels.

Diff:
---
 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 c620d1a31e87..000295340062 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))