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]

Patch fixing a typo.


I've made a mistake when prepared a big patch in Dec (this patch without #ifdef was successfully tested on m32c. #ifdef and #endif were added a bit lately and the final patch was bootstrapped and tested on x86/x86_64). Ian recently found this typo

http://gcc.gnu.org/ml/gcc/2009-04/msg00544.html

The typo was not a serious one. It could have resulted in worse code for most targets when -fira-algorithm=priority is used (it is not a default for all architectures except for m32c). Although it might have created problems for m32c (a weird architecture which uses priority coloring by default).

Here is the fix

2009-04-22 Vladimir Makarov <vmakarov@redhat.com>

* genpreds.c (write_enum_constraint_num): Output definition of
CONSTRAINT_NUM_DEFINED_P macro.
* ira.c (setup_cover_and_important_classes): Use
CONSTRAINT_NUM_DEFINED_P instead of CONSTRAINT__LIMIT in #ifdef.


The patch was successfully bootstrapped on x86_64. I hope it will also fix a m32c failure reported by DJ recently.

Is it ok to commit?

Index: genpreds.c
===================================================================
--- genpreds.c	(revision 146528)
+++ genpreds.c	(working copy)
@@ -954,6 +954,7 @@ write_enum_constraint_num (void)
 {
   struct constraint_data *c;
 
+  fputs ("#define CONSTRAINT_NUM_DEFINED_P 1\n", stdout);
   fputs ("enum constraint_num\n"
 	 "{\n"
 	 "  CONSTRAINT__UNKNOWN = 0", stdout);
Index: ira.c
===================================================================
--- ira.c	(revision 146528)
+++ ira.c	(working copy)
@@ -754,9 +754,9 @@ setup_cover_and_important_classes (void)
 	{
 	  if (i == NO_REGS)
 	    continue;
-#ifdef CONSTRAINT__LIMIT
+#ifdef CONSTRAINT_NUM_DEFINED_P
 	  for (j = 0; j < CONSTRAINT__LIMIT; j++)
-	    if ((int) regclass_for_constraint (j) == i)
+	    if ((int) regclass_for_constraint ((enum constraint_num) j) == i)
 	      break;
 	  if (j < CONSTRAINT__LIMIT)
 	    {

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