diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-12-30 11:26:17 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-01-04 01:24:42 +0000 |
commit | 2ee2c6232c3cb7e2927b964701a81c1591c410db (patch) | |
tree | b577ef3de93df53b73f36e3e0ed766ca9590a6c5 /src/runtime/sys_linux_arm.s | |
parent | 9df93e4d6d31674ee9ca7725bcf9dea2423d4aea (diff) | |
download | go-2ee2c6232c3cb7e2927b964701a81c1591c410db.tar.gz go-2ee2c6232c3cb7e2927b964701a81c1591c410db.zip |
runtime: don't use R11 in nanotime1/walltime1 on ARM
R11 a.k.a. REGTMP is the temp register used by the assembler. It
may be clobbered if the assembler needs to synthesize
instructions. In particular, in nanotime1/walltime1, the load of
global variable runtime.iscgo clobbers it. So, avoid using R11
to hold a long-lived value.
Fixes #36309.
Change-Id: Iec2ab9d664532cad8fbf58da17f580e64a744f62
Reviewed-on: https://go-review.googlesource.com/c/go/+/212641
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Andrew G. Morgan <agm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_arm.s')
-rw-r--r-- | src/runtime/sys_linux_arm.s | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index 8908b1bf23..e103da56dc 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -269,8 +269,8 @@ noswitch: MOVW $CLOCK_REALTIME, R0 MOVW $8(R13), R1 // timespec - MOVW runtime·vdsoClockgettimeSym(SB), R11 - CMP $0, R11 + MOVW runtime·vdsoClockgettimeSym(SB), R2 + CMP $0, R2 B.EQ fallback // Store g on gsignal's stack, so if we receive a signal @@ -292,7 +292,7 @@ noswitch: MOVW (g_stack+stack_lo)(R6), R6 // g.m.gsignal.stack.lo MOVW g, (R6) - BL (R11) + BL (R2) MOVW $0, R1 MOVW R1, (R6) // clear g slot, R6 is unchanged by C code @@ -300,7 +300,7 @@ noswitch: JMP finish nosaveg: - BL (R11) + BL (R2) JMP finish fallback: @@ -347,8 +347,8 @@ noswitch: MOVW $CLOCK_MONOTONIC, R0 MOVW $8(R13), R1 // timespec - MOVW runtime·vdsoClockgettimeSym(SB), R11 - CMP $0, R11 + MOVW runtime·vdsoClockgettimeSym(SB), R2 + CMP $0, R2 B.EQ fallback // Store g on gsignal's stack, so if we receive a signal @@ -370,7 +370,7 @@ noswitch: MOVW (g_stack+stack_lo)(R6), R6 // g.m.gsignal.stack.lo MOVW g, (R6) - BL (R11) + BL (R2) MOVW $0, R1 MOVW R1, (R6) // clear g slot, R6 is unchanged by C code @@ -378,7 +378,7 @@ noswitch: JMP finish nosaveg: - BL (R11) + BL (R2) JMP finish fallback: |