fortran/3743: Reference to intrinsic `ISHFT' invalid

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Tue Jan 22 22:16:00 GMT 2002


The following reply was made to PR fortran/3743; it has been noted by GNATS.

From: "Billinghurst, David (CRTS)" <David.Billinghurst@riotinto.com>
To: <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: fortran/3743: Reference to intrinsic `ISHFT' invalid
Date: Wed, 23 Jan 2002 14:12:16 +0800

 -----Original Message-----
 From: David Edelsohn [mailto:dje@watson.ibm.com]
 Sent: Tuesday, 1 January 2002 7:09=20
 To: Billinghurst, David (CRTS); Toon Moene
 Cc: gcc-patches@gcc.gnu.org
 Subject: Re: Testcase for fortran/PR3743 "Reference to intrinsic `ISHFT'
 invalid".
 
 
 	I tracked down the underlying cause of the failure, but the cause
 is a fundamental design flaw in g77.
 
 	The symptom is intrin.c:ffeintrin_is_intrinsic() returns FALSE for
 some Fortran intrinsics.  Intrinsics are checked using bsearch() on the
 array of intrinsics in intrin.def.  The names are compared in the case
 determined by ffe_case_intrin() which is initialized to=20
 FFETARGET_defaultCASE_INTRIN in top.c, using the default value
 FFE_caseLOWER in target.h.
 
 	bsearch() requires a sorted array.  The failing testcase,
 BIT_SIZE, includes an underscore in the name.  Underscore is collated
 between uppercase letter and lowercase letters.  intrin.def is sorted =
 for
 uppercase names.
 
 DEFNAME ("BITEST",      "bitest",       "BITest",       genNONE, =
 specBITEST)     /* VXT */
 DEFNAME ("BIT_SIZE",    "bit_size",     "Bit_Size",     genNONE, =
 specBIT_SIZE)   /* F90 */
 DEFNAME ("BJTEST",      "bjtest",       "BJTest",       genNONE, =
 specBJTEST)     /* VXT */
 
 bsearch() looks through the array using a lowercase comparison and =
 expects
 to find bit_size collated before bitest, not BIT_SIZE collated after
 BITEST.  This problem may be the cause of other errors with respect to
 types of intrinsics.
 
 	Because of g77's options for cases, re-sorting the array or
 changing the default case would only cover up the problem.  libiberty
 provides strcasecmp, so maybe that should be used for the comparison
 instead of writing all case variants.
 
 David



More information about the Gcc-prs mailing list