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] to correct bad unrolling



  In message <200009011534.IAA15185@cygnus.com>you write:
  > The attached patch corrects a problem with the unroller when 
  > the number of loop iterations is one.  Presented with a loop
  > of this form:
  > 
  >     loop begin
  >     goto label1
  > label2:
  >        ...
  >     loop cont
  > label1:
  >     if (cond) goto label2
  >     loop end
  >     
  > the unroller would delete the loop begin note, the loop cont note
  > and the last insn in the loop, in this case the if stmt.  This
  > left us with an unconditional branch around the loop causing no
  > iterations to be performed.
  > 
  > This patch tries to detect the above situation and delete the
  > initial branch.  This was bootstrapped and tested on i686-pc-linux-gnu.
  > Okay to install?
  > 
  > Catherine
  > 
  > 2000-09-01  Catherine Moore  <clm@redhat.com>
  > 
  >         * unroll.c (unroll_loop): Check for unconditional jumps
  >         to loop continuation.  Delete if n_iterations is 1.
  >         (ujump_to_loop_cont): New routine.
This is fine.


  > gcc/testsuite/ChangeLog:
  > 
  > 2000-09-01  Catherine Moore  <clm@redhat.com>
  > 
  > 	* gcc.c-torture/execute/unroll-1.c: New test.
So is this.

Please install both patches.

Thanks,
jeff


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