diff options
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index fa5b22e..d271049 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -86,6 +86,15 @@ along with GCC; see the file COPYING3. If not see /* Loop or bb location, with hotness information. */ dump_user_location_t vect_location; +/* auto_purge_vect_location's dtor: reset the vect_location + global, to avoid stale location_t values that could reference + GC-ed blocks. */ + +auto_purge_vect_location::~auto_purge_vect_location () +{ + vect_location = dump_user_location_t (); +} + /* Dump a cost entry according to args to F. */ void @@ -860,6 +869,7 @@ try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab, { unsigned ret = 0; vec_info_shared shared; + auto_purge_vect_location sentinel; vect_location = find_loop_location (loop); if (LOCATION_LOCUS (vect_location.get_location_t ()) != UNKNOWN_LOCATION && dump_enabled_p ()) @@ -1269,6 +1279,7 @@ public: unsigned int pass_slp_vectorize::execute (function *fun) { + auto_purge_vect_location sentinel; basic_block bb; bool in_loop_pipeline = scev_initialized_p (); @@ -1303,8 +1314,6 @@ pass_slp_vectorize::execute (function *fun) loop_optimizer_finalize (); } - vect_location = dump_user_location_t (); - return 0; } |