diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1708f7c..45e1369 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -7855,9 +7859,7 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank, if (!GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (dest))) { - tmp = null_pointer_node; - tmp = fold_build2_loc (input_location, MODIFY_EXPR, type, dest, tmp); - gfc_add_expr_to_block (&block, tmp); + gfc_add_modify (&block, dest, fold_convert (type, null_pointer_node)); null_data = gfc_finish_block (&block); gfc_init_block (&block); @@ -7869,9 +7871,7 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank, if (!no_malloc) { tmp = gfc_call_malloc (&block, type, size); - tmp = fold_build2_loc (input_location, MODIFY_EXPR, void_type_node, - dest, fold_convert (type, tmp)); - gfc_add_expr_to_block (&block, tmp); + gfc_add_modify (&block, dest, fold_convert (type, tmp)); } if (!no_memcpy) diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index ba71a21..2e6ef2a 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -5093,8 +5103,8 @@ generate_coarray_sym_init (gfc_symbol *sym) build_int_cst (integer_type_node, reg_type), token, gfc_build_addr_expr (pvoid_type_node, desc), null_pointer_node, /* stat. */ - null_pointer_node, /* errgmsg, errmsg_len. */ - build_int_cst (integer_type_node, 0)); + null_pointer_node, /* errgmsg. */ + integer_zero_node); /* errmsg_len. */ gfc_add_expr_to_block (&caf_init_block, tmp); gfc_add_modify (&caf_init_block, decl, fold_convert (TREE_TYPE (decl), gfc_conv_descriptor_data_get (desc)));