[PR debug/46931] don't crash propagating removed DEFs into debug stmts
Alexandre Oliva
aoliva@redhat.com
Tue Dec 21 10:32:00 GMT 2010
On Dec 18, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:
> The statements are artificially created by the vectorizer,
Not really.
The loop contains these statements and debug stmts.
SCCP replaces the end-of-loop PHI nodes with final value computations,
making the in-loop DEF dead, but not removing it.
The vectorizer actually vectorizes the loop.
While doing so, it duplicates the original loop into pre- and post-
loops, for proper loop alignment.
Because of the renaming in the post-vectorized loop, we examine the
copied DEF in there and realize it is dead, so we remove it.
If we don't propagate the DEF into the copied debug stmts, we'll make
the variable incorrect within the post-loop.
> They are also the only statements that are supposed to be removed by
> the very simple DCE - but we cannot identify them reliably. Is this
> patch not adding another hack above the DCE hack I installed?
Dunno, really. Sure we run this very simple DCE right after SCCP, so as
to remove the dead in-loop DEF then? It might obviate this change, but
it's not unreasonable to put it in anyway, I think, especially after
reinstate a more general condition to enable the copying. The
is_gimple_min_invariant() test was a last-minute thought that was
supposed to be extended so as to handle the case at hand but not other
expressions that can't be moved about, but that I forgot about before
testing and posting the patch. Oops ;-)
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer
More information about the Gcc-patches
mailing list