]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/55272 (ICE on passing coarray argument between files)
authorTobias Burnus <burnus@net-b.de>
Mon, 12 Nov 2012 11:03:42 +0000 (12:03 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 12 Nov 2012 11:03:42 +0000 (12:03 +0100)
2012-11-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55272
        * module.c (mio_array_spec): Correctly handle coarray
        scalars.

2012-11-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55272
        * gfortran.dg/coarray_29_1.f90: New.
        * gfortran.dg/coarray_29_2.f90: New.

From-SVN: r193429

gcc/fortran/ChangeLog
gcc/fortran/module.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_29_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/coarray_29_2.f90 [new file with mode: 0644]

index 00c46f15c17a5cf0a1f97b6c8ead911f3dd3ba1d..a90b51a1ac3bb01edbcf411121e2e93be1e8c057 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-12  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/55272
+       * module.c (mio_array_spec): Correctly handle coarray
+       scalars.
+
 2012-11-07  Tobias Schlüter  <tobi@gcc.gnu.org>
 
        PR fortran/51727
index 4cfcae4f3b9267d59677be8a01454684a9481409..89c45b7c04767a867df812cc06d8cdee6dee90a5 100644 (file)
@@ -2395,7 +2395,7 @@ mio_array_spec (gfc_array_spec **asp)
   if (iomode == IO_INPUT && as->corank)
     as->cotype = (as->type == AS_DEFERRED) ? AS_DEFERRED : AS_EXPLICIT;
 
-  if (as->rank > 0)
+  if (as->rank + as->corank > 0)
     for (i = 0; i < as->rank + as->corank; i++)
       {
        mio_expr (&as->lower[i]);
index 11dc4cf9b51d8126cb4613b072048357dc92d4a0..87023e796a393558fec9d3770b580cc9e831e7de 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-12  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/55272
+       * gfortran.dg/coarray_29_1.f90: New.
+       * gfortran.dg/coarray_29_2.f90: New.
+
 2012-11-12  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.dg/hoist-register-pressure-3.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/coarray_29_1.f90 b/gcc/testsuite/gfortran.dg/coarray_29_1.f90
new file mode 100644 (file)
index 0000000..2c49b1c
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+
+! To be used by coarray_29_2.f90
+! PR fortran/55272
+
+module co_sum_module
+  implicit none
+contains
+  subroutine co_sum(scalar)
+    integer scalar[*]
+  end subroutine
+end module
+
+! DO NOT CLEAN UP THE MODULE FILE - coarray_29_2.f90 does it.
+! { dg-final { keep-modules "" } }
diff --git a/gcc/testsuite/gfortran.dg/coarray_29_2.f90 b/gcc/testsuite/gfortran.dg/coarray_29_2.f90
new file mode 100644 (file)
index 0000000..9829626
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-compile }
+! { dg-options "-fcoarray=single" }
+
+! Requires that coarray_29.f90 has been compiled before
+! and that, thus, co_sum_module is available
+
+! PR fortran/55272
+!
+! Contributed by Damian Rouson
+
+program main
+  use co_sum_module
+  implicit none    
+  integer score[*] 
+  call co_sum(score)
+end program
+
+! { dg-final { cleanup-modules "co_sum_module" } }
This page took 0.088099 seconds and 5 git commands to generate.