sparc: Avoid clobbering register parameters in syscall
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 10 Feb 2020 15:57:28 +0000 (12:57 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Sat, 15 Feb 2020 00:09:12 +0000 (21:09 -0300)
commitc261718b3fda4b629ee120f48e3ee50db9c793a1
tree19718fdf52ec2ac41630516cae15e137174a7b49
parent86c5d2cf0ce046279baddc7faa27da71f1a89fde
sparc: Avoid clobbering register parameters in syscall

The sparc INTERNAL_SYSCALL macro might clobber the register
parameter if the argument itself might clobber any register (a function
call for instance).

This patch fixes it by using temporary variables for the expressions
between the register assignments (as indicated by GCC documentation,
6.47.5.2 Specifying Registers for Local Variables).

It is similar to the fix done for MIPS (bug 25523).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
sysdeps/unix/sysv/linux/sparc/sysdep.h