[patch, fortran] PR20373 - intrinsic symbols can be given the wrong type (take 3)

Daniel Franke franke.daniel@gmail.com
Thu Jun 21 18:24:00 GMT 2007


On Wednesday 20 June 2007 22:52:32 Daniel Franke wrote:
> gcc/fortran:
> 2007-06-20  Daniel Franke  <franke.daniel@gmail.com>
>
>        PR fortran/20373
>        * intrinsic.c (add_functions): Additional function types.
+        (gfc_convert_type_warn): Remove intrinsic status of
+	 __convert_%s%d_%s%d functions.
>        * resolve.c (resolve_symbol): Warn if intrinsic functions are
>        explicitely typed.
>
> gcc/testsuite:
> 2007-06-20  Daniel Franke  <franke.daniel@gmail.com>
>
>        PR fortran/20373
>        * gfortran.dg/intrinsic.f90: New test.


Yet another update of this patch:

__convert_* functions are internally used and generated to implicitely convert 
between types where possible. The symbols of these functions have 
the "intrinsic" bit set, which results in something unintended:

logical, parameter :: maybe = -1
                               1
Warning: Type specified for intrinsic function '__convert_i4_l4' at (1) is 
ignored

Applying the change below avoids the warning (gfc_convert_type_warn):

Index: intrinsic.c
===================================================================
--- intrinsic.c (revision 125720)
+++ intrinsic.c (working copy)
@@ -3562,7 +3562,6 @@
   new->symtree->n.sym->ts = *ts;
   new->symtree->n.sym->attr.flavor = FL_PROCEDURE;
   new->symtree->n.sym->attr.function = 1;
-  new->symtree->n.sym->attr.intrinsic = 1;
   new->symtree->n.sym->attr.elemental = 1;
   new->symtree->n.sym->attr.pure = 1;
   new->symtree->n.sym->attr.referenced = 1;

Is there any explicit reason why these conversion functions have to have the 
intrinsic bit set? There are no apparent problems during regression testing?!

Thanks
	Daniel



More information about the Fortran mailing list