Commit 1697db0c authored by yangguo@chromium.org's avatar yangguo@chromium.org

Add clobber list to arm inline asm.

While enabling "-fstack-protector", compiler generates code in
function prologue and epilogue to do stack check. However, without
knowing that 'r1', 'r2' and 'r3' is used/destroyed in inline asm,
compiler assumes that 'r1', 'r2', or 'r3' can be used exclusively,
which leads to a core dump.

Fix to this is quite straightforward, just add clobber list to the
inlineasm.

BUG=None
TEST=manually checked the generated asm code,boot up chrome browser successfully with this modification

Review URL: https://chromiumcodereview.appspot.com/9618017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6dd05d9b
...@@ -187,15 +187,15 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { ...@@ -187,15 +187,15 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) {
// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then // pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then
// calling this will return 1.0 and otherwise 0.0. // calling this will return 1.0 and otherwise 0.0.
static void ArmUsingHardFloatHelper() { static void ArmUsingHardFloatHelper() {
asm("mov r0, #0"); asm("mov r0, #0":::"r0");
#if defined(__VFP_FP__) && !defined(__SOFTFP__) #if defined(__VFP_FP__) && !defined(__SOFTFP__)
// Load 0x3ff00000 into r1 using instructions available in both ARM // Load 0x3ff00000 into r1 using instructions available in both ARM
// and Thumb mode. // and Thumb mode.
asm("mov r1, #3"); asm("mov r1, #3":::"r1");
asm("mov r2, #255"); asm("mov r2, #255":::"r2");
asm("lsl r1, r1, #8"); asm("lsl r1, r1, #8":::"r1");
asm("orr r1, r1, r2"); asm("orr r1, r1, r2":::"r1");
asm("lsl r1, r1, #20"); asm("lsl r1, r1, #20":::"r1");
// For vmov d0, r0, r1 use ARM mode. // For vmov d0, r0, r1 use ARM mode.
#ifdef __thumb__ #ifdef __thumb__
asm volatile( asm volatile(
...@@ -209,12 +209,12 @@ static void ArmUsingHardFloatHelper() { ...@@ -209,12 +209,12 @@ static void ArmUsingHardFloatHelper() {
" adr r3, 2f+1 \n\t" " adr r3, 2f+1 \n\t"
" bx r3 \n\t" " bx r3 \n\t"
" .THUMB \n" " .THUMB \n"
"2: \n\t"); "2: \n\t":::"r3");
#else #else
asm("vmov d0, r0, r1"); asm("vmov d0, r0, r1");
#endif // __thumb__ #endif // __thumb__
#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) #endif // defined(__VFP_FP__) && !defined(__SOFTFP__)
asm("mov r1, #0"); asm("mov r1, #0":::"r1");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment