Subject: Byte compiler bug
From: Alan Mackenzie <[email-masked]>
To: [email-masked]
Date: Sun, 17 Apr 2022 12:31:16 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello, Emacs.

In up to date master branch:
(i) emacs -Q
(ii) Enter the following into buffer *scratch*:

    (defun E+->E@+ (elt op)
      (cond
       ((eq op '+) (setcar elt '*))
       ((eq op '+\?) (setcar elt '*\?))))
    (defconst foo-elt '(+\? . "foo"))
    (E+->E@+ foo-elt '+\?)

  .
(iii) With point in the defun, M-x compile-defun.
(iv) Evaluate the defconst.
(v) Evaluate the E+->E@+ form.
(vi) M-: foo-elt.  It's value is unchanged from its declaration.  It
  should have been changed to (*\? . "foo").  This is a bug.

(vii) M-x disassemble RET E+->E@+.  Instead of working, this gives the
  error message:

    Optimizer error: missed tags (((TAG 2) TAG 4) ((TAG 1) TAG 3))

  .  This is a bug.

(viii) (Optional)  Evaluate the defun form with C-M-x, and evaluate the
  E+->E@+ form.  M-: foo-elt.  This shows the expected value,
  (*? . "foo").

At a guess, the symbols with the \? in their names have something to do
with the bug.

Here is my configuration:

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.31, cairo version 1.16.0)
 of 2022-04-17 built on ACM
Repository revision: 2136db067f4292d84553ebfddab30d88b862262e
Repository branch: master
System Description: Gentoo/Linux

Configured using:
 'configure --with-gif=no --with-tiff=no --with-gpm
 --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM
GTK3 ZLIB

-- 
Alan Mackenzie (Nuremberg, Germany).