Look for left-over dead code when *check-consistency*
[sbcl.git] / src / compiler / main.lisp
index 1223388..1bec50e 100644 (file)
@@ -526,6 +526,13 @@ Examples:
         (return))
       (incf loop-count)))
 
+  (when *check-consistency*
+    (do-blocks-backwards (block component)
+      (awhen (flush-dead-code block)
+        (let ((*compiler-error-context* it))
+          (compiler-warn "dead code detected at the end of ~S"
+                         'ir1-phases)))))
+
   (ir1-finalize component)
   (values))