From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42360: [feature/native-comp] miscompilation(?) of functions with non local exits Date: Wed, 15 Jul 2020 08:24:00 +0000 Message-ID: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="465"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Stefan Monnier To: 42360@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 15 10:25:12 2020 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 1jvcj1-000AZb-Sd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jul 2020 10:25:11 +0200 Original-Received: from localhost ([::1]:60282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvcj0-0003Zk-LX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jul 2020 04:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvcit-0003ZM-3Y for bug-gnu-emacs@gnu.org; Wed, 15 Jul 2020 04:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jvcis-0006qy-QB for bug-gnu-emacs@gnu.org; Wed, 15 Jul 2020 04:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jvcis-0004Rx-Im for bug-gnu-emacs@gnu.org; Wed, 15 Jul 2020 04:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jul 2020 08:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42360 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.159480145017031 (code B ref -1); Wed, 15 Jul 2020 08:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jul 2020 08:24:10 +0000 Original-Received: from localhost ([127.0.0.1]:52067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jvci1-0004Qd-LW for submit@debbugs.gnu.org; Wed, 15 Jul 2020 04:24:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jvchy-0004QS-WB for submit@debbugs.gnu.org; Wed, 15 Jul 2020 04:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvchy-000364-Pk for bug-gnu-emacs@gnu.org; Wed, 15 Jul 2020 04:24:06 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:53993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvchw-0006Yq-0w; Wed, 15 Jul 2020 04:24:06 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 06F8O013004347; Wed, 15 Jul 2020 08:24:01 GMT Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/15 04:24:01 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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:183011 Archived-At: Due to a recent modification native-comp is (probably?) miscompiling lexical scope functions with non local exits if they involve code with side effect on local variables. Before fixing I prefer to double check the correct behavior we want. Considering the following piece of (lexical scoped) code: === (let (x) (ignore-errors (setq x t) (error "foo")) x) === Three options: 1- Because setq is evaluated the expression should always evaluate to t. 2- Unwinding the original state of the stack is restored, when it was saved 'x' was nil so the expression should evaluate to nil. 3- This is unspecified. The current stock implementaion does always 1 so I'm prone to just go for it but I wanted to double check to be on the safe side. FYI 1 implies C register variables cannot be used to implement Lisp local variable if non local exits are present. Thanks Andrea -- akrl@sdf.org