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 #17 received at 46540 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 46540 <at> debbugs.gnu.org, qythium <at> gmail.com
Subject: Re: bug#46540: 28.0.50; Native-comp optimization bug
Date: Wed, 17 Feb 2021 07:50:00 +0000
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).




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

Previous Next


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