This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16939] Pointers not passed as subroutine arguments
- From: "paulthomas2 at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2005 16:06:50 -0000
- Subject: [Bug fortran/16939] Pointers not passed as subroutine arguments
- References: <20040809142725.16939.paulthomas2@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From paulthomas2 at wanadoo dot fr 2005-05-09 16:06 -------
That's right Tobi
The patch that fixes this bug and regtests is:
Index: trans-expr.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/trans-expr.c,v
retrieving revision 1.42
diff -p -c -3 -r1.42 trans-expr.c
*** trans-expr.c 29 Apr 2005 15:31:33 -0000 1.42
--- trans-expr.c 9 May 2005 14:41:23 -0000
*************** gfc_conv_variable (gfc_se * se, gfc_expr
*** 360,365 ****
--- 360,372 ----
if (sym->attr.dummy
&& sym->ts.type != BT_CHARACTER
&& !sym->attr.dimension)
+ se->expr = gfc_build_indirect_ref (se->expr);
+
+ /*Dereference dummy args that are character pointers. */
+ if (sym->attr.dummy
+ && sym->attr.pointer
+ && sym->ts.type == BT_CHARACTER
+ && !sym->attr.dimension)
se->expr = gfc_build_indirect_ref (se->expr);
/* Dereference pointer variables. */
I will do an update, bootstrap and regtest tonight before submitting this to
the lists. It should be posted tonight.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16939