From 4409de247c778276c0445f3d9f8817562f152b78 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 19 May 2011 22:53:33 +0200 Subject: re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays]) 2011-06-19 Tobias Burnus PR fortran/18918 * trans-types.c (gfc_get_element_type): Handle scalar coarrays. (gfc_get_nodesc_array_type): Make a variant-type copy for scalar coarrays. * trans.c (gfc_build_array_ref): Return original type not * variant copy for scalar coarrays. * trans-array.c (gfc_conv_array_ref): Ditto. 2011-06-19 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_21.f90: New. From-SVN: r173920 --- gcc/fortran/trans.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/fortran/trans.c') diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 1d25cb0..fcbb850 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -316,6 +316,13 @@ gfc_build_array_ref (tree base, tree offset, tree decl) tree type = TREE_TYPE (base); tree tmp; + if (GFC_ARRAY_TYPE_P (type) && GFC_TYPE_ARRAY_RANK (type) == 0) + { + gcc_assert (GFC_TYPE_ARRAY_CORANK (type) > 0); + + return fold_convert (TREE_TYPE (type), base); + } + gcc_assert (TREE_CODE (type) == ARRAY_TYPE); type = TREE_TYPE (type); -- cgit v1.1