-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Stack overflow in -basicaa #13993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bugzilla
Issues migrated from bugzilla
Comments
Bisecting shows that r158919 makes this particular testcase start crashing with a stack overflow. The revision just before that is still OK. |
Fixed in r162098. |
djtodoro
pushed a commit
to djtodoro/llvm-project
that referenced
this issue
Apr 24, 2025
$ cat test.s // llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -show-inst // llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -filetype=obj -o test.o // llvm-objdump -d --mattr=+Xsecure test.o .text .globl _start _start: # Test the new instructions: openstealth.rol x5, x6, x7 openstealth.ror x5, x6, x7 openstealth.rori x5, x6, 13 # Return or jump to an infinite loop to avoid crashing ret $ llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -show-inst .text .globl _start _start: openstealth.rol t0, t1, t2 # <MCInst llvm#13993 XSECURE_ROL # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Reg:50>> openstealth.ror t0, t1, t2 # <MCInst llvm#13994 XSECURE_ROR # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Reg:50>> openstealth.rori t0, t1, 13 # <MCInst llvm#13995 XSECURE_RORI # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Imm:13>> ret # <MCInst llvm#12777 JALR # <MCOperand Reg:43> # <MCOperand Reg:44> # <MCOperand Imm:0>> $ llvm-objdump -d --mattr=+Xsecure test.o test.o: file format elf32-littleriscv Disassembly of section .text: 00000000 <_start>: 0: 607312b3 openstealth.rol t0, t1, t2 4: 607352b3 openstealth.ror t0, t1, t2 8: 60d35293 openstealth.rori t0, t1, 0xd c: 00008067 ret
djtodoro
pushed a commit
to djtodoro/llvm-project
that referenced
this issue
Apr 24, 2025
$ cat test.s // llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -show-inst // llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -filetype=obj -o test.o // llvm-objdump -d --mattr=+Xsecure test.o .text .globl _start _start: # Test the new instructions: openstealth.rol x5, x6, x7 openstealth.ror x5, x6, x7 openstealth.rori x5, x6, 13 # Return or jump to an infinite loop to avoid crashing ret $ llvm-mc -triple=riscv32 -mattr=+Xsecure test.s -show-inst .text .globl _start _start: openstealth.rol t0, t1, t2 # <MCInst llvm#13993 XSECURE_ROL # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Reg:50>> openstealth.ror t0, t1, t2 # <MCInst llvm#13994 XSECURE_ROR # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Reg:50>> openstealth.rori t0, t1, 13 # <MCInst llvm#13995 XSECURE_RORI # <MCOperand Reg:48> # <MCOperand Reg:49> # <MCOperand Imm:13>> ret # <MCInst llvm#12777 JALR # <MCOperand Reg:43> # <MCOperand Reg:44> # <MCOperand Imm:0>> $ llvm-objdump -d --mattr=+Xsecure test.o test.o: file format elf32-littleriscv Disassembly of section .text: 00000000 <_start>: 0: 607312b3 openstealth.rol t0, t1, t2 4: 607352b3 openstealth.ror t0, t1, t2 8: 60d35293 openstealth.rori t0, t1, 0xd c: 00008067 ret $ clang --target=riscv32 -mcpu=attorv32 test.s -c
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extended Description
Run the attached test case with -basicaa -loop-rotate -jump-threading -dse,
it should fall apart easily. Reduce stack size with ulimit -s might help.
The text was updated successfully, but these errors were encountered: