Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7121914imm; Tue, 28 Aug 2018 06:49:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbj5Yik6erBAKd1jV7kxiIVuUyK6yv2KDLWyZOu83/4p9jC5sPEoj5wrivXqxJC2e8pw3aT X-Received: by 2002:a63:4005:: with SMTP id n5-v6mr1653281pga.221.1535464160204; Tue, 28 Aug 2018 06:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535464160; cv=none; d=google.com; s=arc-20160816; b=OderB3dx1Qj8CDne2MxjfaWnEm9VnLudP8JAFrUnnd/HIonxDQ6+dWahbEXWUUgP2R gdfT+CopUyCR8IqxrR2EwsNHUALGl7D5sF5sUOC3V9telsSm9/6yObdLM4AxkSNP3ogl yAsmxI+5+VtAJD8kRdE3vIqju1DvgLq7Xo3VMbM5a8eWtuziocJ5hGBjxMqd0JfUur4b v3YEDge2rS0E8epo+SOO/xBvvR7NrZLYyM944XnLOlkBrz+jSeR6QfphFzqKAK73EO7I n4DGnm//tJuI1ZI7vJaGfH0a+vfe0QKrHU8tg2DzYzjuFOpumJXXf+7JnofJEqM3WrYn BdbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=tV9ejS/uIxcX5Arhv9DLkFl7BhaBUIeeAvherwqzrbY=; b=zdPmdlwxrgFZs6oUNh6a4Xe5YBXZ3cLYZbDX6nJsAYEEUgk1IeMViIdDypMr1+lyg3 yBuvmMfenRa2Mg9zUxSfXajlpm6CyHvBn87oREb5Pb5TUUa0ZkEFzw6dHf3AYnymYb5z dmFtakVEYQ04G0SE5bgYIvucOduhcFF4WGRPNCc2vTjXMIcsudbNq4tOmX+7R1i4GsTB or8hqEDJLMMFHhyVemPHcxFwj4MRNU/ptdUZ6+GygjOvS1OKLf75er997vf/RWez8pRC e1EobivCMzCUP8G/aI72DhjHcAE4oWpM2VCDdIcRyJXQcZH5EleLYCgbSGMqphQhINCp NbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IlINU9XE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3-v6si1099637pgc.447.2018.08.28.06.49.05; Tue, 28 Aug 2018 06:49:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IlINU9XE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbeH1RjV (ORCPT + 99 others); Tue, 28 Aug 2018 13:39:21 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:44609 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbeH1RjV (ORCPT ); Tue, 28 Aug 2018 13:39:21 -0400 Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (authenticated) by conssluserg-06.nifty.com with ESMTP id w7SDlLs9003963; Tue, 28 Aug 2018 22:47:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com w7SDlLs9003963 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1535464042; bh=tV9ejS/uIxcX5Arhv9DLkFl7BhaBUIeeAvherwqzrbY=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=IlINU9XEzfSI8QPDecxw9cOB0iUbLD/q5hdz2iwHJNEDB5w2DOVCmMpKpKbJukX5G d3w+HNzWpDMjOi8WLLPChDli23OFq8kIXRtNMxvLL2N8o4C2U83YSvZwrs4GQeE9mr fRAB70TZofCAsTmhkLxjGd5sCFvL8SgzUrHSJWOT0sMNr4GJTe/gC8z//M4mqD177a 9B9leOX0KxAwifT99Mj82Jcf+iX1idI9LzcBWJOg3bpAnokE24SmOCEWPggrwK31b1 E7OiXoEERErvFwVihYKf+Zsq9B9dOBiBInGroOgo0QTkW5USr04ArTiV2AmS9ayjWY KjN8EgEazioBw== X-Nifty-SrcIP: [209.85.222.49] Received: by mail-ua1-f49.google.com with SMTP id q7-v6so1003745uam.12; Tue, 28 Aug 2018 06:47:22 -0700 (PDT) X-Gm-Message-State: APzg51AdvPGwi+8CU7z6VSf5BotXduNtORSOcrXODZGpPejYl1BHjBuP nLWkkjX4XS0Gq6PGL1RbauFeRbJkX7hcvBUHobM= X-Received: by 2002:ab0:4f17:: with SMTP id n23-v6mr1025334uah.135.1535464041289; Tue, 28 Aug 2018 06:47:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Tue, 28 Aug 2018 06:46:40 -0700 (PDT) In-Reply-To: References: <1535220989-27645-1-git-send-email-yamada.masahiro@socionext.com> <84cf6ae0-97c8-6b73-ca86-b3d3b3daba5b@pobox.com> <8d5cf8c6-556a-96a1-610d-c92355783a9f@pobox.com> From: Masahiro Yamada Date: Tue, 28 Aug 2018 22:46:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] compiler.h: give up __compiletime_assert_fallback() To: Arnd Bergmann Cc: Daniel Santos , Nick Desaulniers , Linus Torvalds , Kees Cook , Christopher Li , linux-sparse@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-08-28 19:55 GMT+09:00 Arnd Bergmann : > On Mon, Aug 27, 2018 at 10:44 PM Daniel Santos wrote: >> >> On 08/27/2018 03:09 PM, Nick Desaulniers wrote: >> >> Now we're back to the question of "what do you mean by 'constant'"? If >> >> you mean a C constant expression (as defined in the C standard) than >> >> almost none of this code fits that criteria. For these compile-time >> >> assertions to work, we are concerned with the data flow analysis and >> >> constant propagation performed by the compiler during optimization. You >> >> will notice in include/linux/compiler.h that __compiletime_assert is a >> >> no-op when __OPTIMIZE__ is not defined. >> > Depending on optimizations for static assertions sounds problematic. >> >> (with my best Palpatine voice) It is unavoidable. >> >> Actually it's theoretically possible, but the compiler would have to do >> something akin to copying it's control flow graph et. al, run -O2-ish >> optimizations, perform the static assertions and then throw away the >> optimized control flow graph and emit code based upon the original. > > In the context of the kernel, compiling with anything less than -O2 or > -Os is not an issue, we don't do it anyway. -O0 never worked, and > AFAICT we only build one file with -O1, but that is something we can do > away with as well: > > from fs/reiserfs/Makefile: > # gcc -O2 (the kernel default) is overaggressive on ppc32 when many inline > # functions are used. This causes the compiler to advance the stack > # pointer out of the available stack space, corrupting kernel space, > # and causing a panic. Since this behavior only affects ppc32, this ifeq > # will work around it. If any other architecture displays this behavior, > # add it here. > ccflags-$(CONFIG_PPC32) := $(call cc-ifversion, -lt, 0400, -O1) > > Arnd Recently, I sent out patches to remove redundant GCC version checks, including this one. https://lore.kernel.org/patchwork/patch/977808/ I do not know who is maintaining reiserfs, though. -- Best Regards Masahiro Yamada