re PR fortran/17615 (Internal compiler error using interface procedures)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Fri, 24 Sep 2004 17:06:57 +0000 (19:06 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Fri, 24 Sep 2004 17:06:57 +0000 (19:06 +0200)
fortran/
PR fortran/17615
* trans-expr.c (gfc_trans_arrayfunc_assign): Look at resolved
function to determine return type.

testsuite/
PR fortran/17615
* gfortran.dg/pr17615.f90: New test.

From-SVN: r88061

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

index cd67054d195a4481ed5407e194559bbceb9aa0b9..46bb7fa09822382a534acb8c7cdac6966c156e94 100644 (file)
@@ -3,6 +3,13 @@
        * trans-types.c (gfc_return_by_reference): Remove superfluous
        assertion.
 
+       * intrinsic.h (gfc_resolve_getcwd): Update prototype.
+       * iresolve.c (gfc_resolve_getcwd): Add second argument to function.
+
+       PR fortran/17615
+       * trans-expr.c (gfc_trans_arrayfunc_assign): Look at resolved
+       function to determine return type.
+       
 2004-09-20  Jan Hubicka  <jh@suse.cz>
 
        * trans-decl.c (build_entry_thunks): Finalize the function; do not lower
index 29550b715e6af55744168ade2a9307d5dda054a9..fc5b41bf88058f1b19f3baa00370729b0c1fb580 100644 (file)
@@ -2007,8 +2007,8 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
   /* The frontend doesn't seem to bother filling in expr->symtree for intrinsic
      functions.  */
   gcc_assert (expr2->value.function.isym
-         || (gfc_return_by_reference (expr2->symtree->n.sym)
-             && expr2->symtree->n.sym->result->attr.dimension));
+             || (gfc_return_by_reference (expr2->value.function.esym)
+             && expr2->value.function.esym->result->attr.dimension));
 
   ss = gfc_walk_expr (expr1);
   gcc_assert (ss != gfc_ss_terminator);
index 6b4225351b6d64a29e65ea5a53dca38ddbd2c45d..2dcc996052e8d3aebe01e06f8002b1a9a9b27e66 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-24  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/17615
+       * gfortran.dg/pr17615.f90: New test.
+
 2004-09-24  Andrew MacLeod  <amacleod@redhat.com>
 
        PR tree-optimzation/17517
diff --git a/gcc/testsuite/gfortran.dg/pr17615.f90 b/gcc/testsuite/gfortran.dg/pr17615.f90
new file mode 100644 (file)
index 0000000..13b9033
--- /dev/null
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! we didn't look at the right symbol when genrating code. This broke
+! when array valued functions came into play.
+module module_vec3d
+  INTERFACE cross_product
+     MODULE PROCEDURE cross_product3_R4_R8
+  END INTERFACE
+CONTAINS
+  FUNCTION cross_product3_R4_R8 ()
+    real(8) :: cross_product3_r4_r8(3)
+    cross_product3_r4_r8 = 0
+  END FUNCTION cross_product3_R4_R8
+END MODULE module_vec3d
+
+PROGRAM TEST
+  use module_vec3d, only: cross_product
+  real(8) :: c(3)
+  c = cross_product()
+END PROGRAM TEST