OSDN Git Service

2012-10-31 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Oct 2012 17:22:26 +0000 (17:22 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Oct 2012 17:22:26 +0000 (17:22 +0000)
        PR fortran/55134
        * trans-array.c (gfc_conv_array_parameter): Regard AS_DEFERRED
        * as
        array with descriptor.

2012-10-31  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55134
        * gfortran.dg/associate_11.f90: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193041 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 08cac6c..b503f3a 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-31  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/55134
+       * trans-array.c (gfc_conv_array_parameter): Regard AS_DEFERRED as
+       array with descriptor.
+
 2012-10-28  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/54958
index 3e684ee..26f0523 100644 (file)
@@ -7012,6 +7012,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, bool g77,
       if (!sym->attr.pointer
          && sym->as
          && sym->as->type != AS_ASSUMED_SHAPE 
+         && sym->as->type != AS_DEFERRED
          && sym->as->type != AS_ASSUMED_RANK 
          && !sym->attr.allocatable)
         {
index 10f98bc..7e223e8 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-31  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/55134
+       * gfortran.dg/associate_11.f90: New.
+
 2012-10-31  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/54955
diff --git a/gcc/testsuite/gfortran.dg/associate_11.f90 b/gcc/testsuite/gfortran.dg/associate_11.f90
new file mode 100644 (file)
index 0000000..182c80b
--- /dev/null
@@ -0,0 +1,25 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/55134
+!
+! Contributed by Valery Weber
+!
+program bug
+  implicit none
+  integer,dimension(1)::i
+  i(:)=1
+  associate(a =>i)
+    call foo(a)
+  end associate
+! write(*,*) i
+  if (i(1) /= 2) call abort
+contains
+  subroutine foo(v)
+    integer, dimension(*) :: v
+    v(1)=2
+  end subroutine foo
+end program bug
+
+! { dg-final { scan-tree-dump-times "foo ..integer.kind=4..0:. . restrict. a.data.;" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }