From: burnus Date: Mon, 2 Mar 2015 18:56:51 +0000 (+0000) Subject: 2015-03-02 Tobias Burnus X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ed3f3fd63e8b9f325ebfb2fe0d4626f19fcf349;p=thirdparty%2Fgcc.git 2015-03-02 Tobias Burnus * check.c (gfc_check_atomic): Properly check for coarrayness and for being coindexed. 2015-03-02 Tobias Burnus * gfortran.dg/coarray_atomic_6.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221122 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a693db89fa17..e61ad02e8977 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2015-03-02 Tobias Burnus + + * check.c (gfc_check_atomic): Properly check for coarrayness + and for being coindexed. + 2015-02-26 Martin Liska * resolve.c: Rename enum 'comparison' to 'compare_result' as diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 3be4fb11e243..cdb5ff1cba69 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -1022,7 +1022,7 @@ gfc_check_atomic (gfc_expr *atom, int atom_no, gfc_expr *value, int val_no, return false; } - if (!gfc_expr_attr (atom).codimension) + if (!gfc_is_coarray (atom) && !gfc_is_coindexed (atom)) { gfc_error ("ATOM argument at %L of the %s intrinsic function shall be a " "coarray or coindexed", &atom->where, gfc_current_intrinsic); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 940bb13ec612..9c4b587f6f0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-02 Tobias Burnus + + * gfortran.dg/coarray_atomic_6.f90: New. + 2015-03-02 Ilya Enkovich PR target/65184 diff --git a/gcc/testsuite/gfortran.dg/coarray_atomic_6.f90 b/gcc/testsuite/gfortran.dg/coarray_atomic_6.f90 new file mode 100644 index 000000000000..a0f19a84eff0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_atomic_6.f90 @@ -0,0 +1,36 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Contributed by Reinhold Bader +! +! +program def_and_ref +! compile only + use, intrinsic :: iso_fortran_env + implicit none + type :: e + integer(kind=atomic_int_kind) :: ia = 0 + logical(kind=atomic_logical_kind) :: la = .false. + end type + + type(e) :: a[*] + + integer :: ival = 0 + logical :: lval = .false. + + if (this_image() == 1) then + call atomic_define(a[num_images()]%ia, 4) + call atomic_define(a[num_images()]%la, .true.) + end if + if (this_image() == num_images()) then + do while (ival == 0 .or. .not. lval) + call atomic_ref(ival, a%ia) + call atomic_ref(lval, a%la) + end do + if (ival == 4 .and. lval) then + write(*,*) 'OK' + else + write(*,*) 'FAIL: ival,lval =', ival, lval + end if + end if +end program