This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] doloop_optimize miscompiles openssl
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: [PATCH] doloop_optimize miscompiles openssl
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Mon, 25 Sep 2000 10:58:21 +0200
- Cc: gcc-bugs at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- References: <Franz Sirl's message of "Mon, 25 Sep 2000 00:02:35 +0200"><00092419490102.01070@enzo.bigblue.local><00092500023500.30947@enzo.bigblue.local>
At 07:24 25.09.00, Geoff Keating wrote:
>Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
>
> > * doloop.c (doloop_modify): Prevent delete_insn() from
> > deleting too much. Prefer loop->top over loop->start as
> > target for the new JUMP insn.
>
> > Index: gcc/doloop.c
> > ===================================================================
> > RCS file: /cvs/gcc/egcs/gcc/doloop.c,v
> > retrieving revision 1.2
> > diff -u -p -r1.2 doloop.c
> > --- doloop.c 2000/08/14 20:55:11 1.2
> > +++ doloop.c 2000/09/24 22:00:04
> > @@ -416,11 +416,14 @@ doloop_modify (loop, iterations, iterati
> > }
> >
> > /* Discard original jump to continue loop. The original compare
> > - result may still be live, so it cannot be discarded explicitly. */
> > + result may still be live, so it cannot be discarded explicitly.
> > + Don't delete too much, increment the use count of the target
> label. */
> > + LABEL_NUSES (JUMP_LABEL (jump_insn))++;
> > delete_insn (jump_insn);
> > + LABEL_NUSES (JUMP_LABEL (jump_insn))--;
> >
> > - /* Emit the label that will delimit the start of the loop. */
> > - emit_label_after (start_label, loop->start);
> > + /* Emit the label that will delimit the top of the loop. */
> > + emit_label_after (start_label, loop->top ? loop->top : loop->start);
> > LABEL_NUSES (start_label)++;
>
>Franz,
>
>would it work to simply emit the start_label before calling
>delete_insn? After all, the label that jump_insn branches to is
>really not used after this transformation, right?
Hmm, I think so... If delete_insn notices that the code is reachable from
elsewhere, it should refrain from deleting it. I'll try it when I'm home.
Franz.