Skip to content

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

Closed
jsonn opened this issue Aug 16, 2012 · 2 comments
Closed

Stack overflow in -basicaa #13993

jsonn opened this issue Aug 16, 2012 · 2 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@jsonn
Copy link
Contributor

jsonn commented Aug 16, 2012

Bugzilla Link 13621
Resolution FIXED
Resolved on Aug 17, 2012 09:16
Version trunk
OS Linux
Attachments Test case
CC @d0k,@DimitryAndric

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.

@DimitryAndric
Copy link
Collaborator

Bisecting shows that r158919 makes this particular testcase start crashing with a stack overflow. The revision just before that is still OK.

@d0k
Copy link
Member

d0k commented Aug 17, 2012

Fixed in r162098.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
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
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants