From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9692 invoked by alias); 23 Jan 2002 06:16:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9672 invoked by uid 71); 23 Jan 2002 06:16:03 -0000 Date: Tue, 22 Jan 2002 22:16:00 -0000 Message-ID: <20020123061603.9671.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Billinghurst, David \(CRTS\)" Subject: Re: fortran/3743: Reference to intrinsic `ISHFT' invalid Reply-To: "Billinghurst, David \(CRTS\)" X-SW-Source: 2002-01/txt/msg00817.txt.bz2 List-Id: The following reply was made to PR fortran/3743; it has been noted by GNATS. From: "Billinghurst, David (CRTS)" To: 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