[patch,fortran] PR 26201: __convert_*_* not recognized as intrinsic

Erik Edelmann erik.edelmann@iki.fi
Sat Feb 18 22:56:00 GMT 2006


:ADDPATCH fortran:

Here's a one-liner for PR 26201 (fixes the problem at least for
the testcase by Philippe Schaffnit on my (32 bit) system).  In my
patch for PR 25716
(http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01760.html), I
forgot to set sym->module of the newly created symbol for the
__convert_*_* functions to "(intrinsic)", thereby confusing
gfortran into believing that the __convert_*_* functions are
module functions rather than intrinsics.

Tested on Linux/x86_32, trunk and 4.1.  Somewhere fairly close to
obvious, but since these __convert_*_* bugs seems to be more
visible on 64 bit systems, I thought I would let bug reporter
Steve Kargl (or anyone else with a 64 bit system who happens to
care), test the patch on MUMPS before I commit.


        Erik


2006-02-19  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/26201
        * intrinsic.c (gfc_convert_type_warn): Call
        gfc_intrinsic_symbol() on the newly created symbol.


2006-02-19  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/26201
        * gfortran.dg/convert_1.f90: New.
-------------- next part --------------
Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c	(revision 111236)
+++ gcc/fortran/intrinsic.c	(working copy)
@@ -3428,6 +3428,7 @@ gfc_convert_type_warn (gfc_expr * expr, 
   new->symtree->n.sym->attr.elemental = 1;
   new->symtree->n.sym->attr.pure = 1;
   new->symtree->n.sym->attr.referenced = 1;
+  gfc_intrinsic_symbol(new->symtree->n.sym);
   gfc_commit_symbol (new->symtree->n.sym);
 
   *expr = *new;
-------------- next part --------------
! { dg-do compile }
! PR 26201: Check that the __convert_*_* functions are treated as intrinsics
! rather than module functions.
! Testcase contributed by Philippe Schaffnit and Fran????ois-Xavier Coudert.
MODULE MODULE_A
    REAL :: a = 0
END MODULE MODULE_A

MODULE MODULE_B
    REAL :: b = 0
END MODULE MODULE_B

USE MODULE_A
USE MODULE_B
a = 0
END


More information about the Gcc-patches mailing list