From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#6740: Spurious byte compiler warnings Date: Thu, 29 Jul 2010 22:36:23 +0200 Message-ID: References: <20100727200619.GC2280@muc.de> <20100727212328.GD2280@muc.de> <20100728174933.GB2999@muc.de> <20100728194511.GD2999@muc.de> <20100729202420.GB2459@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280437196 2576 80.91.229.12 (29 Jul 2010 20:59:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Jul 2010 20:59:56 +0000 (UTC) Cc: Dan Nicolaescu , 6740@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 29 22:59:53 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OeaCk-0003DD-1e for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jul 2010 22:59:50 +0200 Original-Received: from localhost ([127.0.0.1]:38021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeZzX-0004IU-9y for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jul 2010 16:46:11 -0400 Original-Received: from [140.186.70.92] (port=35994 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeZvU-00037c-Cj for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:46:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeZuZ-0002xS-Iq for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:41:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39437) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZuZ-0002xO-HV for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OeZqg-0006YX-LH; Thu, 29 Jul 2010 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jul 2010 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6740 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6740-submit@debbugs.gnu.org id=B6740.128043579225122 (code B ref 6740); Thu, 29 Jul 2010 20:37:02 +0000 Original-Received: (at 6740) by debbugs.gnu.org; 29 Jul 2010 20:36:32 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZqB-0006X9-Ey for submit@debbugs.gnu.org; Thu, 29 Jul 2010 16:36:31 -0400 Original-Received: from mail-bw0-f44.google.com ([209.85.214.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZq9-0006X4-SO for 6740@debbugs.gnu.org; Thu, 29 Jul 2010 16:36:30 -0400 Original-Received: by bwz7 with SMTP id 7so489524bwz.3 for <6740@debbugs.gnu.org>; Thu, 29 Jul 2010 13:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/U2CGrPi7cVwjj2HLu3o0khKMI1voUIhVRJc2CK4yYw=; b=ppr75RUBJtj+foUehMPUtpdnkdY2rcRFHbcoIAsckCDUDxNd6snj/wN1ucPNPlU6RM /ipZl3UclBNalLlmJ8Qsz4/63do2gHvYehegg+ttNFejRAcFmfsUvo8hbC2NuXgUgQNH P3CcEfIG+aNKOOLeKT3wS3UsXm0DO3NecK+9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=OCSah8oOayMEoI6EPM0WGjs1A54o5jZ/qXUPkRreseFW+rIG7MYXBagEjJtxFiN9OC 8uWTV88uwzEYBZanmJF4PE+f31nYCb+PEwOVPovRixIRbFkCEOxdYZ1ziw9pASxxUESb 0YEcK2Qkne1NR8fRwlLZMcGx5lzqE2sknNOCo= Original-Received: by 10.204.76.205 with SMTP id d13mr448098bkk.93.1280435803257; Thu, 29 Jul 2010 13:36:43 -0700 (PDT) Original-Received: by 10.204.180.136 with HTTP; Thu, 29 Jul 2010 13:36:23 -0700 (PDT) In-Reply-To: <20100729202420.GB2459@muc.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 29 Jul 2010 16:37:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39062 Archived-At: On Thu, Jul 29, 2010 at 22:24, Alan Mackenzie wrote: > No, sorry it isn't. =C2=A0It's a good hint that there's a bug in the byte > compiler, the tentative conclusion I came to after trying various things. No, of course not, because there's no bug (well, other than the duplicate message). The warning is obscure, yes. Warnings about optimized code often are. I agree that it'd be good to have better warnings and error messages (something like "optimization X has rendered code Y unused", perhaps). IIRC, there's published research about good error messages in the face of program transformations. > If it were such a good hint, I wouldn't have spent several hours of > bafflement trying to figure out what was wrong. =C2=A0Or is it just me wh= o's > uniquely stupid? It's not about being stupid, only about knowing a bit what the bytecompiler does, or not. You didn't, and you're *right* that the warning is difficult to interpret. > Is there anybody here listening in who's seen this > message and immediately understood it? Well, I did, but I remembered the (featurep 'xemacs) optimization so I had a head start. > Abstractly seen, the warning did not relate to my source code; it related > to an internal, transformed, different piece of source created by the > compiler. =C2=A0I think warning messages should always be wrt the origina= l > code. Agreed. > The cause of my confusion was that silent change to 'xemacs. > There are surely not too many situations where the compiler does this, > are there? Even if there aren't many, optimizations could be added later; for example, to statically determine that (=3D 0 0) is t, or even that (and (> x 0) (< x 0)) is nil. > Yes; I've already made that change, thanks! =C2=A0But what is the process= by > which I'm meant to come to sufficient understanding to be able figure > this out? That's a good question. > There's nothing suspicious about having (featurep 'xemacs) in the middle > of an `and' form. No, but the warning isn't about that. Is about unused side-effect-free code= . > I agree there would be something suspicious about > having a bare `nil' there. =C2=A0Can't the compiler figure out the differ= ence > between these two cases somehow? Yes, it could. Again, no one has bothered to implement it, because these kinds of problems aren't common (most warnings are relatively understandable withouth delving into the bytecompiler sources). > Oh, all right then. =C2=A0Can I ask you to come up with some form of warn= ing > which, several years ago, would have saved me all these hours of > frustration? Not me. I understand what the bytecompiler is doing (at least, I think I do) but I'll leave fixing it for the experts. =C2=A0 =C2=A0 Juanma