summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-12-18 18:37:16 +0100
committerAndrea Corallo <akrl@sdf.org>2020-12-21 20:22:03 +0100
commit6f3570cd4a615caa02c3d86320049a5631ab9b25 (patch)
tree27bab0576314c686aba381a461bb9436f9261082 /lisp/emacs-lisp/comp.el
parent9bbe6eab6c160a454f2705c00ff3aea7f0c6e6c1 (diff)
downloademacs-6f3570cd4a615caa02c3d86320049a5631ab9b25.tar.gz
emacs-6f3570cd4a615caa02c3d86320049a5631ab9b25.tar.bz2
emacs-6f3570cd4a615caa02c3d86320049a5631ab9b25.zip
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.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el4
1 files changed, 3 insertions, 1 deletions
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)