From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbdBYLKa (ORCPT ); Sat, 25 Feb 2017 06:10:30 -0500 Received: from ud10.udmedia.de ([194.117.254.50]:59338 "EHLO mail.ud10.udmedia.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251AbdBYLK3 (ORCPT ); Sat, 25 Feb 2017 06:10:29 -0500 Date: Sat, 25 Feb 2017 12:09:28 +0100 From: Markus Trippelsdorf To: Ard Biesheuvel Cc: Linus Torvalds , Will Deacon , Laura Abbott , John Stultz , Thomas Gleixner , Linux Kernel Mailing List Subject: Re: gcc7 log2 compile issues in kernel/time/timekeeping.c Message-ID: <20170225110928.GB1364@x4> References: <9c74d635-d0d1-0893-8093-ce20b0933fc7@redhat.com> <51e768e7-91af-86c5-3732-2e529364d376@redhat.com> <20170225081810.GA1364@x4> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017.02.25 at 09:11 +0000, Ard Biesheuvel wrote: > On 25 February 2017 at 08:18, Markus Trippelsdorf wrote: > > > > Why not simply get rid of the ____ilog2_NaN thing altogether? > > > > That would remove the issue, sure. But we lose an opportunity to spot > incorrect code at compile time. In the case of kernel/time/timekeeping.c it is clearly a false positive. Was ever incorrect code spotted by ____ilog2_NaN in the past? > My concern is that it by not pushing back on changes to the semantics > of __builtin_constant_p() such as this one, we may start seeing other > issues where we can no longer use it, and we lose a very useful tool. We had a long discussion in: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 As you can see there is no real consensus. But ilog2 seems to be the only place where this ever popped up. (There were several distro-wide mass rebuilds with gcc-7 and no other __builtin_constant_p() issue was found yet.) -- Markus