From: Eric Botcazou Date: Thu, 11 Dec 2003 08:13:51 +0000 (+0100) Subject: backport: re PR rtl-optimization/13318 (ICE: floating point exception in the loop... X-Git-Tag: releases/gcc-3.3.3~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=822fdd4e8fe1bd456e188cdc8c0d0d67072ebf3c;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/13318 (ICE: floating point exception in the loop optimizer) Backport from mainline: 2003-12-07 Eric Botcazou PR optimization/13318 * loop.c (express_from): Protect integer division from overflow. From-SVN: r74532 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44955b318e69..8d6ca290eeaa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-12-11 Eric Botcazou + + Backport from mainline: + + 2003-12-07 Eric Botcazou + + PR optimization/13318 + * loop.c (express_from): Protect integer division from overflow. + 2003-12-11 Eric Botcazou Backport from mainline: diff --git a/gcc/loop.c b/gcc/loop.c index c0888fa6ce28..1c5409873bfe 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -7300,6 +7300,9 @@ express_from (g1, g2) && GET_CODE (g2->mult_val) == CONST_INT) { if (g1->mult_val == const0_rtx + || (g1->mult_val == constm1_rtx + && INTVAL (g2->mult_val) + == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)) || INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0) return NULL_RTX; mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5577bcd74896..eda5f3796b18 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2003-12-11 Eric Botcazou + + Backport from mainline: + + 2003-12-07 Wolfgang Bangerth + + * gcc.dg/overflow-1.c: New test. + 2003-12-11 Eric Botcazou Backport from mainline: