X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Ffold-const.c;h=05e016add7365bced7de6c24baaae7c0dffd1dd8;hb=3bedcc89670bc73c0fb92eeaab266173b8babb73;hp=ad5039bba6eb541619b24f1219c4da1ab0b3c414;hpb=095ecc24ec1340eb0f3d1f06f5bf627001b51d32;p=gcc.git diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ad5039bba6e..05e016add73 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7948,7 +7948,9 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && (TREE_CODE (arg1) != REAL_CST || REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg1)))) || (INTEGRAL_TYPE_P (type) && flag_wrapv && !flag_trapv))) - return fold_build2 (PLUS_EXPR, type, arg0, negate_expr (arg1)); + return fold_build2 (PLUS_EXPR, type, + fold_convert (type, arg0), + fold_convert (type, negate_expr (arg1))); /* Try folding difference of addresses. */ { @@ -8467,7 +8469,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (exact_real_inverse (TYPE_MODE(TREE_TYPE(arg0)), &r)) { tem = build_real (type, r); - return fold_build2 (MULT_EXPR, type, arg0, tem); + return fold_build2 (MULT_EXPR, type, + fold_convert (type, arg0), tem); } } }