trans-decl.c (gfc_trans_deferred_vars): Fix handling of explicit-size arrays with...
authorTobias Burnus <burnus@net-b.de>
Mon, 23 Jun 2014 17:09:08 +0000 (19:09 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 23 Jun 2014 17:09:08 +0000 (19:09 +0200)
gcc/fortran/
2014-06-23  Tobias Burnus  <burnus@net-b.de>

        * trans-decl.c (gfc_trans_deferred_vars): Fix handling of
        explicit-size arrays with -fcoarray=lib.

gcc/testsuite/
2014-06-23  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/coarray_32.f90: New.

From-SVN: r211907

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_32.f90 [new file with mode: 0644]

index 8a9316e6a964b67617532528d8c564e40bd18b3a..05df7c1dfc040dfdf351352cfcfaacb20599ea6e 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-23  Tobias Burnus  <burnus@net-b.de>
+
+       * trans-decl.c (gfc_trans_deferred_vars): Fix handling of
+       explicit-size arrays with -fcoarray=lib.
+
 2014-06-20  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/33363
index f1a18c3cfd26fa819c82fc5f147d491de6019ce2..291dd1f3a8325a9db521bd3f5fe0d2a9c610e4a7 100644 (file)
@@ -3870,7 +3870,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
                                        NULL_TREE);
                  continue;
                }
-             else if (gfc_option.coarray != GFC_FCOARRAY_LIB)
+             else
                {
                  gfc_save_backend_locus (&loc);
                  gfc_set_backend_locus (&sym->declared_at);
index e8eab59ea82d6bca1ba07f4571fd6393cde7f07c..7cdbc918c753dae93936ab321de69ba07a59a249 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-23  Tobias Burnus  <burnus@net-b.de>
+
+       * gfortran.dg/coarray_32.f90: New.
+
 2014-06-23  Paolo Carlini  <paolo.carlini@oracle.com>
 
        DR 577
diff --git a/gcc/testsuite/gfortran.dg/coarray_32.f90 b/gcc/testsuite/gfortran.dg/coarray_32.f90
new file mode 100644 (file)
index 0000000..8e6dc54
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original -fcoarray=lib" }
+!
+  real, allocatable :: values(:)[:]
+  allocate(values(1024)[*])
+  call  laplacian(values) 
+contains
+  subroutine laplacian(rhs) 
+    real, allocatable :: rhs(:)[:]
+    real :: local_laplacian(size(rhs))
+    local_laplacian=0.
+  end subroutine
+end 
+
+! { dg-final { scan-tree-dump-times "ubound.. = " 1 "original" } }
+! { dg-final { scan-tree-dump-times "size.. = " 2 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
+