Home > Software engineering >  How to disable LLVM optimisations for rust in Godbolt (for asm education purposes)
How to disable LLVM optimisations for rust in Godbolt (for asm education purposes)

Time:06-11

I am learning about rust and asm, and using godbolt for this.

I have a program that looks like:

pub fn test() -> i32 {
    let a = 1;
    let b = 2;
    let c = 3;
    a   b   c
}

And I would expect the output to look something like

example::test:
        subq    $16, %rsp
        movl    $1, (%rsp)
        movl    $2, 4(%rsp)
        movl    $3, 8(%rsp)
        movl    (%rsp),            
  • Related