From 42370c15bb5e665a4e28e960e4e12e49c3358a46 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Mon, 25 Nov 2002 22:41:58 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/fold-const.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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))); -- 2.47.2