Commit bf65e4b1 by Tobias Burnus Committed by Tobias Burnus

2010-04-30 Tobias Burnus Mburnus@net-b.de>

        PR fortran/18918
        PR fortran/43931
        *  trans-types.c (gfc_get_array_descriptor_base): Fix index
        calculation for array descriptor types.

2010-04-30  Tobias Burnus  Mburnus@net-b.de>

        PR fortran/18918
        PR fortran/43931
        * gfortran.dg/coarray_13.f90: New test.

From-SVN: r158941
parent b6feb796
2010-04-30 Tobias Burnus Mburnus@net-b.de>
PR fortran/18918
PR fortran/43931
* trans-types.c (gfc_get_array_descriptor_base): Fix index
calculation for array descriptor types.
2010-04-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/43896
......
......@@ -1542,7 +1542,7 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
{
tree fat_type, fieldlist, decl, arraytype;
char name[16 + 2*GFC_RANK_DIGITS + 1 + 1];
int idx = 2 * (dimen - 1) + restricted;
int idx = 2 * (codimen + dimen - 1) + restricted;
gcc_assert (dimen >= 1 && codimen + dimen <= GFC_MAX_DIMENSIONS);
if (gfc_array_descriptor_base[idx])
......@@ -1551,8 +1551,7 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
/* Build the type node. */
fat_type = make_node (RECORD_TYPE);
sprintf (name, "array_descriptor" GFC_RANK_PRINTF_FORMAT "_"
GFC_RANK_PRINTF_FORMAT, dimen, codimen);
sprintf (name, "array_descriptor" GFC_RANK_PRINTF_FORMAT, dimen + codimen);
TYPE_NAME (fat_type) = get_identifier (name);
/* Add the data member as the first element of the descriptor. */
......@@ -1629,8 +1628,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
type_name = IDENTIFIER_POINTER (tmp);
else
type_name = "unknown";
sprintf (name, "array" GFC_RANK_PRINTF_FORMAT "_"
GFC_RANK_PRINTF_FORMAT "_%.*s", dimen, codimen,
sprintf (name, "array" GFC_RANK_PRINTF_FORMAT "_%.*s", dimen + codimen,
GFC_MAX_SYMBOL_LEN, type_name);
TYPE_NAME (fat_type) = get_identifier (name);
......
2010-04-30 Tobias Burnus Mburnus@net-b.de>
PR fortran/18918
PR fortran/43931
* gfortran.dg/coarray_13.f90: New test.
2010-04-30 Richard Guenther <rguenther@suse.de>
PR lto/43946
......
! { dg-do run }
! { dg-options "-fcoarray=single" }
!
! Coarray support -- allocatable array coarrays
! PR fortran/18918
! PR fortran/43931
!
program test
implicit none
call one()
contains
subroutine one()
integer, allocatable :: a(:)[:,:,:]
allocate(a(1)[-4:9,8,4:*])
end subroutine one
subroutine four(C)
integer, allocatable :: C(:)[:]
end subroutine four
end program 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