From: Jan Hubicka Date: Fri, 15 Nov 2024 14:51:14 +0000 (+0100) Subject: Fix type of malloc parameter in trans-expr.cc X-Git-Tag: basepoints/gcc-16~4231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5af5657fa4173dd8d3155e44fe6a1e3914cde8f;p=thirdparty%2Fgcc.git Fix type of malloc parameter in trans-expr.cc gcc/fortran/ChangeLog: * trans-expr.cc (gfc_trans_subcomponent_assign): Fix type of malloc parameter. --- diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index f004af713344..a3c1dc0b7af4 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -9740,6 +9740,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_init_se (&se, NULL); gfc_conv_expr (&se, expr); size = size_of_string_in_bytes (cm->ts.kind, se.string_length); + size = fold_convert (size_type_node, size); tmp = build_call_expr_loc (input_location, builtin_decl_explicit (BUILT_IN_MALLOC), 1, size);