http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53226

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-08 
12:09:05 UTC ---
(In reply to comment #9)
> Ugh, remove_prop_source_from_use can remove stmts while prev iterator points 
> to
> them.  This has been buggy before, but didn't result in endless loop.
> I guess instead of using prev/prev_initialized, the loop could gimple_set_uid
> (stmt, 0) the stmts it is about to process and gimple_set_uid (stmt, 1) stmts
> that don't need to be processed again, then gsi = prev; could be just replaced
> by doing gsi_prev (&gsi); enough times to reach start of bb or a stmt with uid
> 1.

The other way is to try to get away without immediately removing propagated
source stmts - the obvious downside is that transforms relying on
single-use definitions will be confused by those dead uses (but the scheme
how it works now is fragile anyway because we are not sure we visit the stmts
in the correct order).

Reply via email to