From patchwork Fri Feb 1 17:42:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [5/6, AArch64-4.7] Fix warning - Mixed code and declarations in aarch64_simd_const_bounds. Date: Fri, 01 Feb 2013 07:42:34 -0000 From: James Greenhalgh X-Patchwork-Id: 217548 Message-Id: <1359740555-10179-6-git-send-email-james.greenhalgh@arm.com> To: gcc-patches@gcc.gnu.org Cc: marcus.shawcroft@arm.com Hi, aarch64_simd_const_bounds declares `lane' after an assert. This patch moves the declaration above the assert. This patch fixes the warning: config/aarch64/aarch64.c: In function ‘aarch64_simd_const_bounds’: config/aarch64/aarch64.c:6412:3: warning: ISO C90 forbids mixed declarations 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_simd_const_bounds): Move declaration of 'lane' above code. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 434ccd7..a3c482b 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6406,8 +6406,9 @@ aarch64_simd_lane_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high) void aarch64_simd_const_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high) { + HOST_WIDE_INT lane; gcc_assert (GET_CODE (operand) == CONST_INT); - HOST_WIDE_INT lane = INTVAL (operand); + lane = INTVAL (operand); if (lane < low || lane >= high) error ("constant out of range");