This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Loop fix
- To: Jeffrey A Law <law at cygnus dot com>
- Subject: Re: [PATCH] Loop fix
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 2 Aug 2000 19:36:32 +0200
- Cc: Bernd Schmidt <bernds at cygnus dot co dot uk>, gcc-patches at gcc dot gnu dot org
- References: <20000801182407.K26939@sunsite.ms.mff.cuni.cz> <26895.965232462@upchuck>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 02, 2000 at 10:07:42AM -0600, Jeffrey A Law wrote:
> In message <20000801182407.K26939@sunsite.ms.mff.cuni.cz>you write:
> > Is it ok to commit this patch? Other loop.c code solves similar problems th
> > e
> > same way AFAIC.
> >
> > 2000-08-01 Jakub Jelinek <jakub@redhat.com>
> >
> > * loop.c (scan_loop): Ensure update_end label does not
> > go away until reg_scan_update is run.
> Jakub -- you should send the updated version of this patch to gcc-patches,
> then install the updated version.
>
> For everyone else -- Jakub found a buglet in this version and submitted a
> newer one to one of Red Hat's internal lists.
I have just commited this (bootstrapped, regression tested on i386):
2000-08-02 Jakub Jelinek <jakub@redhat.com>
* loop.c (scan_loop): Ensure update_end label does not
go away until reg_scan_update is run.
--- gcc/loop.c.jj Tue Aug 1 15:42:24 2000
+++ gcc/loop.c Tue Aug 1 17:56:58 2000
@@ -1131,11 +1131,19 @@ scan_loop (loop, flags)
if (flag_strength_reduce)
{
+ if (update_end && GET_CODE (update_end) == CODE_LABEL)
+ /* Ensure our label doesn't go away. */
+ LABEL_NUSES (update_end)++;
+
the_movables = movables;
strength_reduce (loop, insn_count, flags);
reg_scan_update (update_start, update_end, loop_max_reg);
loop_max_reg = max_reg_num ();
+
+ if (update_end && GET_CODE (update_end) == CODE_LABEL
+ && --LABEL_NUSES (update_end) == 0)
+ delete_insn (update_end);
}
VARRAY_FREE (reg_single_usage);
Jakub