This is the mail archive of the gcc-bugs@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]

[Bug fortran/16939] Pointers not passed as subroutine arguments


------- 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


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