1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

fix comp-emit-cond-jump

This commit is contained in:
Andrea Corallo 2019-07-21 09:48:52 +02:00 committed by Andrea Corallo
parent 6e1e1bdc2c
commit e25cf44115

View file

@ -338,24 +338,24 @@ If DST-N is specified use it otherwise assume it to be the current slot."
(comp-emit `(block ,block-name))
(setf (comp-limplify-block-name comp-pass) block-name)))
(defun comp-emit-cond-jump (discard-n lap-label negated)
(defun comp-emit-cond-jump (target-offset lap-label negated)
"Emit a conditional jump to LAP-LABEL.
Discard DISCARD-N slots afterward.
TARGET-OFFSET is the positive offset on the SP when branching to the target
block.
If NEGATED non nil negate the test condition."
(let ((bb (comp-new-block-sym))
(blocks (comp-func-blocks comp-func)))
(let ((blocks (comp-func-blocks comp-func))
(bb (comp-new-block-sym))) ;; Fall through block
(puthash bb
(make-comp-block :sp (- (comp-sp) discard-n))
(make-comp-block :sp (comp-sp))
blocks)
(progn
(let ((target (comp-lap-to-limple-bb lap-label)))
(comp-emit (if negated
(list 'cond-jump (comp-slot-next) target bb)
(list 'cond-jump (comp-slot-next) bb target)))
(puthash target
(make-comp-block :sp (comp-sp))
blocks)
(comp-mark-block-closed)))
(let ((target (comp-lap-to-limple-bb lap-label)))
(comp-emit (if negated
(list 'cond-jump (comp-slot-next) target bb)
(list 'cond-jump (comp-slot-next) bb target)))
(puthash target
(make-comp-block :sp (+ target-offset (comp-sp)))
blocks)
(comp-mark-block-closed))
(comp-emit-block bb)))
(defun comp-stack-adjust (n)