aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-11-17 14:02:56 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-11-17 14:02:56 +0100
commitee4b6b5202eb87d4e154d09d5257943d3b555fac (patch)
treec39ad245ed82ae96d6e48e1bc3e5bd50fabcf94e /gcc/fortran/trans-array.c
parent741aacafff79e60410d224b72bae6364f2c3c40c (diff)
downloadgcc-ee4b6b5202eb87d4e154d09d5257943d3b555fac.zip
gcc-ee4b6b5202eb87d4e154d09d5257943d3b555fac.tar.gz
gcc-ee4b6b5202eb87d4e154d09d5257943d3b555fac.tar.bz2
re PR fortran/55341 (address-sanitizer and Fortran)
PR fortran/55341 * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Convert last argument to memcpy to size_type_node type. * trans-stmt.c (gfc_conv_elemental_dependencies): Likewise. * trasn-array.c (duplicate_allocatable): Likewise. From-SVN: r193585
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 26f0523..fc628ca 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -7341,8 +7341,8 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank,
}
tmp = builtin_decl_explicit (BUILT_IN_MEMCPY);
- tmp = build_call_expr_loc (input_location, tmp, 3,
- dest, src, size);
+ tmp = build_call_expr_loc (input_location, tmp, 3, dest, src,
+ fold_convert (size_type_node, size));
}
else
{
@@ -7367,7 +7367,8 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank,
tmp = builtin_decl_explicit (BUILT_IN_MEMCPY);
tmp = build_call_expr_loc (input_location,
tmp, 3, gfc_conv_descriptor_data_get (dest),
- gfc_conv_descriptor_data_get (src), size);
+ gfc_conv_descriptor_data_get (src),
+ fold_convert (size_type_node, size));
}
gfc_add_expr_to_block (&block, tmp);