From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 838 invoked by alias); 25 Apr 2009 00:53:40 -0000 Received: (qmail 830 invoked by uid 22791); 25 Apr 2009 00:53:38 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.173) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 25 Apr 2009 00:53:29 +0000 Received: by wf-out-1314.google.com with SMTP id 25so1077051wfc.14 for ; Fri, 24 Apr 2009 17:53:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.33.19 with SMTP id l19mr858595wfj.30.1240620806843; Fri, 24 Apr 2009 17:53:26 -0700 (PDT) In-Reply-To: <6dc9ffc80904241736u1cc6ece8ide5df98386bc9056@mail.gmail.com> References: <49EF7C78.1080701@redhat.com> <6dc9ffc80904241736u1cc6ece8ide5df98386bc9056@mail.gmail.com> Date: Sat, 25 Apr 2009 01:21:00 -0000 Message-ID: <6dc9ffc80904241753g720fe78ag9359854f95cea430@mail.gmail.com> Subject: Re: Patch fixing a typo. From: "H.J. Lu" To: Vladimir Makarov Cc: gcc-patches , Ian Lance Taylor Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg01965.txt.bz2 On Fri, Apr 24, 2009 at 5:36 PM, H.J. Lu wrote: > On Wed, Apr 22, 2009 at 1:22 PM, Vladimir Makarov w= rote: >> I've made a mistake when prepared a big patch in Dec (this patch without >> #ifdef was successfully tested on m32c. =A0#ifdef and #endif were added = a bit >> lately and the final patch was bootstrapped and tested on x86/x86_64). = =A0Ian >> recently found this typo >> >> http://gcc.gnu.org/ml/gcc/2009-04/msg00544.html >> >> The typo was not a serious one. =A0It could have resulted in worse code = for >> most targets when -fira-algorithm=3Dpriority is used (it is not a defaul= t for >> all architectures except for m32c). =A0Although it might have created pr= oblems >> for m32c (a weird architecture which uses priority coloring by default). >> >> Here is the fix >> >> 2009-04-22 =A0Vladimir Makarov =A0 >> >> =A0 * genpreds.c (write_enum_constraint_num): Output definition of >> =A0 CONSTRAINT_NUM_DEFINED_P macro. >> =A0 * ira.c (setup_cover_and_important_classes): Use >> =A0 CONSTRAINT_NUM_DEFINED_P instead of CONSTRAINT__LIMIT in #ifdef. >> >> The patch was successfully bootstrapped on x86_64. =A0I hope it will als= o fix >> a m32c failure reported by DJ recently. >> >> Is it ok to commit? >> >> >> Index: genpreds.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- genpreds.c =A0(revision 146528) >> +++ genpreds.c =A0(working copy) >> @@ -954,6 +954,7 @@ write_enum_constraint_num (void) >> =A0{ >> =A0 struct constraint_data *c; >> >> + =A0fputs ("#define CONSTRAINT_NUM_DEFINED_P 1\n", stdout); >> =A0 fputs ("enum constraint_num\n" >> =A0 =A0 =A0 =A0 "{\n" >> =A0 =A0 =A0 =A0 " =A0CONSTRAINT__UNKNOWN =3D 0", stdout); >> Index: ira.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- ira.c =A0 =A0 =A0 (revision 146528) >> +++ ira.c =A0 =A0 =A0 (working copy) >> @@ -754,9 +754,9 @@ setup_cover_and_important_classes (void) >> =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0if (i =3D=3D NO_REGS) >> =A0 =A0 =A0 =A0 =A0 =A0continue; >> -#ifdef CONSTRAINT__LIMIT >> +#ifdef CONSTRAINT_NUM_DEFINED_P >> =A0 =A0 =A0 =A0 =A0for (j =3D 0; j < CONSTRAINT__LIMIT; j++) >> - =A0 =A0 =A0 =A0 =A0 if ((int) regclass_for_constraint (j) =3D=3D i) >> + =A0 =A0 =A0 =A0 =A0 if ((int) regclass_for_constraint ((enum constrain= t_num) j) =3D=3D >> i) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0 =A0 =A0if (j < CONSTRAINT__LIMIT) >> =A0 =A0 =A0 =A0 =A0 =A0{ >> > > It breaks gcc: > > cc1: warnings being treated as errors > ../../src-trunk/gcc/ira.c: In function 'setup_cover_and_important_classes= ': > ../../src-trunk/gcc/ira.c:763: error: enum conversion in assignment is > invalid in C++ > make[6]: *** [ira.o] Error 1 > I am checking it in as an obvious fix. H.J. Index: ira.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ira.c (revision 146749) +++ ira.c (working copy) @@ -760,7 +760,7 @@ setup_cover_and_important_classes (void) break; if (j < CONSTRAINT__LIMIT) { - classes[n++] =3D i; + classes[n++] =3D (enum reg_class) i; continue; } #endif