Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943450AbcJSP7K (ORCPT ); Wed, 19 Oct 2016 11:59:10 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:37770 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941358AbcJSP7H (ORCPT ); Wed, 19 Oct 2016 11:59:07 -0400 Date: Wed, 19 Oct 2016 16:58:52 +0100 From: Russell King - ARM Linux To: Will Deacon Cc: Ard Biesheuvel , Peter Zijlstra , Stephen Boyd , "linux-kernel@vger.kernel.org" , james.greenhalgh@arm.com, Gregory CLEMENT , Linus Torvalds , Ingo Molnar , "linux-arm-kernel@lists.infradead.org" Subject: Re: Build failure with v4.9-rc1 and GCC trunk -- compiler weirdness Message-ID: <20161019155852.GS1041@n2100.armlinux.org.uk> References: <20161017183806.GG5601@arm.com> <20161019133500.GQ9193@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161019133500.GQ9193@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1075 Lines: 25 On Wed, Oct 19, 2016 at 02:35:00PM +0100, Will Deacon wrote: > Hi Ard, > > On Mon, Oct 17, 2016 at 08:43:19PM +0100, Ard Biesheuvel wrote: > > If order_base_2() is not defined for input 0, it should BUG() in that > > case, and the associated __builtin_unreachable() should prevent the > > special version from being emitted. If order_base_2() is defined for input > > 0, it should not invoke ilog2() with that argument, and the problem should > > go away as well. > > I don't necessarily think it should BUG() if it's not defined for input > 0; In any case, Linus will have a rant about that: Linus has already been concerned about the abuse of BUG(). BUG() should not be used as an assert() replacement, but should be used where we have absolutely no other option than to crash the kernel, because (eg) continuing would result in the users' data being corrupted. So no, BUG() is not the answer here. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.