[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect byte compiler error/warning message positions. A possible

From: Alan Mackenzie
Subject: Re: Incorrect byte compiler error/warning message positions. A possible fix.
Date: Mon, 15 Nov 2021 11:49:51 +0000

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

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

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]