Correct comparison to the intrinsics table, was: Re: Plan for bug-fixing g77-3.1.
Toon Moene
moene@knmi.nl
Wed Jan 30 08:59:00 GMT 2002
I wrote:
> I'm now testing a patch that uses a specially written "compare upper
> case", that will convert the would-be-intrinsic-name to upper case when
> comparing it with the first of the three entries from the table.
> AFAICS, this should correct the problem.
OK, the attached patch gives the correct results on mips-sgi-irix6.5.
If no-one objects, I'll commit it later this evening (around 23:00 UTC).
--
Toon Moene, KNMI, PO Box 201, 3730 AE De Bilt, The Netherlands.
Tel. +31302206443, Fax +31302210407, e-mail moene@knmi.nl
URL: http://www.knmi.nl/hirlam
-------------- next part --------------
*** intrin.c.orig Fri Jan 25 22:15:28 2002
--- intrin.c Tue Jan 29 21:33:01 2002
*************** ffeintrin_check_any_ (ffebld arglist)
*** 1154,1158 ****
}
! /* Compare name to intrinsic's name. Uses strcmp on arguments' names.
The intrinsics table is sorted on the upper case entries; so first
compare irrespective of case on the `uc' entry. If it matches,
--- 1154,1174 ----
}
! /* Compare a forced-to-uppercase name with a known-upper-case name. */
!
! static int
! upcasecmp_ (const char *name, const char *ucname)
! {
! for ( ; *name != 0 && *ucname != 0; name++, ucname++)
! {
! int i = TOUPPER(*name) - *ucname;
!
! if (i != 0)
! return i;
! }
!
! return *name - *ucname;
! }
!
! /* Compare name to intrinsic's name.
The intrinsics table is sorted on the upper case entries; so first
compare irrespective of case on the `uc' entry. If it matches,
*************** ffeintrin_cmp_name_ (const void *name, c
*** 1167,1171 ****
int i;
! if ((i = strcasecmp (name, uc)) == 0)
{
switch (ffe_case_intrin ())
--- 1183,1187 ----
int i;
! if ((i = upcasecmp_ (name, uc)) == 0)
{
switch (ffe_case_intrin ())
More information about the Gcc
mailing list