This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Bug in jump threading
- From: law at redhat dot com
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 05 Feb 2004 12:28:15 -0700
- Subject: Re: [tree-ssa] Bug in jump threading
- Reply-to: law at redhat dot com
In message <20040205095804.GA32427@atrey.karlin.mff.cuni.cz>, Zdenek Dvorak wri
tes:
>
>--zhXaljGHf11kAtnf
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>
>Hello,
>
>the jump threading works incorrectly in this situation:
>
>x_1 = pointer;
>t_1 = x_1->field;
>
>if (t_1)
> goto L1;
>
> ...
>
>
>L1:
> x1_1 = pointer;
> if (!x1_1)
> goto L2;
>
>...
>
>L2:
> x1_2 = phi (..., x1_1 (from L1 block));
> ...
>
>before the goto L1 is threaded to L2, variables are rewritten out of
>ssa:
>
>x = pointer;
>t_1 = x->field;
>
>if (t_1)
> goto L1;
>
> ...
>
>
>L1:
> x1 = pointer;
> if (!x1)
> goto L2;
>
> ...
>
>L2:
> ...
>
>Now when you thread the jump, you lose the assignment to x1.
Thanks. I had run into this once, but after some changes elsewhere I
had been unable to trigger it again no matter how hard I tried and
ended up dropping the hunk which dealt with this problem.
This shouldn't be terribly difficult to fix. The only "trick" is I'll
be on the road the rest of this week (sigh).
jeff