Closed Xinlong-Wu closed 2 years ago
I have mat a Segmentation fault error when run an progrem compiled by Clang.
Segmentation fault
Repo: plctlab/llvm-project Branch: riscv-zce-llvm14 Commit: ab680c08bc0e2a6705e85f80f27b6efc080521e3
riscv-zce-llvm14
ab680c08bc0e2a6705e85f80f27b6efc080521e3
Repo: plctlab/plct-spike/ Branch: plct-zce-dev Commit: 7f3e9e9165a8de35523c56737c1a12444ddd30d0
plct-zce-dev
7f3e9e9165a8de35523c56737c1a12444ddd30d0
int test(){ int c = 63; int a = 6; int b = a * c * 30; return b; } int main(int argc, char const *argv[]) { char x=-1; int a = 1; int b = 2; int result = test(); return 0; }
clang --target=riscv64 -march=rv64imac -mzce-push-pop --gcc-toolchain=$HOME/opt/riscv -fuse-ld=lld hello.c spike -l --isa=rv64imaczce $(which pk) a.out
clang --target=riscv64 -march=rv64imac -mzce-push-pop --gcc-toolchain=$HOME/opt/riscv -fuse-ld=lld hello.c
spike -l --isa=rv64imaczce $(which pk) a.out
the log of spike shows that spike Segmentation fault after dumping instruction pop {ra, s0}, {}, 32 (seems this code is epilog of founction test())
pop {ra, s0}, {}, 32
test()
relative files is here: spike#8
RA register is pushed or poped twice time in previous implementation. I have fixed it. You can try again.
I have mat a
Segmentation fault
error when run an progrem compiled by Clang.Clang Verision:
Repo: plctlab/llvm-project Branch:
riscv-zce-llvm14
Commit:ab680c08bc0e2a6705e85f80f27b6efc080521e3
Spike Verision:
Repo: plctlab/plct-spike/ Branch:
plct-zce-dev
Commit:7f3e9e9165a8de35523c56737c1a12444ddd30d0
Progrem Sorece code
Command Line
clang --target=riscv64 -march=rv64imac -mzce-push-pop --gcc-toolchain=$HOME/opt/riscv -fuse-ld=lld hello.c
spike -l --isa=rv64imaczce $(which pk) a.out
the log of spike shows that spike
Segmentation fault
after dumping instructionpop {ra, s0}, {}, 32
(seems this code is epilog of founctiontest()
)relative files is here: spike#8