re PR rtl-optimization/5269 (loop unroller fails to pull the right number of copies out)

PR optimization/5269
        * unroll.c (precondition_loop_p): Make *increment be the correct
        sign when n_iterations known, to avoid confusing caller.

From-SVN: r48752
This commit is contained in:
Dale Johannesen 2002-01-10 21:00:43 +00:00 committed by Richard Henderson
parent adc9fe67ba
commit 04894c5a9e
2 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -1392,9 +1392,18 @@ precondition_loop_p (loop, initial_value, final_value, increment, mode)
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)