public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch fixing a typo.
@ 2009-04-22 20:31 Vladimir Makarov
  2009-04-22 21:27 ` DJ Delorie
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vladimir Makarov @ 2009-04-22 20:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

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?


[-- Attachment #2: constraint-limit.patch --]
[-- Type: text/plain, Size: 896 bytes --]

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)
 	    {

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-25 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 20:31 Patch fixing a typo Vladimir Makarov
2009-04-22 21:27 ` DJ Delorie
2009-04-25  0:36 ` Ian Lance Taylor
2009-04-25  0:53 ` H.J. Lu
2009-04-25  1:21   ` H.J. Lu
2009-04-25 17:00     ` Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).