[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make check error in native compiler resulting from commit 1cd188799f
From: |
Andrea Corallo |
Subject: |
Re: make check error in native compiler resulting from commit 1cd188799f86bcb13ad76e82e3436b1b7e9f9e9f on 2021-12-30. |
Date: |
Tue, 01 Feb 2022 17:47:21 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Alan Mackenzie <acm@muc.de> writes:
> Hello, Andrea.
>
> In that patch, I made the following change so that a comparison
> involving Qnil would not go through the (newly) expensive emit_EQ:
>
> diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
> index 0a10505257..8581fe8066 100644
> --- a/lisp/emacs-lisp/comp.el
> +++ b/lisp/emacs-lisp/comp.el
> @@ -1829,9 +1829,7 @@ comp-limplify-lap-inst
> (byte-listp auto)
> (byte-eq auto)
> (byte-memq auto)
> - (byte-not
> - (comp-emit-set-call (comp-call 'eq (comp-slot-n (comp-sp))
> - (make-comp-mvar :constant nil))))
> + (byte-not null)
> (byte-car auto)
> (byte-cdr auto)
> (byte-cons auto)
>
> .. Since then, there has been a mismatch in
> test/lisp/emacs-lisp/comp-tests.log, comp-tests-ret-type-spec-55, where
> the returned ret-type has now become t, whereas previously it was (not
> integer).
>
> I don't really understand what ret-type is. The mismatch between what
> this ret-type "should" be, and what it now is doesn't seem to be causing
> any problems. Would you please say whether this is, in fact, true.
> Would you also please advise on the best way to fix this bug in make
> check.
Hi Alan,
ret-type is the return type of the function that the forward propagation
engine tries to compute.
============
(defun foo (x)
(unless (integerp x)
x))
(native-compile #'foo)
(subr-type (symbol-function #'foo))
=>
(function (t) (not integer))
;; OR
(subr-type (native-compile '(λ (x)
(unless (integerp x)
x))))
=>
(function (t) (not integer))
==========
Those two are probably now returning just:
(function (t) t)
I guess the fix should be around `comp-add-cond-cstrs' or
`comp-add-cond-cstrs-simple'. I'll try to have a look later or tomorrow
(unless you are so curious you like to take the task ;)
Thanks!
Andrea