]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/8639 (simple integer arithmetic expression broken)
authorChristian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
Mon, 25 Nov 2002 22:41:58 +0000 (22:41 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 25 Nov 2002 22:41:58 +0000 (14:41 -0800)
        PR c/8639
        * fold-const.c (extract_muldiv): Don't propagate division unless
        both arguments are multiples of C.

From-SVN: r59471

gcc/ChangeLog
gcc/fold-const.c

index c32a397933d8d9e017b96088e52339440845a70f..cbbf7262d44a6a0c17c2f812ffb765474041396c 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-25  Christian Ehrhardt  <ehrhardt@mathematik.uni-ulm.de>
+
+       PR c/8639
+       * fold-const.c (extract_muldiv): Don't propagate division unless
+       both arguments are multiples of C.
+
 2002-11-24  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/8275
index 926581c2ab470eb82b706704e66c55981e5bfbb9..021faf58e7f6dd9d838bd2dd63e2a2e3c627b3ab 100644 (file)
@@ -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)));