https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86637

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is we use vect_location via DUMP_VECT_SCOPE before we
set it, thus using an old location in a function where we may have GCed
BLOCKs, etc.  The loop vectorization pass resets it via

  vect_location = dump_user_location_t ();

(?)  but the SLP vectorization pass not.

diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 0a4eca51ad7..1a6cb56a872 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1303,6 +1303,8 @@ pass_slp_vectorize::execute (function *fun)
       loop_optimizer_finalize ();
     }

+  vect_location = dump_user_location_t ();
+
   return 0;
 }


This fixes one testcase.  I'm going to apply that.

Reply via email to