This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Spaces in define_bypass lists
- From: Richard Sandiford <richard at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zackw at panix dot com
- Date: Tue, 24 Jan 2006 09:26:30 +0000
- Subject: Spaces in define_bypass lists
This patch fixes a genattrtab segfault on MIPS targets. The problem is
that genautomata allows spaces after commas in define_bypasses, but the
new genattrtab code doesn't. If a define_bypass list contains spaces,
process_bypasses fails to match it against any reservation name, and the
loop in make_automaton_attrs doesn't initialise every element of the
*bypass_p COND.
The patch below fixes the segfault on mips-elf. Is it OK?
It's teetering on the obvious really, but others might want
a different style of fix (such as a more centralised one).
Richard
* genattrtab.c (gen_bypass): Allow bypasses to contain whitespace.
Index: genattrtab.c
===================================================================
--- genattrtab.c (revision 110162)
+++ genattrtab.c (working copy)
@@ -4408,7 +4408,10 @@ gen_bypass (rtx def)
if (*p == ',')
{
gen_bypass_1 (base, p - base);
- base = p + 1;
+ do
+ p++;
+ while (ISSPACE (*p));
+ base = p;
}
gen_bypass_1 (base, p - base);
}