summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/OptimizeInstructions.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 5eba1e3b9..23a63646e 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -2805,7 +2805,11 @@ private:
// (Y)
// )
// )
- if (curr->type != Type::unreachable) {
+ //
+ // Ignore unreachable code here; leave that for DCE.
+ if (curr->type != Type::unreachable &&
+ curr->ifTrue->type != Type::unreachable &&
+ curr->ifFalse->type != Type::unreachable) {
Unary* un;
Expression* x;
Const* c;