symbol.c (check_conflict): Add codimension conflict with pointer; fix cray-pointee...
authorTobias Burnus <burnus@net-b.de>
Tue, 15 Jul 2014 05:36:35 +0000 (07:36 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 15 Jul 2014 05:36:35 +0000 (07:36 +0200)
2014-06-15  Tobias Burnus  <burnus@net-b.de>

gcc/fortran/
        * symbol.c (check_conflict): Add codimension conflict with
        pointer; fix cray-pointee check.

gcc/testsuite/
        * gfortran.dg/coarray_34.f90: New.
        * gfortran.dg/coarray_6.f90: Update test case.

From-SVN: r212540

gcc/fortran/ChangeLog
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_34.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/coarray_6.f90

index 2c362916a5607d70b5c46f2b89ae1f5ece38e62c..c33936b36640c753adf73441c9cdf740818200b9 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-15  Tobias Burnus  <burnus@net-b.de>
+
+       * symbol.c (check_conflict): Add codimension conflict with
+       pointer; fix cray-pointee check.
+
+
 2014-06-14  Tobias Burnus  <burnus@net-b.de>
 
        * trans-intrinsic.c (conv_intrinsic_atomic_ref): Fix handling
index aee7510a463b0ab5048e81084738f5ef70ada827..2e04598557658457b675f6a2a7c7b032df653541 100644 (file)
@@ -458,6 +458,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   conf (pointer, target);
   conf (pointer, intrinsic);
   conf (pointer, elemental);
+  conf (pointer, codimension);
   conf (allocatable, elemental);
 
   conf (target, external);
@@ -534,8 +535,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   conf (cray_pointer, entry);
 
   conf (cray_pointee, allocatable);
-  conf (cray_pointer, contiguous);
-  conf (cray_pointer, codimension);
+  conf (cray_pointee, contiguous);
+  conf (cray_pointee, codimension);
   conf (cray_pointee, intent);
   conf (cray_pointee, optional);
   conf (cray_pointee, dummy);
index 0a7e5673a78df5c8e06f9fee0ea8b852159833e4..2f259639676a24c8ef650c43dba1ccb6408f80c0 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-15  Tobias Burnus  <burnus@net-b.de>
+
+       * gfortran.dg/coarray_34.f90: New.
+       * gfortran.dg/coarray_6.f90: Update test case.
+
 2014-07-14  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61779
diff --git a/gcc/testsuite/gfortran.dg/coarray_34.f90 b/gcc/testsuite/gfortran.dg/coarray_34.f90
new file mode 100644 (file)
index 0000000..f2bc910
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+use iso_fortran_env
+implicit none
+
+type t
+  integer, pointer :: caf2[:] ! { dg-error "must be allocatable with deferred shape" }
+end type t
+
+integer, pointer :: caf[*] ! { dg-error "POINTER attribute conflicts with CODIMENSION attribute" }
+
+type t2
+  type(lock_type), pointer :: lock_it ! { dg-error "Component lock_it at .1. of type LOCK_TYPE must have a codimension or be a subcomponent of a coarray, which is not possible as the component has the pointer attribute" }
+end type t2
+type(t2) :: caf3[*]
+
+type t3
+  type(lock_type) :: x
+end type t3
+
+type t4
+  type(t3), pointer :: y ! { dg-error "Pointer component y at .1. has a noncoarray subcomponent of type LOCK_TYPE, which must have a codimension or be a subcomponent of a coarray" }
+end type t4
+
+end
index f44ac01597a3dd5b167be153f481e7dbdea506e2..d30567ac212fac67e3298a347d0f464bbad0d256 100644 (file)
@@ -32,7 +32,7 @@ end module m
 
 subroutine bar()
   integer, parameter :: a[*] = 4 ! { dg-error "PARAMETER attribute conflicts with CODIMENSION" }
-  integer, pointer :: b[:] ! { dg-error "is not ALLOCATABLE, SAVE nor a dummy" }
+  integer :: b[*] ! { dg-error "is not ALLOCATABLE, SAVE nor a dummy" }
 end subroutine bar
 
 subroutine vol()