This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]