This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
genrecog: match_code "bug"?
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 17 Dec 2004 19:23:45 -0500
- Subject: genrecog: match_code "bug"?
In genrecog.c:compute_predicates_code, we use this code
for the MATCH_CODE case:
for (i = 0; i < NUM_RTX_CODE; i++)
if (!strncmp (code, GET_RTX_NAME (i), n)
&& GET_RTX_NAME (i)[n] == '\0')
{
codes[i] = Y;
break;
}
This code is case sensitive, yet produces no warnings when codes don't
match any known codes. This just burned me, because I used upper case
codes instead of lower case (hey, that's what the C sources have to
use, right?) and nothing matched, causing weird recog failures.
So, what to do?
1. Be case insensitive (we can use strncasecmp as it's in libiberty)
2. Warn when a code isn't matched.
3. Both.