From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14378 invoked by alias); 16 Jan 2011 13:45:01 -0000 Received: (qmail 14336 invoked by uid 22791); 16 Jan 2011 13:45:00 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Jan 2011 13:44:54 +0000 Received: from eggs.gnu.org ([140.186.70.92]:38459) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PeSuX-0007TO-0T for gcc-patches@gnu.org; Sun, 16 Jan 2011 08:44:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeSuZ-0006vJ-4f for gcc-patches@gnu.org; Sun, 16 Jan 2011 08:44:52 -0500 Received: from smtp191.iad.emailsrvr.com ([207.97.245.191]:33489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeSuZ-0006v2-24 for gcc-patches@gnu.org; Sun, 16 Jan 2011 08:44:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp49.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 9FD85190285 for ; Sun, 16 Jan 2011 08:44:49 -0500 (EST) Received: from dynamic14.wm-web.iad.mlsrvr.com (dynamic14.wm-web.iad1a.rsapps.net [192.168.2.221]) by smtp49.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 8E3851901B6 for ; Sun, 16 Jan 2011 08:44:49 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic14.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 76A5C2E9802E for ; Sun, 16 Jan 2011 08:44:49 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sun, 16 Jan 2011 14:44:49 +0100 (CET) Date: Sun, 16 Jan 2011 17:06:00 -0000 Subject: Fix for PR objc/47314 From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Type: plain Message-ID: <1295185489.484710811@192.168.4.58> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: 2011-01/txt/msg01080.txt.bz2 While rewriting some ObjC code for performance - a work that I'll submit fo= r GCC 4.7 - I spotted a typo in the existing 4.6 code, which causes GCC 4.6 to produce = an incorrect message when -Wselector is used to check for duplicate methods. The error = produced is warning: multiple selectors named =E2=80=98+method=E2=80=99 found while it should be warning: multiple selectors named =E2=80=98-method=E2=80=99 found It seems worthwhile to apply ("backport") this trivial one-liner bug fix to= GCC 4.6, so I'm submitting it as GCC 4.6 patch. Ok to commit ? Thanks Index: objc/objc-act.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 --- objc/objc-act.c (revision 168850) +++ objc/objc-act.c (working copy) @@ -12986,7 +12986,7 @@ for (hsh =3D cls_method_hash_list[slot]; hsh; hsh =3D hsh->next) check_duplicates (hsh, 0, 1); for (hsh =3D nst_method_hash_list[slot]; hsh; hsh =3D hsh->next) - check_duplicates (hsh, 0, 1); + check_duplicates (hsh, 0, 0); } } =20 Index: objc/ChangeLog =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 --- objc/ChangeLog (revision 168850) +++ objc/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-01-16 Nicola Pero + + PR objc/47314 + * objc-act.c (finish_objc): When calling check_duplicates to check + duplicated instance methods, set 'is_class' to 0, not 1. + 2011-01-14 Ben Elliston =20 PR 19162 Index: testsuite/ChangeLog =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 --- testsuite/ChangeLog (revision 168850) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-01-16 Nicola Pero + + PR objc/47314 + * objc.dg/selector-warn-1.m: New. + * obj-c++.dg/selector-warn-1.mm: New. + 2011-01-13 Jan Hubicka =20 PR tree-optimization/47276=20 Index: testsuite/objc.dg/selector-warn-1.m =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 --- testsuite/objc.dg/selector-warn-1.m (revision 0) +++ testsuite/objc.dg/selector-warn-1.m (revision 0) @@ -0,0 +1,16 @@ +/* Contributed by Nicola Pero , January 2= 011. */ +/* { dg-options "-Wselector" } */ +/* { dg-do compile } */ + +#include + +@interface RootObject +@end + +@interface MyObject : RootObject +- (void) method; /* { dg-message "found" } */ +@end + +@interface MyObject2 : RootObject +- (int) method; /* { dg-message "also found" } */ +@end /* { dg-warning "multiple selectors named .-method. found" } */ Index: testsuite/obj-c++.dg/selector-warn-1.mm =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 --- testsuite/obj-c++.dg/selector-warn-1.mm (revision 0) +++ testsuite/obj-c++.dg/selector-warn-1.mm (revision 0) @@ -0,0 +1,16 @@ +/* Contributed by Nicola Pero , January 2= 011. */ +/* { dg-options "-Wselector" } */ +/* { dg-do compile } */ + +#include + +@interface RootObject +@end + +@interface MyObject : RootObject +- (void) method; /* { dg-message "found" } */ +@end + +@interface MyObject2 : RootObject +- (int) method; /* { dg-message "also found" } */ +@end /* { dg-warning "multiple selectors named .-method. found" } */