https://gcc.gnu.org/g:d5af5657fa4173dd8d3155e44fe6a1e3914cde8f

commit r15-5322-gd5af5657fa4173dd8d3155e44fe6a1e3914cde8f
Author: Jan Hubicka <hubi...@ucw.cz>
Date:   Fri Nov 15 15:51:14 2024 +0100

    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:
---
 gcc/fortran/trans-expr.cc | 1 +
 1 file changed, 1 insertion(+)

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);

Reply via email to