Add 1+ 1- integer range propagation support
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-one): New special var. * lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate integer ranges on +1 -1. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests.
This commit is contained in:
parent
7d07a71841
commit
42fb6de0b3
3 changed files with 20 additions and 2 deletions
|
@ -2651,7 +2651,9 @@ Fold the call in case."
|
|||
(comp-mvar-neg lval) (comp-cstr-neg cstr))))
|
||||
(cl-case f
|
||||
(+ (comp-cstr-add lval args))
|
||||
(- (comp-cstr-sub lval args)))))
|
||||
(- (comp-cstr-sub lval args))
|
||||
(1+ (comp-cstr-add lval `(,(car args) ,comp-cstr-one)))
|
||||
(1- (comp-cstr-sub lval `(,(car args) ,comp-cstr-one))))))
|
||||
|
||||
(defun comp-fwprop-insn (insn)
|
||||
"Propagate within INSN."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue