Commit bc81b5ce by Tobias Burnus Committed by Tobias Burnus

check.c (gfc_check_atomic): Properly check for coarrayness and for being coindexed.

2015-03-02  Tobias Burnus  <burnus@net-b.de>

        * check.c (gfc_check_atomic): Properly check for coarrayness
        and for being coindexed.

2015-03-02  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/coarray_atomic_6.f90: New.

From-SVN: r221122
parent af5513e9
2015-03-02 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Properly check for coarrayness
and for being coindexed.
2015-02-26 Martin Liska <mliska@suse.cz>
* resolve.c: Rename enum 'comparison' to 'compare_result' as
......
......@@ -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);
......
2015-03-02 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_6.f90: New.
2015-03-02 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65184
......
! { 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
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