From e6242bc79e68c0eccb23912870dc3b30790b7bfc Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sat, 14 May 2011 12:34:44 +0200 Subject: [PATCH] re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays]) 2011-05-14 Tobias Burnus PR fortran/18918 * interface.c (compare_parameter): Skip diagnostic if actual argument is not an array; rank mismatch is diagnosted later. 2011-05-14 Tobias Burnus PR fortran/18918 * gfortran.de/coarray_20.f90: New. From-SVN: r173755 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/interface.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/coarray_20.f90 | 15 +++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/coarray_20.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e8daa475815..029884b8e37 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -14,6 +14,12 @@ (create_var): For rank > 0 functions with unknown shape, create an allocatable temporary. +2011-05-14 Tobias Burnus + + PR fortran/18918 + * interface.c (compare_parameter): Skip diagnostic if + actual argument is not an array; rank mismatch is diagnosted later. + 2011-05-14 Tobias Burnus * options.c (gfc_init_options, gfc_post_options): Enable diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 1f757247a99..732a0c59d01 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1618,6 +1618,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, /* F2008, 12.5.2.8. */ if (formal->attr.dimension && (formal->attr.contiguous || formal->as->type != AS_ASSUMED_SHAPE) + && gfc_expr_attr (actual).dimension && !gfc_is_simply_contiguous (actual, true)) { if (where) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6cbf8829f95..f014a807532 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-14 Tobias Burnus + + PR fortran/18918 + * gfortran.de/coarray_20.f90: New. + 2011-05-14 Thomas Koenig PR fortran/22572 diff --git a/gcc/testsuite/gfortran.dg/coarray_20.f90 b/gcc/testsuite/gfortran.dg/coarray_20.f90 new file mode 100644 index 00000000000..8005768fa80 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_20.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Before a bogus error (argument not simply contiguous) +! was printed instead of the rank mismatch +! +! PR fortran/18918 +! +integer :: A[*] +call bar(A) ! { dg-error "Rank mismatch in argument" } +contains + subroutine bar(x) + integer :: x(1)[*] + end subroutine bar +end -- 2.30.2