unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vibhav Pant <vibhavp@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Cc: Stephen Berman <stephen.berman@gmx.net>, 26518@debbugs.gnu.org
Subject: bug#26518: 26.0.50; M-x bubbles crashes emacs
Date: Sun, 16 Apr 2017 20:26:27 +0530	[thread overview]
Message-ID: <CA+T2Sh1XgKv3GYO_S9XhL7Y7woJ6nARfkym4OUAsHVTvPLXQ1Q@mail.gmail.com> (raw)
In-Reply-To: <83pogdfxem.fsf@gnu.org>

The following code also crashes Emacs:
(defun fun1 (v)
  (car (cond ((eq v 1) '(one . 1))
    ((eq v 2) '(two . 2))
    ((eq v 3) '(three . 3)))))
(byte-compile 'fun1)
(defun fun2 (v)
  (inline (fun1 v)))
(byte-compile 'fun2)
(fun2 1)

The problem lies in byte-compile-inline-lapcode not being able to
inline bytecode that uses switch, because the peephole optimizer
will often merge tags and convert goto-to-return to returns,
making it impossible restore the correct byte-compile-depth while
inlining it. I can think of two ways to fix this:

Disable certain optimizations for byte-switch code, and allow
the jump table to store certain properties that will make it possible
to inline switch code properly (specifically, the donetag). This could
be done by replacing the hash table with a (DONETAG . JUMP-TABLE) cons
pair (inline-lapcode would use the car, while the bytecode VM would use
it's cdr).

Disable inlining byte-switch code entirely. However, this would impact
performance negatively.

Thoughts?

Regards,
Vibhav

-- 
Vibhav Pant
vibhavp@gmail.com





  reply	other threads:[~2017-04-16 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-15 14:13 bug#26518: 26.0.50; M-x bubbles crashes emacs Stephen Berman
2017-04-15 14:44 ` Eli Zaretskii
2017-04-15 15:40   ` Vibhav Pant
2017-04-15 16:28     ` Eli Zaretskii
2017-04-16 14:56       ` Vibhav Pant [this message]
2017-04-21 12:09         ` Stephen Berman
2017-04-21 12:14           ` Vibhav Pant
2017-04-21 13:38           ` Stephen Berman

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=CA+T2Sh1XgKv3GYO_S9XhL7Y7woJ6nARfkym4OUAsHVTvPLXQ1Q@mail.gmail.com \
    --to=vibhavp@gmail.com \
    --cc=26518@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stephen.berman@gmx.net \
    /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).