diff options
author | Fei Gao <gaofei@eswincomputing.com> | 2023-06-03 11:11:18 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-06-03 11:11:18 -0600 |
commit | 5681872057f0b725ec8a7c8a1eec8fee205ad673 (patch) | |
tree | 83ea71ca533b1a59dc4523148004d182659e34b4 /libgcc | |
parent | e1d2493f5912c340b50f49e4c2d928870faa172b (diff) | |
download | gcc-5681872057f0b725ec8a7c8a1eec8fee205ad673.zip gcc-5681872057f0b725ec8a7c8a1eec8fee205ad673.tar.gz gcc-5681872057f0b725ec8a7c8a1eec8fee205ad673.tar.bz2 |
[RISC-V] fix cfi issue in save-restore.
This patch fixes a cfi issue introduced by
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=60524be1e3929d83e15fceac6e2aa053c8a6fb20
Test code:
char my_getchar();
float getf();
int test_f0()
{
int s0 = my_getchar();
float f0 = getf();
int b = my_getchar();
return f0+s0+b;
}
cflags: -g -Os -march=rv32imafc -mabi=ilp32f -msave-restore -mcmodel=medlow
before patch:
test_f0:
...
.cfi_startproc
call t0,__riscv_save_1
.cfi_offset 8, -8
.cfi_offset 1, -4
.cfi_def_cfa_offset 16
...
addi sp,sp,-16
.cfi_def_cfa_offset 32
...
addi sp,sp,16
.cfi_def_cfa_offset 0 // issue here
...
tail __riscv_restore_1
.cfi_restore 8
.cfi_restore 1
.cfi_def_cfa_offset -16 // issue here
.cfi_endproc
after patch:
test_f0:
...
.cfi_startproc
call t0,__riscv_save_1
.cfi_offset 8, -8
.cfi_offset 1, -4
.cfi_def_cfa_offset 16
...
addi sp,sp,-16
.cfi_def_cfa_offset 32
...
addi sp,sp,16
.cfi_def_cfa_offset 16 // corrected here
...
tail __riscv_restore_1
.cfi_restore 8
.cfi_restore 1
.cfi_def_cfa_offset 0 // corrected here
.cfi_endproc
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_expand_epilogue): fix cfi issue with
correct offset.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions