microblaze: Avoid clobbering register parameters in syscall
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 10 Feb 2020 13:19:29 +0000 (10:19 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Sat, 15 Feb 2020 00:09:12 +0000 (21:09 -0300)
commit6cc8fc7c1506e8084d65b078ff5b05a92e17a28a
tree45408781cacf7d24634caa7999d0d55d3a2d1242
parent861be5fd6601bed58b63ae0eb23097abf1ac0e1c
microblaze: Avoid clobbering register parameters in syscall

The microblaze 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 with microblaze-linux-gnu and microblazeel-linux-gnu build.
sysdeps/unix/sysv/linux/microblaze/sysdep.h