From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#46847: 28.0.50; [native-comp] assume pseudo-insns should be verified Date: Mon, 1 Mar 2021 13:06:31 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36523"; mail-complaints-to="usenet@ciao.gmane.io" To: 46847@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 01 14:08:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGiHW-0009OG-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Mar 2021 14:08:14 +0100 Original-Received: from localhost ([::1]:44262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGiHV-0000RC-8S for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Mar 2021 08:08:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGiHL-0000M8-2b for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 08:08:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGiHJ-0006Bw-Rl for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 08:08:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lGiHJ-0007KC-Mg for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 08:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2021 13:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46847 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161460403328092 (code B ref -1); Mon, 01 Mar 2021 13:08:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Mar 2021 13:07:13 +0000 Original-Received: from localhost ([127.0.0.1]:48451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGiGX-0007J2-Cc for submit@debbugs.gnu.org; Mon, 01 Mar 2021 08:07:13 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGiGW-0007Iv-8P for submit@debbugs.gnu.org; Mon, 01 Mar 2021 08:07:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGiGW-0008Ez-3L for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 08:07:12 -0500 Original-Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:33741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGiGU-0005rF-Fs for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 08:07:11 -0500 Original-Received: by mail-ot1-x32a.google.com with SMTP id 40so7973482otu.0 for ; Mon, 01 Mar 2021 05:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/3yMdq7YDKbEPgRymuQifvjpO6lt/7a6fpavKIMk51A=; b=kPQX+wVtorODPSr2bhMYa1sIfXGyCLqK/TO7cIFtDqatoAEU8SfwMvy94zAvQoH/1o sls6lKFraAiRBSlx5ueZ0+/Hj3cBlLYj2P3QWT+ratQ4gE1lP6Q3He1LYbh9h6m1k+Uu u0do9DVtXeCnzPh4au0jSjJ37UHEYTEu0XQpnyOYJCECXIW+MM1D6YmLOv3F89/wxOkh 8O6D45FIRdGbmEgnYyZ2XFcxQZviHHPn6CMhn1jyfr7T+mWRSwUPTbwKl0GuDR8CNR+3 HYGfjselOUwI+asJReGURh4Bbw4gJ7KWPkZPpLVH1MMKUjvNYOIdOd5Mb6Sbh7bhAEgK Hf+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/3yMdq7YDKbEPgRymuQifvjpO6lt/7a6fpavKIMk51A=; b=XZhMVRkRCxhY9SO4yBGY90djSvTEeRSJe8UcltcSVYgYD3yHg4Z5WW2kh4b5cDMiXM ycuRV+79ZBcIEr62hgtV6ojXweOa3fIFiB18JFvl6kVvtnTdoQilwN/17LttOG7PVq5G H8hxgTLJTxcLtplW2RbWn4Zx1/1CqyCprHVRRKfjWQMisyMHux3y9wd98J8Q82xuUNt1 qQvNrrwVfwFWFRlr7eASvbk/YFA2a09RpkCqXLzD3wBxVh51XP256+7pcXN7JyXSQTFv GihjPKMs18B0PiuQytrERE82d2a2j3V0fI0mC+51z0zSyGXzw/EWeX4zlKkxbvL0fS7s 1LIA== X-Gm-Message-State: AOAM532NqSeMGnWKe0Mwx+WSu0sqVMjZBPBNcMl7hmBzTwfBYSOymygO FCjcnurEEoyhwSkv5tfzW7CSro9ScPGscVsP/J4BQscYwukCXg== X-Google-Smtp-Source: ABdhPJzZDrF7JNGanVsvvUcBqvACbS1qt2XIQNjZ9B/SX8WZX/raNRY5WkFE5IqByDq75viQEtBl2oNyScO/9hmxW6w= X-Received: by 2002:a05:6830:1682:: with SMTP id k2mr13489910otr.154.1614604027918; Mon, 01 Mar 2021 05:07:07 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=pipcet@gmail.com; helo=mail-ot1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201087 Archived-At: This is a wishlist item for the native-comp branch, though I consider the feature in question to be so essential that its absence also qualifies as a bug. The native-comp branch is emitting assume pseudo-insns. Those come in various forms, but their interpretation is clear: they express conditions which are meant to hold at runtime, and which the compiler may use to optimize code. I would like to add an optional compiler pass which asserts that the conditions are actually true at runtime. This is a basic safeguard that any assume() mechanism should have, and it's perfectly equivalent to the way eassume() becomes eassert() in debug builds of Emacs. Unfortunately, it turns out that while adding the compiler pass is easy, there are many failures because the assume pseudo-insns emitted at present are inconsistent or plain wrong. Some of these wrong assumes result in reproducible Lisp-to-native-code bugs today; others will not; for still others, we're not sure. For example, the four following bugs became a problem only because of a lack of this safeguard: bug#46843 (both bugs), bug#46812, bug#46670. Merging native-comp without such a safeguard would, I am convinced, introduce preventable, tricky, unnecessary bugs into the Emacs master branch. We shouldn't do that. Pip