https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84615

--- Comment #16 from Janne Blomqvist <jb at gcc dot gnu.org> ---
The following patch regtests cleanly on x86_64-pc-linux-gnu, i686-pc-linux-gnu,
and successfully passes the #c5 testcase on i686 with -fdefault-real8, and the
#c8 testcase on i686 (I didn't test other testcases).

diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 54bda1d..bf19ac3 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -5974,8 +5974,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
          gfc_add_block_to_block (&se->post, &parmse.post);
          tmp = parmse.expr;
          tmp = fold_build2_loc (input_location, MAX_EXPR,
-                                TREE_TYPE (tmp), tmp,
-                                build_zero_cst (TREE_TYPE (tmp)));
+                                gfc_charlen_type_node,
+                                fold_convert (gfc_charlen_type_node, tmp),
+                                build_zero_cst (gfc_charlen_type_node));
          cl.backend_decl = tmp;
        }

Dominique, can you check whether it also fixes the other -fdefault-real-8 -m32
issues caused by r256284?

Reply via email to