This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Overflow problem in loop
- To: egcs-patches at cygnus dot com
- Subject: Overflow problem in loop
- From: Andreas Schwab <schwab at issan dot informatik dot uni-dortmund dot de>
- Date: 15 Mar 1999 10:29:07 +0100
gcc.c-torture/execute/loop-2b.c triggers an overflow bug in loop. It
tries to replace (INT_MAX-1) by (INT_MAX-1) * 4 + reg, which is obviously
invalid.
1999-03-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* loop.c (maybe_eliminate_biv_1): Disable the remaining biv
elimination inside comparison.
--- egcs-2.93/gcc/loop.c.~2~ Mon Mar 1 22:23:17 1999
+++ egcs-2.93/gcc/loop.c Sun Mar 14 16:47:09 1999
@@ -8325,7 +8325,8 @@
{
/* First try to replace with any giv that has constant positive
mult_val and constant add_val. We might be able to support
- negative mult_val, but it seems complex to do it in general. */
+ negative mult_val, but it seems complex to do it in general.
+ ??? Disabled due to possible overflow. */
for (v = bl->giv; v; v = v->next_iv)
if (CONSTANT_P (v->mult_val) && INTVAL (v->mult_val) > 0
@@ -8335,7 +8336,8 @@
|| (GET_CODE (v->add_val) == REG
&& REGNO_POINTER_FLAG (REGNO (v->add_val))))
&& ! v->ignore && ! v->maybe_dead && v->always_computable
- && v->mode == mode)
+ && v->mode == mode
+ && 0)
{
if (! biv_elimination_giv_has_0_offset (bl->biv, v, insn))
continue;
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org