This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Use DECL_BY_REFERENCE for Fortran dummy arguments (PR fortran/24790)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org, Jan Kratochvil <jkratoch at redhat dot com>
- Date: Fri, 22 Aug 2008 12:28:40 -0400
- Subject: [PATCH] Use DECL_BY_REFERENCE for Fortran dummy arguments (PR fortran/24790)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch on top of the 2 DECL_BY_REFERENCE dwarf2out.c fixes I've sent
earlier today makes the dummy arguments appear in the debugger as having
their real types instead of being pointers or references to those types.
Ok for trunk?
2008-08-22 Jakub Jelinek <jakub@redhat.com>
PR fortran/24790
* trans-decl.c (create_function_arglist): Set DECL_BY_REFERENCE on
PARM_DECLs with pointer or reference type.
--- gcc/fortran/trans-decl.c.jj 2008-08-21 23:07:01.000000000 +0200
+++ gcc/fortran/trans-decl.c 2008-08-22 14:47:59.000000000 +0200
@@ -1644,6 +1644,10 @@ create_function_arglist (gfc_symbol * sy
DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
/* All implementation args are read-only. */
TREE_READONLY (parm) = 1;
+ if (POINTER_TYPE_P (type)
+ && (!f->sym->attr.proc_pointer
+ && f->sym->attr.flavor != FL_PROCEDURE))
+ DECL_BY_REFERENCE (parm) = 1;
gfc_finish_decl (parm);
Jakub