Fix unreachable blocks removing
authorDavid Vázquez <davazp@gmail.com>
Mon, 20 May 2013 11:25:00 +0000 (12:25 +0100)
committerDavid Vázquez <davazp@gmail.com>
Mon, 20 May 2013 11:25:00 +0000 (12:25 +0100)
experimental/compiler.lisp

index ed326cb..3a22657 100644 (file)
         ;; one, then break the link between them. So we discard it
         ;; from the flowgraph.
         ((eq (block-data block) 'unreachable)
         ;; one, then break the link between them. So we discard it
         ;; from the flowgraph.
         ((eq (block-data block) 'unreachable)
-         (setf (block-succ block) nil)
          (dolist (succ (block-succ block))
            (when (eq (block-data succ) 'reachable)
          (dolist (succ (block-succ block))
            (when (eq (block-data succ) 'reachable)
-             (remove block (block-pred succ)))))
+             (setf (block-pred succ) (remove block (block-pred succ)))))
+         (setf (block-succ block) nil))
         ;; Delete empty blocks
         ((and (empty-block-p block)
               (not (boundary-block-p block))
         ;; Delete empty blocks
         ((and (empty-block-p block)
               (not (boundary-block-p block))