GNU bug report logs - #46540
28.0.50; Native-comp optimization bug

Previous Next

Package: emacs;

Reported by: Yu Han Quek <qythium <at> gmail.com>

Date: Mon, 15 Feb 2021 19:20: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


Message #20 received at 46540 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: qythium <at> gmail.com
Cc: 46540 <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
Subject: Re: bug#46540: 28.0.50; Native-comp optimization bug
Date: Wed, 17 Feb 2021 21:11:53 +0000
Pip Cet <pipcet <at> gmail.com> writes:

> On Tue, Feb 16, 2021 at 9:44 PM Andrea Corallo wrote:
>> The following constrain insn clearly resolves in the wrong way:
>>
>> (assume #(mvar 79140560 0 (integer 0 0)) (<= #(mvar 79118120 0 (integer 0 *)) #(mvar 79118988 3 (integer 0 *))))
>>
>> Will come-up with a fix.
>
> My guess is that this code in comp-cstr.el:
>
> (defun comp-cstr-<= (dst old-dst src)
>   "Constraint DST being <= than SRC.
> SRC can be either a comp-cstr or an integer."
>   (with-comp-cstr-accessors
>     (let ((ext-range
>            (if (integerp src)
>                `((- . ,src))
>              (when-let* ((range (range src))
>                          (low (comp-cstr-smallest-in-range range))
>                          (okay (integerp low)))
>                `((- . ,low))))))
>       (comp-cstr-set-cmp-range dst old-dst ext-range))))
>
> should use comp-cstr-greatest-in-range rather than
> comp-cstr-smallest-in-range. Same for comp-cstr-<. Analogous for
> comp-cstr->, comp-cstr->=.
>
> (If A's possible values are {3, 4, 5}, and B is <= A, we can only
> conclude B <= 5, not that B <= 3, since A = 5, B = 5 is a solution to
> the constraint problem).

Yep, Pip spot on.  Small oversight from me... :D

1fe5994bcb should fix.

Yu Han Quek would you mind to confirm rx now works as excpected for you?

Thanks

  Andrea




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

Previous Next


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