From: Richard Kenner Date: Wed, 2 Feb 1994 20:14:18 +0000 (-0500) Subject: (const_binop, COMPLEX_TYPE, case RDIV_EXPR): If complex integer, use X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58633be8f39bef7d2ee7f85f62e72b24c5885e4c;p=gcc.git (const_binop, COMPLEX_TYPE, case RDIV_EXPR): If complex integer, use TRUNC_DIV_EXPR for inner division. From-SVN: r6468 --- diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 6f6027d67a0..600bbfa728e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1433,18 +1433,26 @@ const_binop (code, arg1, arg2, notrunc) const_binop (MULT_EXPR, r2, r2, notrunc), const_binop (MULT_EXPR, i2, i2, notrunc), notrunc); - t = build_complex (const_binop (RDIV_EXPR, - const_binop (PLUS_EXPR, - const_binop (MULT_EXPR, r1, r2, notrunc), - const_binop (MULT_EXPR, i1, i2, notrunc), - notrunc), - magsquared, notrunc), - const_binop (RDIV_EXPR, - const_binop (MINUS_EXPR, - const_binop (MULT_EXPR, i1, r2, notrunc), - const_binop (MULT_EXPR, r1, i2, notrunc), - notrunc), - magsquared, notrunc)); + + t = build_complex + (const_binop (INTEGRAL_TYPE_P (TREE_TYPE (r1)) + ? TRUNC_DIV_EXPR : RDIV_EXPR, + const_binop (PLUS_EXPR, + const_binop (MULT_EXPR, r1, r2, + notrunc), + const_binop (MULT_EXPR, i1, i2, + notrunc), + notrunc), + magsquared, notrunc), + const_binop (INTEGRAL_TYPE_P (TREE_TYPE (r1)) + ? TRUNC_DIV_EXPR : RDIV_EXPR, + const_binop (MINUS_EXPR, + const_binop (MULT_EXPR, i1, r2, + notrunc), + const_binop (MULT_EXPR, r1, i2, + notrunc), + notrunc), + magsquared, notrunc)); } break;