Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 563303003: Subzero: Always be sure x87 FP stack is emptied after a call. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fpcall.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index d1fdfc2f97868dcd9f11a6a5b76ca0396912d65c..0beb311e56e0ef690701a6fbb1125dbd14ccd3d0 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -1900,9 +1900,12 @@ void TargetX8632::lowerCall(const InstCall *Instr) {
} else if (Dest->getType() == IceType_f32 || Dest->getType() == IceType_f64) {
// Special treatment for an FP function which returns its result in
// st(0).
- _fstp(Dest);
// If Dest ends up being a physical xmm register, the fstp emit code
// will route st(0) through a temporary stack slot.
+ _fstp(Dest);
+ // Create a fake use of Dest in case it actually isn't used,
+ // because st(0) still needs to be popped.
+ Context.insert(InstFakeUse::create(Func, Dest));
}
}
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/fpcall.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698