From 6f3570cd4a615caa02c3d86320049a5631ab9b25 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 18 Dec 2020 18:37:16 +0100 Subject: Fix value type inference for doubly negate constraints * lisp/emacs-lisp/comp.el (comp-fwprop-insn): Do not propagate in case of double negation. * test/src/comp-test-funcs.el (comp-test-assume-double-neg-f): New function. * test/src/comp-tests.el (assume-double-neg): New test. --- lisp/emacs-lisp/comp.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/comp.el') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 5d2f8d412fe..895e1ac33e4 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2530,7 +2530,9 @@ Fold the call in case." (and (apply #'comp-cstr-intersection lval operands)) (not - (comp-cstr-negation lval (car operands))))) + ;; Prevent double negation! + (unless (comp-cstr-neg (car operands)) + (comp-cstr-negation lval (car operands)))))) (`(setimm ,lval ,v) (setf (comp-mvar-value lval) v)) (`(phi ,lval . ,rest) -- cgit v1.2.3