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]
Other format: [Raw text]

PATCH: mis-preconditioning while unrolling (resubmission)


This fixes the problem described here:
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00122.html
A standalone test is given in PR optimization/5269.
Bootstrapped and tested on Darwin.

Index: unroll.c
===================================================================
RCS file: /cvs/Darwin/Commands/GNU/gcc/gcc/unroll.c,v
diff -u -d -b -w -c -3 -p -r1.10 unroll.c
*** unroll.c    2001/12/29 21:59:30     1.10
--- unroll.c    2002/01/02 23:45:21
*************** precondition_loop_p (loop, initial_value
*** 1392,1400 ****
--- 1392,1409 ----

     if (loop_info->n_iterations > 0)
       {
+       if ( INTVAL (loop_info->increment) > 0)
+       {
           *initial_value = const0_rtx;
           *increment = const1_rtx;
           *final_value = GEN_INT (loop_info->n_iterations);
+       }
+       else
+       {
+         *initial_value = GEN_INT (loop_info->n_iterations);
+         *increment = constm1_rtx;
+         *final_value = const0_rtx;
+       }
         *mode = word_mode;

         if (loop_dump_stream)


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