From patchwork Wed Oct 16 16:46:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw (lists)" X-Patchwork-Id: 1178037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511143-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vM4DfBzr"; dkim-atps=neutral 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 46tdVj410wz9sP3 for ; Thu, 17 Oct 2019 03:46:49 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=BYMm6OrTBlOcmy7wq/1GLzaTOcZjgBME6Sw3eMiH9Q7QTgBeYW XTI4rYj5FbHDMr1eruHAyU6TWIY+Ril+1D7g02w45SLS333uJ58/+f6hzDPJnDp9 mfp+utgfcu2DnuurtLo8EQdYcvBQTd50rof3GRiT2t5DeHPO/TsqzjUFs= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=pTSoZQ4atp4jhFFUJIkrW6ECJbY=; b=vM4DfBzr8v1gQXeR+Mm8 /0bLeny7QhSdUVQQcHhkqgBjluuItBuplTgGDriUXx+5b7rE2yA9An3gPRu3f7r3 OE/uRW5em2Mz02KgDogyajX3AFQktDVIck0wVDRckR/Dbq23ySE5VpSjayiEmJYt /O9p5OFD75YLRE2IflcrtFU= Received: (qmail 2817 invoked by alias); 16 Oct 2019 16:46:40 -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 2806 invoked by uid 89); 16 Oct 2019 16:46:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:874, arm.c, armc, UD:arm.c X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Oct 2019 16:46:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 461D828; Wed, 16 Oct 2019 09:46:37 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AAA2F3F6C4; Wed, 16 Oct 2019 09:46:36 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" From: "Richard Earnshaw (lists)" Subject: [arm] fix bootstrap failure due to uninitialized warning Message-ID: Date: Wed, 16 Oct 2019 17:46:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 The Arm port is failing bootstrap because GCC is now warning about an unitialized array. The code is complex enough that I certainly can't be sure the compiler is wrong, so perhaps the best fix here is just to memset the entire array before use. * config/arm/arm.c (neon_valid_immediate): Clear bytes before use. Applied to trunk. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9f0975dc071..75a011029f1 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12243,7 +12252,7 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, unsigned int i, elsize = 0, idx = 0, n_elts; unsigned int innersize; - unsigned char bytes[16]; + unsigned char bytes[16] = {}; int immtype = -1, matches; unsigned int invmask = inverse ? 0xff : 0; bool vector = GET_CODE (op) == CONST_VECTOR;