From patchwork Fri Mar 18 08:46:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 8617081 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CB39C0553 for ; Fri, 18 Mar 2016 08:46:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FE76202F0 for ; Fri, 18 Mar 2016 08:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 454D8202E9 for ; Fri, 18 Mar 2016 08:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbcCRIqu (ORCPT ); Fri, 18 Mar 2016 04:46:50 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:56937 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbcCRIqs (ORCPT ); Fri, 18 Mar 2016 04:46:48 -0400 Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 6204824E140E; Fri, 18 Mar 2016 01:46:47 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 48F6C4E213; Fri, 18 Mar 2016 01:46:47 -0700 (PDT) Received: from mailhost.synopsys.com (unknown [10.13.184.66]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 0B8CE4E202; Fri, 18 Mar 2016 01:46:47 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id E96101A9; Fri, 18 Mar 2016 01:46:46 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id BD2F81A8; Fri, 18 Mar 2016 01:46:46 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 18 Mar 2016 01:46:46 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 18 Mar 2016 14:16:44 +0530 Received: from vineet-E7440.internal.synopsys.com (10.12.197.157) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 18 Mar 2016 14:16:43 +0530 From: Vineet Gupta To: CC: Vineet Gupta , Claudiu Zissulescu , Arnd Bergmann , "Michal Marek" , Geert Uytterhoeven , , Subject: [PATCH] ARC: build: Turn off -Wmaybe-uninitialized for ARC gcc 4.8 Date: Fri, 18 Mar 2016 14:16:23 +0530 Message-ID: <1458290783-31491-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.12.197.157] Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP linux-next has been reporting gazillion warnings for ARC build and I finally decided to take a bite: http://kisskb.ellerman.id.au/kisskb/buildresult/12638735/ Most of the them are due to -Wmaybe-uninitialized | ../kernel/sysctl.c: In function '__do_proc_doulongvec_minmax': | ../kernel/sysctl.c:1928:12: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized] | ret = tmp - *buf; | ^ | ../kernel/sysctl.c:2342:29: note: 'p' was declared here | char *kbuf = NULL, *p; | ^ | ... | ... Cursory look at code seemed fine and a definite gcc false positive in say kernel/sysctl.c Mystery was why only for ARC (and not with ARM linaro toolchain based off same gcc 4.8). Turns out that -O3 (default for ARC) triggers these and if I enable -O3 for ARM kernel build, I see the same splat. I doubt if gcc folks are going to fix warnings in gcc 4.8 (specially when this was the much advertised front page feature @ https://gcc.gnu.org/gcc-4.8/porting_to.html Better to to silent these for ARC, atleast for gcc 4.8 when we know that these warnings are likely benign. When we switch to later gcc, these will come back on and at that time we could fixing gcc and/or relevant kernel code. Cc: Claudiu Zissulescu Cc: Arnd Bergmann Cc: Michal Marek Cc: Geert Uytterhoeven Cc: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Vineet Gupta --- arch/arc/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arc/Makefile b/arch/arc/Makefile index fed12f39d8ce..aeb101e8e674 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -48,9 +48,14 @@ endif upto_gcc44 := $(call cc-ifversion, -le, 0404, y) atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y) atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y) +is_gcc48 := $(call cc-ifversion, -eq, 0408, y) cflags-$(atleast_gcc44) += -fsection-anchors +# gcc 4.8 spits out false positives for default -O3 +# disable these for 4.8 and revisit when we upgrade to newer ver +cflags-$(is_gcc48) += $(call cc-disable-warning,maybe-uninitialized,) + cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape