Patchwork [Fortran] Mark intrinsics called by the finalization wrapper as attr.artificial

login
register
mail settings
Submitter Tobias Burnus
Date May 27, 2013, 12:35 p.m.
Message ID <51A352FE.5060106@net-b.de>
Download mbox | patch
Permalink /patch/246591/
State New
Headers show

Comments

Tobias Burnus - May 27, 2013, 12:35 p.m.
Testing showed that the finalization wrapper caused errors of the kind:

Error: The intrinsic '_F.rank' declared INTRINSIC at (1) is not 
available in the current standard settings but new in TS 29113.  Use an 
appropriate -std=* option or enable -fall-intrinsics in order to use it.

That's fixed by the attached patch, which I have committed as obvious 
(Rev. 199355). (I have a test case, which depends on a not yet submitted 
patch. The artificial cannot interfere with user functions as GFC_PREFIX 
gives a symtree which cannot interfere with a normal Fortran name.)

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 199354)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@ 
+2013-05-27  Tobias Burnus  <burnus@net-b.de>
+
+	* expr.c (gfc_build_intrinsic_call): Make symbol as attr.artificial.
+	* intrinsic.c (gfc_is_intrinsic): Disable std check for those.
+
 2013-05-22  Tobias Burnus  <burnus@net-b.de>
 
 	* resolve.c (get_temp_from_expr): Change mangling to
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c	(Revision 199354)
+++ gcc/fortran/expr.c	(Arbeitskopie)
@@ -4657,6 +4657,7 @@  gfc_build_intrinsic_call (gfc_namespace *ns, gfc_i
   result->symtree->n.sym->intmod_sym_id = id;
   result->symtree->n.sym->attr.flavor = FL_PROCEDURE;
   result->symtree->n.sym->attr.intrinsic = 1;
+  result->symtree->n.sym->attr.artificial = 1;
 
   va_start (ap, numarg);
   atail = NULL;
Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c	(Revision 199354)
+++ gcc/fortran/intrinsic.c	(Arbeitskopie)
@@ -1046,7 +1046,8 @@  gfc_is_intrinsic (gfc_symbol* sym, int subroutine_
     return false;
 
   /* See if this intrinsic is allowed in the current standard.  */
-  if (!gfc_check_intrinsic_standard (isym, &symstd, false, loc))
+  if (!gfc_check_intrinsic_standard (isym, &symstd, false, loc)
+      && !sym->attr.artificial)
     {
       if (sym->attr.proc == PROC_UNKNOWN
 	  && gfc_option.warn_intrinsics_std)