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, Fortran] PR 41766: [OOP] SELECT TYPE selector as actual argument with INTENT(INOUT)


Hi all,

the attached patch fixes another problem with SELECT TYPE and is
pretty obvious. The problem is that the temporaries which are inserted
for the TYPE IS cases miss the right flavor. The patch simply sets the
flavor to FL_VARIABLE. Moreover it uses the canonical functions for
setting attributes.

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2009-10-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41766
	* match.c (select_type_set_tmp): Set flavor for temporary.

2009-10-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41766
	* gfortran.dg/select_type_7.f03: New test case.
Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c	(Revision 153009)
+++ gcc/fortran/match.c	(Arbeitskopie)
@@ -4047,9 +4047,10 @@ select_type_set_tmp (gfc_typespec *ts)
 
   sprintf (name, "tmp$%s", ts->u.derived->name);
   gfc_get_sym_tree (name, gfc_current_ns, &tmp, false);
-  tmp->n.sym->ts = *ts;
-  tmp->n.sym->attr.referenced = 1;
-  tmp->n.sym->attr.pointer = 1;
+  gfc_add_type (tmp->n.sym, ts, NULL);
+  gfc_set_sym_referenced (tmp->n.sym);
+  gfc_add_pointer (&tmp->n.sym->attr, NULL);
+  gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);
 
   select_type_stack->tmp = tmp;
 }

Attachment: select_type_7.f03
Description: Binary data


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