From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A6BAC43603 for ; Thu, 12 Dec 2019 06:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEE192465B for ; Thu, 12 Dec 2019 06:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576130522; bh=NO9m42cW/b/BbBvcGzyWKOv1cE/P07W3l66y4FInuOA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:List-ID: From; b=fWYr8FctAVvptwmlfVZlEr761D5BR+ep78/HKl0BDkFx0zbTOqrUopf/p+RQV0VSG V7UD8CpI6W1A2Jr5gK1EWk6bfS8mymWEBQmaJik6GVzqKzfLPFRKwNQQ2UluuzpaOY kazHFy1HuSIDTYK+TwgSFaouzcG/ipa0pIsMtP+U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727874AbfLLGCB (ORCPT ); Thu, 12 Dec 2019 01:02:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:48268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbfLLGCB (ORCPT ); Thu, 12 Dec 2019 01:02:01 -0500 Received: from paulmck-ThinkPad-P72.home (199-192-87-166.static.wiline.com [199.192.87.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A63F724656; Thu, 12 Dec 2019 06:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576130520; bh=NO9m42cW/b/BbBvcGzyWKOv1cE/P07W3l66y4FInuOA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=E0uFtmRXSBVlI1RcyyNz/6sv9u/zPh/p7GN5DY2KmyydUz9M1Zhl1mGzvopFHNOa/ 7IIrL6QcFn1mmU3QdtlGEeuDMs8U5NQDTunxc1W+VV6PpVv4GNfIScdm2J8isSYbJr fxupr4VqlnUVBNfAm1+nCVp5dh0sw1j8IGWAZc9g= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 506C435203A1; Wed, 11 Dec 2019 22:02:00 -0800 (PST) Date: Wed, 11 Dec 2019 22:02:00 -0800 From: "Paul E. McKenney" To: Stephen Rothwell Cc: Linux Next Mailing List , Linux Kernel Mailing List , Eric Dumazet Subject: Re: linux-next: build warning after merge of the rcu tree Message-ID: <20191212060200.GW2889@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191212160622.021517d3@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212160622.021517d3@canb.auug.org.au> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Thu, Dec 12, 2019 at 04:06:22PM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the rcu (I think) tree, today's linux-next build (x86_64 > allnoconfig) produced this warning: > > kernel/time/timer.c: In function 'schedule_timeout': > kernel/time/timer.c:969:20: warning: 'timer.expires' may be used uninitialized in this function [-Wmaybe-uninitialized] > 969 | long diff = timer->expires - expires; > | ~~~~~^~~~~~~~~ > > Introduced by (bisected to) commit > > c4127fce1d02 ("timer: Use hlist_unhashed_lockless() in timer_pending()") > > x86_64-linux-gnu-gcc (Debian 9.2.1-21) 9.2.1 20191130 Well, if the timer is pending, then ->expires has to have been initialized, but off where the compiler cannot see it, such as during a previous call to __mod_timer(). And the change may have made it harder for the compiler to see all of these relationships, but... I don't see this warning with gcc version 7.4.0. Just out of curiosity, what are you running, Stephen? Eric, any thoughts for properly educating the compiler on this one? Thanx, Paul