The following avoids allocating stmt_vec_info for labels.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

        * tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Also
        skip labels.
        * tree-vect-slp.cc (_bb_vec_info::_bb_vec_info): Likewise.
        * tree-vect-data-refs.cc (vect_analyze_early_break_dependences):
        Skip labels.
---
 gcc/tree-vect-data-refs.cc | 2 +-
 gcc/tree-vect-loop.cc      | 2 +-
 gcc/tree-vect-slp.cc       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index 0e0754769ae..16808ab53be 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -729,7 +729,7 @@ vect_analyze_early_break_dependences (loop_vec_info 
loop_vinfo)
        {
          gimple *stmt = gsi_stmt (gsi);
          gsi_prev (&gsi);
-         if (is_gimple_debug (stmt))
+         if (is_gimple_debug (stmt) || is_a <glabel *> (stmt))
            continue;
 
          stmt_vec_info orig_stmt_vinfo = loop_vinfo->lookup_stmt (stmt);
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 250935bee33..150ceff90b7 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -805,7 +805,7 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, 
vec_info_shared *shared)
        {
          gimple *stmt = gsi_stmt (si);
          gimple_set_uid (stmt, 0);
-         if (is_gimple_debug (stmt))
+         if (is_gimple_debug (stmt) || is_a <glabel *> (stmt))
            continue;
          add_stmt (stmt);
          /* If .GOMP_SIMD_LANE call for the current loop has 3 arguments, the
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 11217cfc6fb..bdd9026c14f 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -8794,7 +8794,7 @@ _bb_vec_info::_bb_vec_info (vec<basic_block> _bbs, 
vec_info_shared *shared)
        {
          gimple *stmt = gsi_stmt (gsi);
          gimple_set_uid (stmt, 0);
-         if (is_gimple_debug (stmt))
+         if (is_gimple_debug (stmt) || is_a <glabel *> (stmt))
            continue;
          add_stmt (stmt);
        }
-- 
2.51.0

Reply via email to