This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR rtl-optimization/49710 (segfault in loop peeling)
- From: Zdenek Dvorak <rakdver at iuuk dot mff dot cuni dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Jan 2012 14:24:01 +0100
- Subject: Re: PR rtl-optimization/49710 (segfault in loop peeling)
- References: <20120104130144.GB8299@kam.mff.cuni.cz>
Hi,
> --- 316,333 ----
> normally. We may assume that e->dest is not a header of any loop,
> as it now has exactly one predecessor. */
> while (loop_outer (e->src->loop_father)
> ! && dominated_by_p (CDI_DOMINATORS,
> ! e->src->loop_father->latch, e->dest))
> unloop (e->src->loop_father, &irred_invalidated);
> + l = e->src->loop_father;
> + while (l && loop_outer (l))
> + {
> + while (loop_outer (loop_outer (l))
> + && dominated_by_p (CDI_DOMINATORS,
> + loop_outer (l)->latch, e->dest))
> + unloop (loop_outer (l), &irred_invalidated);
> + l = loop_outer (l);
> + }
this will not work when e->src->loop_father is the cancelled loop,
since the first loop tested for removal is loop_outer (e->src->loop_father).
I would suggest
for (l = e->src->loop_father; loop_outer (l); l = f)
{
f = loop_outer (l);
if (dominated_by_p (CDI_DOMINATORS, l->latch, e->dest))
unloop (l, &irred_invalidated);
}
Otherwise ok,
Zdenek