rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.52k stars 94 forks source link

Pass `preserve_frame_pointers` to Cranelift #1388

Closed Kobzol closed 11 months ago

Kobzol commented 11 months ago

I don't know how to test this :)

Closes: https://github.com/bjorn3/rustc_codegen_cranelift/issues/1246

bjorn3 commented 11 months ago

Thanks! I've confirmed this works for AArch64. Without -Cforce-frame-pointers I get:

00000000000027a4 <_ZN21mini_core_hello_world8take_f3217ha03ff4b464fa7475E>:
    27a4:       d65f03c0        ret

and with I get:

00000000000027bc <_ZN21mini_core_hello_world8take_f3217ha03ff4b464fa7475E>:
    27bc:       a9bf7bfd        stp     x29, x30, [sp, #-16]!
    27c0:       910003fd        mov     x29, sp
    27c4:       a8c17bfd        ldp     x29, x30, [sp], #16
    27c8:       d65f03c0        ret