GNU bug report logs - #46843
28.0.50; [native-comp] (lambda (x) (if (equal x b) (eq x b) (error ""))) miscompiled

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Mon, 1 Mar 2021 06:53:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pip Cet <pipcet <at> gmail.com>
Subject: bug#46843: closed (Re: bug#46843: 28.0.50; [native-comp] (lambda
 (x) (if (equal x b) (eq x b) (error ""))) miscompiled)
Date: Mon, 01 Mar 2021 17:27:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#46843: 28.0.50; [native-comp] (lambda (x) (if (equal x b) (eq x b) (error ""))) miscompiled

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 46843 <at> debbugs.gnu.org.

-- 
46843: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46843
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andrea Corallo <akrl <at> sdf.org>
To: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 46843-done <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
Subject: Re: bug#46843: 28.0.50; [native-comp] (lambda (x) (if (equal x b)
 (eq x b) (error ""))) miscompiled
Date: Mon, 01 Mar 2021 17:26:29 +0000
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Pip Cet <pipcet <at> gmail.com> writes:
>
>> In *scratch*, evaluate
>>
>> (funcall
>>  (let* ((lexical-binding t)
>>         (a (list 'a))
>>         (b (cons a a)))
>>    (native-compile
>>     `(lambda (x) (if (equal x ',b) (eq x ',b) (error "")))))
>>  '((a) a))
>>
>> Expected result:
>>
>> nil
>>
>> Actual result:
>>
>> t
>
> Thanks for reporting this, will come-up with a fix.

Right 3d014e1bf4 is fixing the wrong assumtion that `equal' `eql' can be
treated as `eq' in propagation as every immediate in the compilation
unit is hash consed.  Indeed this assumtion is wrong for more than one
reason.

Now under `equal' `eql' we propagate only fixnums and symbols values,
all the other kind of values are promoted to their respective types and
propagated as such.

The patch adds some tests for that too.

As the two reproducer are working here I'm closing this.

Thanks for reporting.

  Andrea

[Message part 3 (message/rfc822, inline)]
From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [native-comp] (lambda (x) (if (equal x b) (eq x b) (error
 ""))) miscompiled
Date: Mon, 1 Mar 2021 06:51:30 +0000
In *scratch*, evaluate

(funcall
 (let* ((lexical-binding t)
        (a (list 'a))
        (b (cons a a)))
   (native-compile
    `(lambda (x) (if (equal x ',b) (eq x ',b) (error "")))))
 '((a) a))

Expected result:

nil

Actual result:

t



This bug report was last modified 4 years and 164 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.