http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50133
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-21 17:43:08 UTC --- Insert before gsi_end_p should be fine, you just can't copy locus from it in that case. So you could as well do something like: si = *gsi; if (gsi_end_p (si)) { gsi_prev (&si); gsi_prev_nondebug (&si); } else if (is_gimple_debug (gsi_stmt (si))) { gsi_next_nondebug (&si); gcc_assert (!gsi_end_p (si)); } where the first gsi_prev would move from the end to the newly inserted stmt and gsi_prev_nondebug to the previous stmt (skipping any debug stmts). This wouldn't work when inserting into a completely empty bb, but does the vectorizer ever do something like that?