all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Incorrect byte compiler error/warning message positions. A possible fix.
Date: Mon, 15 Nov 2021 11:49:51 +0000	[thread overview]
Message-ID: <YZJJXwELEMWmJ7lB@ACM> (raw)
In-Reply-To: <87sfvy2dsl.fsf@gnus.org>

Hello, Lars.

On Mon, Nov 15, 2021 at 06:22:50 +0100, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > The byte compiler reports wrong source positions in its error and
> > warning messages; not every time, but perhaps most of the time.  There
> > are currently at least six open bugs for this problem, e.g. bug #22288.

> In my experience, the vast majority of the warning messages point to the
> correct position.  But, yes, it does sometimes give the wrong position.

On 2018-11-22 (before you destroyed my test dataset by fixing all the
warnings in Emacs ;-) there were 335 warnings.  81 gave the correct
location, 254 a wrong one.

> > In the new scheme it is no longer true that (eq #<foo at 20081> 'foo).
> > The Lisp form for a function being compiled is manipulated as at
> > present, only its symbols will have positions.  These will get stripped
> > out of the symbols before final code generation.

> Hm...  interesting.  But couldn't the same stripping be done even if the
> symbols are eq?  That way eq would be slower during byte compilation,
> but not otherwise?

That's what I tried three years ago.  `eq' works mainly with the EQ
macro in src/lisp.h.  It works with a straight comparison of two 64 (or
32) bit words.  When that was augmented by a test of symbol_with_pos_p
(which was always zero outside of byte compilation), the performance of
Emacs dropped that 8% - 15% that people objected to so much.

> > The biggest problem is with macros, and I think I can solve this.

> There's also an issue with byte-hunk-handlers and byte-optimizer forms
> (etc), I'd guess?  They inspect the forms and do operations based on the
> symbols.

They should be fairly easy (if, perhaps, tedious) to solve, because
everything is under our control.  It's macros where people outside of
our control do wierd and wonderful things.  I think I know how to
compile macros so that they both work, yet preserve the symbols with
position on the code they generate.  These compiled macros won't work on
earlier versions of Emacs, but that's a bridge to cross when we come to
it.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).



  parent reply	other threads:[~2021-11-15 11:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14 19:13 Incorrect byte compiler error/warning message positions. A possible fix Alan Mackenzie
2021-11-15  5:22 ` Lars Ingebrigtsen
2021-11-15  5:29   ` Po Lu
2021-11-15 11:52     ` Alan Mackenzie
2021-11-15 11:49   ` Alan Mackenzie [this message]
2021-11-15 21:19     ` Stefan Monnier
2021-11-16  7:32       ` Lars Ingebrigtsen
2021-11-16 17:05       ` Alan Mackenzie

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

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

  git send-email \
    --in-reply-to=YZJJXwELEMWmJ7lB@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.