From patchwork Wed Nov 23 10:06:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 83625 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2551239qge; Wed, 23 Nov 2016 02:06:53 -0800 (PST) X-Received: by 10.98.11.71 with SMTP id t68mr2061673pfi.136.1479895612977; Wed, 23 Nov 2016 02:06:52 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 3si4407026plu.63.2016.11.23.02.06.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 02:06:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-442336-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-442336-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-442336-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=sIxIOlghLiUMKo2Z3MaRoRfl8s7b1LjtrAKSKGYLw2mKtTwcu/ E/zTWfroC7XmeGZcoQm5yBM3IN/rA/iBFTFaehKE+wmntJ3IFmTGGviW3hk0xZEy 7d71prPSvcnSDQJsvjyR/7/kaZ+h73svRS+JDPqNXt4R0Xb8Cv8f9W4UI= 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:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=wkuqkyyuZQqs1a8MpxpnkBj9XBk=; b=lWqA1gZX5VVsMygwgJx2 PYveqW22ym4UJ/D0Frf74Gk81VG074Dd6sq+gfM9oKj6B8Qgs4vxzwuDMrIUL+af sKyqs0/3JTTPijKO4sSwjZVYYQl2dkiX8YsSelpTMRW0Cx9cfGhbpfOYjUxCbjZ4 eXTztVaiHw3bYnnjmzT78D4= Received: (qmail 75035 invoked by alias); 23 Nov 2016 10:06:38 -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 75020 invoked by uid 89); 23 Nov 2016 10:06:37 -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, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1742 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Nov 2016 10:06:27 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 58DA7AB03; Wed, 23 Nov 2016 10:06:24 +0000 (UTC) To: GCC Patches Cc: tbsaunde@tbsaunde.org From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] i386.c: Initialize function pointers to NULL to prevent, -Wmaybe-uninitialized Message-ID: Date: Wed, 23 Nov 2016 11:06:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 X-IsSubscribed: yes I see broken bootstrap due to: .././../gcc/config/i386/i386.c: In function ‘rtx_def* ix86_expand_builtin(tree, rtx, rtx, machine_mode, int)’: .././../gcc/config/i386/i386.c:38407:18: error: ‘fcn’ may be used uninitialized in this function [-Werror=maybe-uninitialized] emit_insn (fcn (target, accum, wide_reg, mem)); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thus I'm suggesting to initialize the variable (and 2 which are used in a very similar manner) to NULL. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin >From 0a8dfb71f0f9c6359428d908b88e99f3146f69e4 Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 22 Nov 2016 11:12:14 +0100 Subject: [PATCH] i386.c: Initialize function pointers to NULL to prevent -Wmaybe-uninitialized gcc/ChangeLog: 2016-11-22 Martin Liska * config/i386/i386.c: Initialize function pointers to NULL. --- gcc/config/i386/i386.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 25f0446..a373fcf 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -38218,9 +38218,9 @@ rdseed_step: && fcode <= IX86_BUILTIN__BDESC_ARGS2_LAST) { i = fcode - IX86_BUILTIN__BDESC_ARGS2_FIRST; - rtx (*fcn) (rtx, rtx, rtx, rtx); - rtx (*fcn_mask) (rtx, rtx, rtx, rtx, rtx); - rtx (*fcn_maskz) (rtx, rtx, rtx, rtx, rtx, rtx); + rtx (*fcn) (rtx, rtx, rtx, rtx) = NULL; + rtx (*fcn_mask) (rtx, rtx, rtx, rtx, rtx) = NULL; + rtx (*fcn_maskz) (rtx, rtx, rtx, rtx, rtx, rtx) = NULL; int masked = 1; machine_mode mode, wide_mode, nar_mode; -- 2.10.2