[riscv-port] Integrated: 8276989: riscv: C1 should not allocate x3, which is the gp register

zhengxiaolinX duke at openjdk.java.net
Mon Nov 15 09:28:59 UTC 2021


On Thu, 11 Nov 2021 09:28:13 GMT, zhengxiaolinX <duke at openjdk.java.net> wrote:

> Hi team,
> 
> x3 is a special register on RISCV and we should not use it as a register allocation candidate - if users write JNI programs referencing global variables, where ld could link global reference loading logic to an instruction like 'ld $Rtmp, $offset(x3)', and try to call vm functions, C1 will zap x3's value and causes a crash. It seems C2 doesn't use x3 so we are just aligning the logic with C2 properly.
> 
> Thanks,
> Xiaolin

This pull request has now been integrated.

Changeset: 7a735ca6
Author:    yunyao.zxl <yunyao.zxl at alibaba-inc.com>
Committer: Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.java.net/riscv-port/commit/7a735ca64c767079caca852aef9959c2e072770f
Stats:     8 lines in 3 files changed: 2 ins; 3 del; 3 mod

8276989: riscv: C1 should not allocate x3, which is the gp register

Reviewed-by: fyang, shade

-------------

PR: https://git.openjdk.java.net/riscv-port/pull/3


More information about the riscv-port-dev mailing list