OSDN Git Service

2006-12-21 Paul Thomas <pault@gcc.gnu.org>
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Dec 2006 13:59:57 +0000 (13:59 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Dec 2006 13:59:57 +0000 (13:59 +0000)
PR fortran/30202
* trans-array.c (gfc_conv_function_call): Use parmse.expr for
the nullifying of intent(out) arguments rather than the backend
declaration.

2006-12-21  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/30202
* gfortran.dg/alloc_comp_basics_3.f90: New test.

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

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

index dbc724a..c0dd40a 100644 (file)
@@ -1,3 +1,10 @@
+2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30202
+       * trans-array.c (gfc_conv_function_call): Use parmse.expr for
+       the nullifying of intent(out) arguments rather than the backend
+       declaration.
+
 2006-12-20  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/25392
index bd79834..6d46cd4 100644 (file)
@@ -2068,9 +2068,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
               if (fsym && fsym->attr.allocatable
                   && fsym->attr.intent == INTENT_OUT)
                 {
-                 tmp = e->symtree->n.sym->backend_decl;
-                 if (e->symtree->n.sym->attr.dummy)
-                    tmp = build_fold_indirect_ref (tmp);
+                  tmp = build_fold_indirect_ref (parmse.expr);
                   tmp = gfc_trans_dealloc_allocated (tmp);
                   gfc_add_expr_to_block (&se->pre, tmp);
                 }
index c5739de..fb6666e 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30202
+       * gfortran.dg/alloc_comp_basics_3.f90: New test.
+
 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/30262
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_basics_3.f90
new file mode 100644 (file)
index 0000000..9140cd2
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! Test the patch for PR30202 in which the INTENT(OUT)
+! caused an ICE.
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+!
+program class_scal_p
+  implicit none
+  type scal_p
+    real, allocatable :: b(:)
+  end type scal_p
+  type(scal_p) :: pd
+  call psb_geallv(pd%b)
+contains
+  subroutine psb_geallv(x)
+    real, allocatable, intent(out) :: x(:)
+  end subroutine psb_geallv
+end program class_scal_p