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]

[PATCH] Use DECL_BY_REFERENCE for Fortran dummy arguments (PR fortran/24790)


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


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