http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58246
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
We decide to stop because we think that we reached a killing definition when
looking for possible defs of
_8 = t[a.0_6];
and reach, over the loop backedge
t[a.0_6] = 0;
here:
/* Or they need to be exactly the same. */
else if (ref->ref
/* Make sure there is no induction variable involved
in the references (gcc.c-torture/execute/pr42142.c).
The simplest way is to check if the kill dominates
the use. */
&& dominated_by_p (CDI_DOMINATORS, (basic_block) data,
gimple_bb (def_stmt))
&& operand_equal_p (ref->ref, lhs, 0))
return true;
where the dominance check was supposed to prevent this bug from happening...
I have a fix.