diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2018-09-21 11:25:54 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2018-09-21 11:25:54 +0000 |
commit | cbd29d0eaeb29c5549cfac6a2d5ea936be118429 (patch) | |
tree | fb81c8961fa5ae676d0c230ee285e18b1e4e310b /gcc/fortran/trans-expr.c | |
parent | b6895597cd59f77077ccdecdacfdd34bf77b5a07 (diff) | |
download | gcc-cbd29d0eaeb29c5549cfac6a2d5ea936be118429.zip gcc-cbd29d0eaeb29c5549cfac6a2d5ea936be118429.tar.gz gcc-cbd29d0eaeb29c5549cfac6a2d5ea936be118429.tar.bz2 |
Fix co-array allocation
The Fortran front-end has a bug in which it uses "int" values for "size_t"
parameters. I don't know why this isn't problem for all 64-bit architectures,
but GCN ends up with the data in the wrong argument register and/or stack slot,
and bad things happen.
This patch corrects the issue by setting the correct type.
2018-09-21 Andrew Stubbs <ams@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
gcc/fortran/
* trans-expr.c (gfc_trans_structure_assign): Ensure that the first
argument of a call to _gfortran_caf_register is of size_type_node.
* trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
index to a size_type_node type.
* trans-stmt.c (gfc_trans_event_post_wait): Likewise.
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
From-SVN: r264468
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 5a7cdb8..1f94dcf 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -7733,7 +7733,7 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr, bool init, bool coarray) suffices to recognize the data as array. */ if (rank < 0) rank = 1; - size = integer_zero_node; + size = build_zero_cst (size_type_node); desc = field; gfc_add_modify (&block, gfc_conv_descriptor_rank (desc), build_int_cst (signed_char_type_node, rank)); |