]> git.eshelyaron.com Git - emacs.git/commitdiff
do not override existing basic blocks when branching backwards!
authorAndrea Corallo <akrl@sdf.org>
Sun, 8 Sep 2019 19:42:51 +0000 (21:42 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:46 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 0770d32f7a1ead766a93e9ca9b8929ffe3b70ab6..c398810186dcdfa07e54ee4a560b81ff370b6cd3 100644 (file)
@@ -500,9 +500,11 @@ If NEGATED non nil negate the tested condition."
       (comp-emit (if negated
                     (list 'cond-jump a b target bb)
                   (list 'cond-jump a b bb target)))
-      (puthash target
-              (make-comp-block :sp (+ target-offset (comp-sp)))
-              blocks)
+      (unless (gethash target blocks)
+        ;; Create the bb target only if does not exixsts already.
+        (puthash target
+                (make-comp-block :sp (+ target-offset (comp-sp)))
+                blocks))
       (comp-mark-block-closed))
     (comp-emit-block bb)))