Index: src/IceTargetLoweringX86BaseImpl.h |
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
index 6cc0a491981474d1e72e828a0408bad59bf2cc36..1bddc51cc0245e1897e57db5b7b2bf7e76b17384 100644 |
--- a/src/IceTargetLoweringX86BaseImpl.h |
+++ b/src/IceTargetLoweringX86BaseImpl.h |
@@ -5199,6 +5199,9 @@ template <class Machine> |
void TargetX86Base<Machine>::lowerUnreachable( |
const InstUnreachable * /*Inst*/) { |
_ud2(); |
+ // Add a fake use of esp to make sure esp adjustments after the unreachable |
+ // do not get dead-code eliminated. |
+ keepEspLiveAtExit(); |
} |
template <class Machine> |