Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp117708ybe; Wed, 4 Sep 2019 16:17:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqztYIl9HWxHy+Go0+pHjbAxGVi/i5Kw7pO3t4HZHyStmi7cn7qg2SyG1ZhV+nqzMM1dSorC X-Received: by 2002:a63:5941:: with SMTP id j1mr476593pgm.319.1567639032326; Wed, 04 Sep 2019 16:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567639032; cv=none; d=google.com; s=arc-20160816; b=qTmvhEhtIw0kV84ifSGu8RHn5DbES2B6PcCvUPFCP8Ym8vRjS0F5ZFt1hMYSzZUtxP qi3dkQgKs4Mpvdd+KYQEtXT8YUIvyBLyPrFICcdHVcFaGnkUBjnJvrUU0wrgm1zkz4qp A1hydNggbSTHDLynNN/s5LcTVfqIjxoQg6zUALlI9AoNqocbd4qn1mRfBon81uqyUuPf wv+nBfr+WGbycSIqGEdWL44oayWm0QSpjT4PxxDMdBtFINuogFz7diixdnUmgm3/Adv8 8PbJaXK9ys9sBqGQiUvZmpdGd02AmtMd+OgH2XegcYgVeV7DNGNOPkkM42/aZ3q9RzHC zLMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=D+jh77ZLgNensDYPn2dN2wL4k27PJ6BpfuVV6pgmL7g=; b=yzv0QJLpQiLeTrdmPEtRkgZAXKTPUWWdqOY+i6mvewlB7Ivbh8LwMsmGcIi/4af3js I+PSoQAriKN0hCWNyqdkv1/rpJ1De+wZcWVgRQmmyOrs3D3o1Yr5JDuNThIOWmrQ28IN YlCZEfuCyJiFrq11fe+CVfej4zRFL7yH4mWG+YJN2fPgLVo8A3G0u1Z7DiOvMLhqKPmW zyVSI0gbLhSLHo91JgN6ikai1IJXS2/1jGxTssDxnvsd7fERxzp5HOP304L64Ug3cw2f PAgS1scKz0yXJdKsEBlGMI5t3VEyfSUOkHyefJcN8O3JQzywu8LTT6l3n71zB86NETrb hJGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="E0hH/5KZ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si126132pgu.226.2019.09.04.16.16.56; Wed, 04 Sep 2019 16:17:12 -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=@gmail.com header.s=20161025 header.b="E0hH/5KZ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730131AbfIDXP7 (ORCPT + 99 others); Wed, 4 Sep 2019 19:15:59 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36606 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbfIDXP7 (ORCPT ); Wed, 4 Sep 2019 19:15:59 -0400 Received: by mail-wm1-f67.google.com with SMTP id p13so585250wmh.1; Wed, 04 Sep 2019 16:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=D+jh77ZLgNensDYPn2dN2wL4k27PJ6BpfuVV6pgmL7g=; b=E0hH/5KZPUbuapqt3Z57/i+myQE/X/8+9T1h7ZwzooTZFrauoJKpwhyX2YG21HRAly 5ZPac6JEX2A0gPXuwBVMuX4LbTwVUws7ZdBidSR5KDozTQXQYfMwl88kRfMHS/OkTMq0 cotN8RM2UrUFC8JZpSkMJm6h4cCwj8lL0cZJF7Z+6vyPR9I2a5lHJ8ltH8gTtqM/a9qk fUR4h3x3Nk03WFcUmF633tW7lJGnGNZx8EoMnrK/hphQ6mCIaQd/sURbEX/UdRfl47L8 6WAGON3hJk4HT+fv5HhYXo3BC/w9GTdUPEBETmCLkHQclpPvFkxikQQVE0EQk8MW3m4V U6Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=D+jh77ZLgNensDYPn2dN2wL4k27PJ6BpfuVV6pgmL7g=; b=cWLBMsup3Tw5HLl2eyHuNFDrGSqYAbtPki5RyIs+IrRwKP5hRmNdXCxeYiSykuWoNm Aan/YWRB/lrnvxM3YkB2L2l1YJGir88g41xhTgRY512p7p6Iel2c78shbFrnDVkLflqd gnpRmH/fB3fA3NrqujvCd94k5jeQazK+UY07+uqwiBCaPNM9dlg37ak35iD8v2wKh0cS LxXF2Sx+oITUuNStWHbJAcGK/eEpb48lUU491K5YWA0T33u5qysP0jXwwrMBBoiKNY4A zBmfNFzlkAyh2VhnXvbyS2xj2krzBU51OCMGMvU8LG9N1i1760ShHexiyVl3S5TYoiYi 2TCw== X-Gm-Message-State: APjAAAWIm1vfPwgybhYhkLI4g6tQ+eTy+JX4nTZPBJmA4CMCHML+4Fz0 O6+NOvvwnZ8sqSfvq7jAH6E= X-Received: by 2002:a7b:c766:: with SMTP id x6mr514054wmk.51.1567638957553; Wed, 04 Sep 2019 16:15:57 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id z189sm788009wmc.25.2019.09.04.16.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 16:15:56 -0700 (PDT) Date: Wed, 4 Sep 2019 16:15:54 -0700 From: Nathan Chancellor To: Segher Boessenkool Cc: David Laight , Nick Desaulniers , LKML , "# 3.4.x" , clang-built-linux , Paul Mackerras , linuxppc-dev Subject: Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp Message-ID: <20190904231554.GA42450@archlinux-threadripper> References: <878srdv206.fsf@mpe.ellerman.id.au> <20190828175322.GA121833@archlinux-threadripper> <20190828184529.GC127646@archlinux-threadripper> <6801a83ed6d54d95b87a41c57ef6e6b0@AcuMS.aculab.com> <20190903055553.GC60296@archlinux-threadripper> <20190903193128.GC9749@gate.crashing.org> <20190904002401.GA70635@archlinux-threadripper> <1bcd7086f3d24dfa82eec03980f30fbc@AcuMS.aculab.com> <20190904130135.GN9749@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904130135.GN9749@gate.crashing.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 04, 2019 at 08:01:35AM -0500, Segher Boessenkool wrote: > On Wed, Sep 04, 2019 at 08:16:45AM +0000, David Laight wrote: > > From: Nathan Chancellor [mailto:natechancellor@gmail.com] > > > Fair enough so I guess we are back to just outright disabling the > > > warning. > > > > Just disabling the warning won't stop the compiler generating code > > that breaks a 'user' implementation of setjmp(). > > Yeah. I have a patch (will send in an hour or so) that enables the > "returns_twice" attribute for setjmp (in ). In testing > (with GCC trunk) it showed no difference in code generation, but > better save than sorry. > > It also sets "noreturn" on longjmp, and that *does* help, it saves a > hundred insns or so (all in xmon, no surprise there). > > I don't think this will make LLVM shut up about this though. And > technically it is right: the C standard does say that in hosted mode > setjmp is a reserved name and you need to include to access > it (not ). It does not fix the warning, I tested your patch. > So why is the kernel compiled as hosted? Does adding -ffreestanding > hurt anything? Is that actually supported on LLVM, on all relevant > versions of it? Does it shut up the warning there (if not, that would > be an LLVM bug)? It does fix this warning because -ffreestanding implies -fno-builtin, which also solves the warning. LLVM has supported -ffreestanding since at least 3.0.0. There are some parts of the kernel that are compiled with this and it probably should be used in more places but it sounds like there might be some good codegen improvements that are disabled with it: https://lore.kernel.org/lkml/CAHk-=wi-epJZfBHDbKKDZ64us7WkF=LpUfhvYBmZSteO8Q0RAg@mail.gmail.com/ Cheers, Nathan