* unroll.c (precondition_loop_p): Make *increment be the correct
sign when n_iterations known, to avoid confusing caller.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48752
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-01-10 Dale Johannesen <dalej@apple.com>
+
+ PR optimization/5269
+ * unroll.c (precondition_loop_p): Make *increment be the correct
+ sign when n_iterations known, to avoid confusing caller.
+
2002-01-10 Kazu Hirata <kazu@hxi.com>
* doc/extend.texi (deprecated): Fix a typo.
if (loop_info->n_iterations > 0)
{
- *initial_value = const0_rtx;
- *increment = const1_rtx;
- *final_value = GEN_INT (loop_info->n_iterations);
+ 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)