diff options
author | Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de> | 2002-11-25 19:04:57 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-11-25 11:04:57 -0800 |
commit | b77f37445e014f2423fc2359b426384adec4b89c (patch) | |
tree | 4e94d5151ec5acc085330dd79d49753135c2b16a /gcc/fold-const.c | |
parent | f815521c75452a0fa9e36f0b5980a5b959f5e4c3 (diff) | |
download | gcc-b77f37445e014f2423fc2359b426384adec4b89c.zip gcc-b77f37445e014f2423fc2359b426384adec4b89c.tar.gz gcc-b77f37445e014f2423fc2359b426384adec4b89c.tar.bz2 |
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.
* gcc.c-torture/execute/20021119-1.c: New.
From-SVN: r59466
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c4095e4..a7556f4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4178,10 +4178,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))); |