Commit 8a5c4899 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])

2011-05-29  Tobias Burnus  <burnus@net-b.de>
            Richard Guenther  <rguenther@suse.de>

        PR fortran/18918
        * trans-types.c (gfc_get_nodesc_array_type): Don't mess with
        the type's TREE_TYPE.
        * trans-array.c (gfc_conv_array_ref): Use TYPE_MAIN_VARIANT.
        * trans.c (gfc_build_array_ref): Ditto.

2011-05-29  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        * gfortran.dg/coarray_23.f90: New.


Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r174410
parent 269e0e18
2011-05-29 Tobias Burnus <burnus@net-b.de>
Richard Guenther <rguenther@suse.de>
PR fortran/18918
* trans-types.c (gfc_get_nodesc_array_type): Don't mess with
the type's TREE_TYPE.
* trans-array.c (gfc_conv_array_ref): Use TYPE_MAIN_VARIANT.
* trans.c (gfc_build_array_ref): Ditto.
2011-05-27 Tobias Burnus <burnus@net-b.de> 2011-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 PR fortran/18918
......
...@@ -2628,7 +2628,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym, ...@@ -2628,7 +2628,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
se->expr = build_fold_indirect_ref_loc (input_location, se->expr); se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
/* Use the actual tree type and not the wrapped coarray. */ /* Use the actual tree type and not the wrapped coarray. */
se->expr = fold_convert (TREE_TYPE (TREE_TYPE (se->expr)), se->expr); se->expr = fold_convert (TYPE_MAIN_VARIANT (TREE_TYPE (se->expr)), se->expr);
return; return;
} }
......
...@@ -1423,10 +1423,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed, ...@@ -1423,10 +1423,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
if (as->rank) if (as->rank)
type = make_node (ARRAY_TYPE); type = make_node (ARRAY_TYPE);
else else
{ type = build_variant_type_copy (etype);
type = build_variant_type_copy (etype);
TREE_TYPE (type) = etype;
}
GFC_ARRAY_TYPE_P (type) = 1; GFC_ARRAY_TYPE_P (type) = 1;
TYPE_LANG_SPECIFIC (type) TYPE_LANG_SPECIFIC (type)
......
...@@ -320,7 +320,7 @@ gfc_build_array_ref (tree base, tree offset, tree decl) ...@@ -320,7 +320,7 @@ gfc_build_array_ref (tree base, tree offset, tree decl)
{ {
gcc_assert (GFC_TYPE_ARRAY_CORANK (type) > 0); gcc_assert (GFC_TYPE_ARRAY_CORANK (type) > 0);
return fold_convert (TREE_TYPE (type), base); return fold_convert (TYPE_MAIN_VARIANT (type), base);
} }
gcc_assert (TREE_CODE (type) == ARRAY_TYPE); gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
......
2011-05-29 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_23.f90: New.
2011-05-29 Richard Sandiford <rdsandiford@googlemail.com> 2011-05-29 Richard Sandiford <rdsandiford@googlemail.com>
From Ryan Mansfield From Ryan Mansfield
......
! { dg-do compile }
! { dg-options "-fcoarray=single" }
!
! PR fortran/18918
!
! The example was ICEing before as the tree-decl
! of the type was wrong.
!
subroutine test
complex, save :: z[*]
if (z /= cmplx (0.0, 0.0)) call abort()
end subroutine test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment