diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0801212a37c75515f662694ff83b66107c91818c..7eef7f9a1c043f3065bdb389c88caf9a9f3382a6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR fortran/33073 + * trans-intrinsic.c (build_fixbound_expr): Convert to result type + in all cases. + 2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/32594 diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index c8e16462aa8fbd2319ea70cf1e550131b7ef29f5..2e8b8a010ac49774e37d2ef4f85d069e47fd8eb8 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -314,10 +314,9 @@ build_fixbound_expr (stmtblock_t * pblock, tree arg, tree type, int up) static tree build_round_expr (tree arg, tree restype) { - tree tmp; tree argtype; tree fn; - bool longlong, convert; + bool longlong; int argprec, resprec; argtype = TREE_TYPE (arg); @@ -328,21 +327,9 @@ build_round_expr (tree arg, tree restype) (lround family) or long long intrinsic (llround). We might also need to convert the result afterwards. */ if (resprec <= LONG_TYPE_SIZE) - { - longlong = false; - if (resprec != LONG_TYPE_SIZE) - convert = true; - else - convert = false; - } + longlong = false; else if (resprec <= LONG_LONG_TYPE_SIZE) - { - longlong = true; - if (resprec != LONG_LONG_TYPE_SIZE) - convert = true; - else - convert = false; - } + longlong = true; else gcc_unreachable (); @@ -356,10 +343,7 @@ build_round_expr (tree arg, tree restype) else gcc_unreachable (); - tmp = build_call_expr (fn, 1, arg); - if (convert) - tmp = fold_convert (restype, tmp); - return tmp; + return fold_convert (restype, build_call_expr (fn, 1, arg)); }