unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 46387@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#46387: 28.0.50; Compiled code making a variable dynamic stopped working
Date: Wed, 10 Feb 2021 04:20:46 +0100	[thread overview]
Message-ID: <874kiksj5d.fsf@web.de> (raw)
In-Reply-To: <B18B1DE2-0340-4A51-9B3D-8489C31C7F15@acm.org> ("Mattias Engdegård"'s message of "Tue, 9 Feb 2021 11:32:58 +0100")

Mattias Engdegård <mattiase@acm.org> writes:

> As it turns out, parts of the implementation have different opinions
> about that. As you observed, the recently added optimisation on master
> takes a strict syntactic view: even a `progn` is a lexical scope, and
> `with-suppressed-warnings` wraps its body in a `progn`; thus your
> `defvar` declarations have no effect outside that construct.

Seems this is the related code change (took quite a while until I found
that):

83983b6b7a115474572973b62eb5e42251713e63
Author:     Mattias Engdegård <mattiase@acm.org>
AuthorDate: Sat Feb 6 18:34:45 2021 +0100

 (defun byte-optimize-body (forms all-for-effect)
   ;; Optimize the cdr of a progn or implicit progn; all forms is a list of
@@ -590,6 +763,7 @@ byte-optimize-body
   ;; all-for-effect is true.  returns a new list of forms.
   (let ((rest forms)
 	(result nil)
+        (byte-optimize--dynamic-vars byte-optimize--dynamic-vars)
 	fe new)
     (while rest
       (setq fe (or all-for-effect (cdr rest)))

Should that line just be removed?

TIA,

Michael.





  parent reply	other threads:[~2021-02-10  3:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 17:29 bug#46387: 28.0.50; Compiled code making a variable dynamic stopped working Michael Heerdegen
2021-02-09 10:32 ` Mattias Engdegård
2021-02-09 15:31   ` Stefan Monnier
2021-02-09 16:49     ` Mattias Engdegård
2021-02-09 18:48       ` Stefan Monnier
2021-02-10  3:20   ` Michael Heerdegen [this message]
2021-02-10  8:22     ` Mattias Engdegård
2021-02-10 13:49       ` Mattias Engdegård
2021-02-10 22:44         ` Michael Heerdegen
2021-02-11  8:49           ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kiksj5d.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=46387@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).