From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24673 invoked by alias); 8 May 2015 18:39:57 -0000 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 Received: (qmail 24664 invoked by uid 89); 8 May 2015 18:39:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 May 2015 18:39:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id B3E4942; Fri, 8 May 2015 18:39:54 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-143.phx2.redhat.com [10.3.113.143]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t48IdrMt006011; Fri, 8 May 2015 14:39:54 -0400 Message-ID: <554D02F9.4030009@redhat.com> Date: Fri, 08 May 2015 18:39:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Thomas Schwinge , Richard Sandiford , gcc-patches@gcc.gnu.org Subject: Re: genrecog: Address -Wsign-compare diagnostics References: <87egn5yis1.fsf@e105548-lin.cambridge.arm.com> <87twvntoyn.fsf@kepler.schwinge.homeip.net> In-Reply-To: <87twvntoyn.fsf@kepler.schwinge.homeip.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00724.txt.bz2 On 05/08/2015 03:09 AM, Thomas Schwinge wrote: > Hi! > > On Mon, 27 Apr 2015 11:20:30 +0100, Richard Sandiford wrote: >> This patch [...] by replacing most of genrecog [...] > > OK to commit? > > Is it a bug that I'm seeing these warnings only in the stage 1 build with > the bootstrap GCC 4.6 compiler, but not anymore later on? (I have not > verified the C++ standard on the rules for »comparison between signed and > unsigned integer expressions«.) > > commit efef4f38205a13da90ca19b6eec1a6526756b433 > Author: Thomas Schwinge > Date: Fri May 8 10:55:19 2015 +0200 > > genrecog: Address -Wsign-compare diagnostics. > > g++-4.6 [...] [...]/gcc/genrecog.c > [...]/gcc/genrecog.c: In function 'state_size find_subroutines(routine_type, state*, vec&)': > [...]/gcc/genrecog.c:3338:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > [...]/gcc/genrecog.c:3347:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > [...]/gcc/genrecog.c:3359:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > [...]/gcc/genrecog.c:3365:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > > 3305 state_size size; > [...] > 3337 state_size to_size = find_subroutines (type, trans->to, procs); > 3338 if (d->next && to_size.depth > MAX_DEPTH) > [...] > 3347 if (to_size.num_statements < MIN_NUM_STATEMENTS) > [...] > 3359 if (size.num_statements > MAX_NUM_STATEMENTS) > [...] > 3365 && size.num_statements > MAX_NUM_STATEMENTS) > > 175 static const int MAX_DEPTH = 6; > [...] > 179 static const int MIN_NUM_STATEMENTS = 5; > [...] > 185 static const int MAX_NUM_STATEMENTS = 200; > [...] > 3258 struct state_size > 3259 { > [...] > 3261 unsigned int num_statements; > [...] > 3265 unsigned int depth; > 3266 }; > > gcc/ > * genrecog.c (MAX_DEPTH, MIN_NUM_STATEMENTS, MAX_NUM_STATEMENTS): > Change to unsigned int. > --- > gcc/genrecog.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) OK with a ChangeLog and the usual testing. Or you can verify the output of genrecog doesn't change before/after if you don't want to go through the full bootstrap. jeff