OSDN Git Service

Made art/runtime/arch/stub_test.cc compile with -O2 again.
authorBilyan Borisov <bilyan.borisov@linaro.org>
Wed, 10 Feb 2016 11:51:17 +0000 (11:51 +0000)
committerBilyan Borisov <bilyan.borisov@linaro.org>
Wed, 24 Feb 2016 14:49:55 +0000 (14:49 +0000)
commit970e19164326d93947441f9f0c2c754225dfb6e8
tree2829252b919888076014bf727d396722b1c5a9dd
parentd15ede2df7d157ea5480614fd18c2bf0d37a6c2a
Made art/runtime/arch/stub_test.cc compile with -O2 again.

The test file art/runtime/arch/stub_test.cc wasn't compiling with -O2
as the optimisations interacted with -fstack-protector-strong. The
aarch64 _asm_ block in the Invoke3WithReferrerAndHidden function was
clobbering all possible registers, and clang requires at least one
register to be live across an _asm_ block to do the checking.

The fix was to remove a callee-saved register, x20, from the clobber
list of the aarch64 asm block of Invoke3WithReferrerAndHidden. The
block was also modified to save and restore x20 to ensure that it
won't be clobbered by the stubs invoked by the blr instruction. Also
added some comments above the clobber list.

Change-Id: I03597fd2d14cf2d6e32edf02835aee2eb68bab17
build/Android.gtest.mk
runtime/arch/stub_test.cc