From: Christian Ehrhardt Date: Mon, 25 Nov 2002 22:41:58 +0000 (+0000) Subject: re PR c/8639 (simple integer arithmetic expression broken) X-Git-Tag: releases/gcc-3.2.2~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42370c15bb5e665a4e28e960e4e12e49c3358a46;p=thirdparty%2Fgcc.git re PR c/8639 (simple integer arithmetic expression broken) PR c/8639 * fold-const.c (extract_muldiv): Don't propagate division unless both arguments are multiples of C. From-SVN: r59471 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c32a397933d8..cbbf7262d44a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-25 Christian Ehrhardt + + PR c/8639 + * fold-const.c (extract_muldiv): Don't propagate division unless + both arguments are multiples of C. + 2002-11-24  Eric Botcazou   PR optimization/8275 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 926581c2ab47..021faf58e7f6 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4617,10 +4617,10 @@ extract_muldiv (t, c, code, wide_type) t2 = extract_muldiv (op1, c, code, wide_type); if (t1 != 0 && t2 != 0 && (code == MULT_EXPR - /* If not multiplication, we can only do this if either operand - is divisible by c. */ - || multiple_of_p (ctype, op0, c) - || multiple_of_p (ctype, op1, c))) + /* If not multiplication, we can only do this if both operands + are divisible by c. */ + || (multiple_of_p (ctype, op0, c) + && multiple_of_p (ctype, op1, c)))) return fold (build (tcode, ctype, convert (ctype, t1), convert (ctype, t2)));