This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Loop fix


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]