This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 10 GCC regressions, 4 new, with your patch on 2001-05-03T12:50:02Z.
- To: gcc-regression at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Subject: Re: 10 GCC regressions, 4 new, with your patch on 2001-05-03T12:50:02Z.
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 03 May 2001 19:40:55 -0300
- Organization: GCC Team, Red Hat
- References: <200105031445.f43Ej5S13833@maat.cygnus.com>
On May 3, 2001, "GCC regression checker" <regress@maat.cygnus.com> wrote:
> powerpc-eabisim gcc.sum gcc.c-torture/execute/loop-4.c
> native gcc.sum gcc.c-torture/execute/loop-4.c
And here's the patch that fixes this one, yet to be tested too.
Assuming it bootstraps, ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* unroll.c (loop_iterations): Don't sign-extend abs_diff;
zero-extend it. Make abs_inc unsigned.
Index: gcc/unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
retrieving revision 1.127
diff -u -p -r1.127 unroll.c
--- gcc/unroll.c 2001/04/21 18:44:58 1.127
+++ gcc/unroll.c 2001/05/03 22:29:25
@@ -3451,7 +3451,8 @@ loop_iterations (loop)
rtx comparison, comparison_value;
rtx iteration_var, initial_value, increment, final_value;
enum rtx_code comparison_code;
- HOST_WIDE_INT abs_inc;
+ HOST_WIDE_INT inc;
+ unsigned HOST_WIDE_INT abs_inc;
unsigned HOST_WIDE_INT abs_diff;
int off_by_one;
int increment_dir;
@@ -3951,18 +3952,27 @@ loop_iterations (loop)
so correct for that. Note that abs_diff and n_iterations are
unsigned, because they can be as large as 2^n - 1. */
- abs_inc = INTVAL (increment);
- if (abs_inc > 0)
- abs_diff = INTVAL (final_value) - INTVAL (initial_value);
- else if (abs_inc < 0)
+ inc = INTVAL (increment);
+ if (inc > 0)
{
+ abs_diff = INTVAL (final_value) - INTVAL (initial_value);
+ abs_inc = inc;
+ }
+ else if (inc < 0)
+ {
abs_diff = INTVAL (initial_value) - INTVAL (final_value);
- abs_inc = -abs_inc;
+ abs_inc = -inc;
}
else
abort ();
- abs_diff = trunc_int_for_mode (abs_diff, GET_MODE (iteration_var));
+ /* Given that iteration_var is going to iterate over its own mode,
+ not HOST_WIDE_INT, disregard higher bits that might have come
+ into the picture due to sign extension of initial and final
+ values. */
+ abs_diff &= ((unsigned HOST_WIDE_INT)1
+ << (GET_MODE_BITSIZE (GET_MODE (iteration_var)) - 1)
+ << 1) - 1;
/* For NE tests, make sure that the iteration variable won't miss
the final value. If abs_diff mod abs_incr is not zero, then the
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me