OSDN Git Service

Subzero: Always be sure x87 FP stack is emptied after a call.
authorJim Stichnoth <stichnot@chromium.org>
Fri, 12 Sep 2014 20:06:09 +0000 (13:06 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Fri, 12 Sep 2014 20:06:09 +0000 (13:06 -0700)
commita522972b9249eedd733a1c34b7c0117811d111d7
treea3b971c5639aeb554a256af13b5f64765a5f241b
parent1eb3a55dd9a08ceffe545b144a3be9ba63955035
Subzero: Always be sure x87 FP stack is emptied after a call.

In x86-32, floating point values are returned to the caller on the top of the x87 floating point stack.  The caller is required to remove it from the x87 FP stack, e.g. via the fstp instruction.

This must be done even when the return value is not actually used anywhere else in the function, in which case O2 is likely to want to dead-code eliminate the fstp instruction.

We enforce this by adding a fake use of the fstp destination.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/563303003
src/IceTargetLoweringX8632.cpp
tests_lit/llvm2ice_tests/fpcall.ll [new file with mode: 0644]