From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22724 invoked by alias); 2 Feb 2013 14:24:07 -0000 Received: (qmail 22716 invoked by uid 22791); 2 Feb 2013 14:24:06 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Feb 2013 14:24:02 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Sat, 02 Feb 2013 14:24:01 +0000 Received: from [10.1.69.67] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 2 Feb 2013 14:24:00 +0000 Message-ID: <510D2180.2050409@arm.com> Date: Sat, 02 Feb 2013 14:24:00 -0000 From: Richard Earnshaw User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: James Greenhalgh CC: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft Subject: Re: [PATCH 2/6] [AArch64-4.7] Fix warning - aarch64_add_constant mixed code and declarations. References: <1359740555-10179-1-git-send-email-james.greenhalgh@arm.com> <1359740555-10179-3-git-send-email-james.greenhalgh@arm.com> In-Reply-To: <1359740555-10179-3-git-send-email-james.greenhalgh@arm.com> X-MC-Unique: 113020214240100301 Content-Type: text/plain; charset=UTF-8; format=flowed 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: 2013-02/txt/msg00045.txt.bz2 On 01/02/13 17:42, James Greenhalgh wrote: > > Hi, > > In config/aarch64/aarch64.c::aarch64_add_constant `shift' was > declared after we started writing code. C90 doesn't like this, > so split the declaration and the assignment. > > This fixes the warning: > > config/aarch64/aarch64.c: In function =E2=80=98aarch64_add_constant=E2=80= =99: > config/aarch64/aarch64.c:2249:4: warning: ISO C90 forbids mixed declarati= ons and code [-pedantic] > > Regression tested on aarch64-none-elf with no regressions. > > OK for aarch64-4.7-branch? > > Thanks, > James > > --- > gcc/ > > 2013-02-01 James Greenhalgh > > * config/aarch64/aarch64.c > (aarch64_add_constant): Move declaration of 'shift' above code. > > > 0002-AArch64-4.7-Fix-warning-aarch64_add_constant-mixed-c.patch > > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index 59124eb..62d0a12 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -2307,8 +2307,9 @@ aarch64_add_constant (int regnum, int scratchreg, H= OST_WIDE_INT delta) > { > if (mdelta >=3D 4096) > { > + rtx shift; > emit_insn (gen_rtx_SET (Pmode, scratch_rtx, GEN_INT (mdelta / 4096))= ); Blank line between declarations and code. OK with that change. R.