From patchwork Fri Apr 29 14:37:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 616843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qxGXJ2kLBz9t4b for ; Sat, 30 Apr 2016 00:38:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=fJB9nKo8; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=lcWEW7A0LRI4EBoyyXJCJ+X6KyVQfpbz2aVwmz3ZcHxP0S mdBayFcihlPxZ8vU/CpS82rjBcuyRxhzZKDuIWttVilj6cHo+dEL0qtUvehZx9Qw IqbIurv+iIaqmdB4v03ahSrvZrarGaHnDZGbOPlYb9Y33Fsuqqt1XpEBFx6zQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=1tqbCXJDbTPZJScdd4dqcR+V18c=; b=fJB9nKo8a2qwMpqUwNxL CW5zPjUekOMA76i/w4XO7QIMWP3FLu95c1SQdXMN4rmBTdtbNuUG9gNpz0Jje7aQ 0CCcPaf0CGpZ80uGxauWJaDbMmMPzgr2paHVCgrFOk3W0s8XnRQE4LHm0TWTFxgL De/a1nG+PjCM0kLuTs83JXo= Received: (qmail 91558 invoked by alias); 29 Apr 2016 14:38:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 91540 invoked by uid 89); 29 Apr 2016 14:38:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=SUCCESS, Hx-languages-length:2971, complains X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Apr 2016 14:37:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 399A23A for ; Fri, 29 Apr 2016 07:37:58 -0700 (PDT) Received: from [10.2.206.43] (e100706-lin.cambridge.arm.com [10.2.206.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 895823F25F for ; Fri, 29 Apr 2016 07:37:55 -0700 (PDT) Message-ID: <572371C1.2010407@foss.arm.com> Date: Fri, 29 Apr 2016 15:37:53 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH][ARM][gas] Fix warnings about uninitialised uses and unused const variables Hi all, I recently upgraded my host compiler to GCC 6.1.0 and while trying to build a cross toolchain for arm-none-eabi I've encountered some -Werror errors in tc-arm.c This patch fixes them. Some static const variables that are unused are marked with ATTRIBUTE_UNUSED. In parse_neon_el_struct_list GCC complains that firsttype.index may be used uninitialized in an inlined neon_alias_types_same call. This patch initialises the fields firsttype to prevent that. With this patch the gas build succeeds for me. Tested with make check-gas for arm-none-eabi. Ok to commit? Thanks, Kyrill 2016-04-29 Kyrylo Tkachov * config/tc-arm.c (fpu_arch_vfp_v1): Mark with ATTRIBUTE_UNUSED. (fpu_arch_vfp_v3): Likewise. (fpu_arch_neon_v1): Likewise. (arm_arch_full): Likewise. (parse_neon_el_struct_list): Initialize fields of firsttype. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 958434b3563cb49c3fb3cd04ffefc396916f2a49..64d87a371058f0a5b1d173fa4cb43ba8f86dee0d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -155,10 +155,10 @@ static const arm_feature_set *object_arch = NULL; /* Constants for known architecture features. */ static const arm_feature_set fpu_default = FPU_DEFAULT; -static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1; +static const arm_feature_set fpu_arch_vfp_v1 ATTRIBUTE_UNUSED = FPU_ARCH_VFP_V1; static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2; -static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3; -static const arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1; +static const arm_feature_set fpu_arch_vfp_v3 ATTRIBUTE_UNUSED = FPU_ARCH_VFP_V3; +static const arm_feature_set fpu_arch_neon_v1 ATTRIBUTE_UNUSED = FPU_ARCH_NEON_V1; static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA; static const arm_feature_set fpu_any_hard = FPU_ANY_HARD; static const arm_feature_set fpu_arch_maverick = FPU_ARCH_MAVERICK; @@ -221,7 +221,7 @@ static const arm_feature_set arm_ext_fp16 = ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST); static const arm_feature_set arm_arch_any = ARM_ANY; -static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1); +static const arm_feature_set arm_arch_full ATTRIBUTE_UNUSED = ARM_FEATURE (-1, -1, -1); static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2; static const arm_feature_set arm_arch_none = ARM_ARCH_NONE; static const arm_feature_set arm_arch_v6m_only = ARM_ARCH_V6M_ONLY; @@ -1988,6 +1988,10 @@ parse_neon_el_struct_list (char **str, unsigned *pbase, const char *const incr_error = _("register stride must be 1 or 2"); const char *const type_error = _("mismatched element/structure types in list"); struct neon_typed_alias firsttype; + firsttype.defined = 0; + firsttype.eltype.type = NT_invtype; + firsttype.eltype.size = -1; + firsttype.index = -1; if (skip_past_char (&ptr, '{') == SUCCESS) leading_brace = 1;