From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#24449: Emacs 25.1 RC2: Byte compiler reports error in wrong place. Date: Fri, 16 Sep 2016 16:08:33 +0000 Message-ID: <20160916160833.GD3630@acm.fritz.box> References: <20160916113124.GB3630@acm.fritz.box> <83wpic3rpb.fsf@gnu.org> <20160916133352.GC3630@acm.fritz.box> <83twdf51al.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1474042157 20384 195.159.176.226 (16 Sep 2016 16:09:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2016 16:09:17 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 24449@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 16 18:09:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkvhQ-0004hB-Nb for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Sep 2016 18:09:12 +0200 Original-Received: from localhost ([::1]:42562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkvhR-00029G-Lo for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Sep 2016 12:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkvhJ-00026u-EH for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2016 12:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkvhG-0002DF-K8 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2016 12:09:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkvhG-0002D4-Gk for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2016 12:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bkvhG-0008FD-4Y for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2016 12:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2016 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24449-submit@debbugs.gnu.org id=B24449.147404214031684 (code B ref 24449); Fri, 16 Sep 2016 16:09:02 +0000 Original-Received: (at 24449) by debbugs.gnu.org; 16 Sep 2016 16:09:00 +0000 Original-Received: from localhost ([127.0.0.1]:33511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkvhE-0008Ey-LK for submit@debbugs.gnu.org; Fri, 16 Sep 2016 12:09:00 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:39043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkvhC-0008Ep-FK for 24449@debbugs.gnu.org; Fri, 16 Sep 2016 12:08:58 -0400 Original-Received: (qmail 16036 invoked by uid 3782); 16 Sep 2016 16:08:57 -0000 Original-Received: from acm.muc.de (p548C6AC0.dip0.t-ipconnect.de [84.140.106.192]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 16 Sep 2016 18:08:56 +0200 Original-Received: (qmail 13635 invoked by uid 1000); 16 Sep 2016 16:08:33 -0000 Content-Disposition: inline In-Reply-To: <83twdf51al.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123386 Archived-At: Hello, Eli. On Fri, Sep 16, 2016 at 06:09:38PM +0300, Eli Zaretskii wrote: > > Date: Fri, 16 Sep 2016 13:33:52 +0000 > > Cc: 24449@debbugs.gnu.org > > From: Alan Mackenzie > > > If you didn't, you should, because after you do, you will never again > > > wonder why an incorrect line number is reported. In fact, now that I > > > did look there, I'm surprised it reports a correct line number at all, > > > let alone as often as it does. It's sheer luck. > > This is not a Good Thing. Even its own comment describes itself as a > > "gross hack". Surely we can do better? > I certainly hope we can. But, unless I misunderstood something, the > way it's designed makes that really hard. Yes. I understand it better now, though the comments before `byte-compile-set-symbol-position' are not as helpful as they might be. Given that the byte compiler works by first reading an entire top-level form, and only then going to work on it, the only handle the compiler has on the original source is this list `read-symbol-positions-list' produced by the reader. (It was probably invented for the byte compiler). So without rewriting one or both of the byte compiler and the reader, there doesn't seem to be a different strategy available for determining the position in the raw source. Correction: there might be: On processing a symbol, at the moment the earliest occurrence of that symbol in `read-symbol-positions-list' is removed from it. Instead, we could remove everything up to and including that symbol. Maybe. What I'm guessing happened in my particular case is that several instances of 'eq in that list failed to get removed because it's a function that undergoes compiler optimisation. Or something like that. So, the thing for me to check first is that `byte-compile-set-symbol-position' gets called for _everything_ it should be. -- Alan Mackenzie (Nuremberg, Germany).