From: Tobias Schlüter Date: Fri, 24 Sep 2004 17:06:57 +0000 (+0200) Subject: re PR fortran/17615 (Internal compiler error using interface procedures) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0c07d7b821d9010b77358135290aeaa24c48c6c;p=gcc.git re PR fortran/17615 (Internal compiler error using interface procedures) 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index cd67054d195..46bb7fa0982 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 * trans-decl.c (build_entry_thunks): Finalize the function; do not lower diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 29550b715e6..fc5b41bf880 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6b4225351b6..2dcc996052e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-09-24 Tobias Schlueter + + PR fortran/17615 + * gfortran.dg/pr17615.f90: New test. + 2004-09-24 Andrew MacLeod PR tree-optimzation/17517 diff --git a/gcc/testsuite/gfortran.dg/pr17615.f90 b/gcc/testsuite/gfortran.dg/pr17615.f90 new file mode 100644 index 00000000000..13b90334a7b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr17615.f90 @@ -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