diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 939b2676fd6..bccdcaebbbd 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,8 @@ +2002-01-26 Toon Moene + + * intrin.c (ffeintrin_cmp_name_): Correct comparison + for intrinsics in intrinsic table (intrin.def). + 2002-01-22 Zack Weinberg * bad.c: Include intl.h. diff --git a/gcc/f/intrin.c b/gcc/f/intrin.c index 99d849b7271..9759ab70a36 100644 --- a/gcc/f/intrin.c +++ b/gcc/f/intrin.c @@ -1153,7 +1153,10 @@ ffeintrin_check_any_ (ffebld arglist) return FALSE; } -/* Compare name to intrinsic's name. Uses strcmp on arguments' names. */ +/* 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, + compare according to the setting of intrinsics case comparison mode. */ static int ffeintrin_cmp_name_ (const void *name, const void *intrinsic) @@ -1161,8 +1164,22 @@ ffeintrin_cmp_name_ (const void *name, const void *intrinsic) const char *const uc = ((const struct _ffeintrin_name_ *) intrinsic)->name_uc; const char *const lc = ((const struct _ffeintrin_name_ *) intrinsic)->name_lc; const char *const ic = ((const struct _ffeintrin_name_ *) intrinsic)->name_ic; + int i; - return ffesrc_strcmp_2c (ffe_case_intrin (), name, uc, lc, ic); + if ((i = strcasecmp (name, uc)) == 0) + { + switch (ffe_case_intrin ()) + { + case FFE_caseLOWER: + return strcmp(name, lc); + case FFE_caseINITCAP: + return strcmp(name, ic); + default: + return 0; + } + } + + return i; } /* Return basic type of intrinsic implementation, based on its