This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] Fix PR17615: Wrong symbol used when genrating code


In PR 17615 we choked when generating code for a function called through a
generic interface. The problem was that in one place we didn't look at the
actual function that was meant to be called, but at the generic interface
instead. This of course had to break under some circumstances.

Bubblestrapped and tested. I will also add a testcase.

- Tobi

2004-09-24  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

	PR fortran/17615
	* trans-expr.c (gfc_trans_arrayfunc_assign): Look at resolved
	function to determine return type.

Index: trans-expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-expr.c,v
retrieving revision 1.28
diff -u -p -r1.28 trans-expr.c
--- trans-expr.c        17 Sep 2004 21:54:57 -0000      1.28
+++ trans-expr.c        24 Sep 2004 16:28:01 -0000
@@ -2007,7 +2007,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * e
   /* 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)
+             || (gfc_return_by_reference (expr2->value.function.esym)
              && expr2->symtree->n.sym->result->attr.dimension));

   ss = gfc_walk_expr (expr1);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]