Skip to content

Epilogue instructions don't set SourceLoc to return inst SourceLoc #1145

@bjorn3

Description

@bjorn3
  • What are the steps to reproduce the issue?

    test compile
    target x86_64
    
    function u0:0() system_v {
    ebb0:
    nop
    @0001 return
    }
    
  • What do you expect to happen? What does actually happen? Does it panic, and
    if so, with which assertion?

    test compile
    target x86_64
    function u0:0(i64 fp [%rbp]) -> i64 fp [%rbp] system_v {
        ss0 = incoming_arg 16, offset -16
    
                                    ebb0(v4: i64 [%rbp]):
    [RexOp1pushq#50]                    x86_push v4
    [RexOp1copysp#8089]                 copy_special %rsp -> %rbp
    [-]                                 nop
    [RexOp1popq#58,%rbp]                v5 = x86_pop.i64 ; <-- this should use @0001 as srcloc
    @0001 [Op1ret#c3]                   return v5
    }
    

    This causes debuggers to switch between function start and end as current position with cg_clif generated executables when returning from a function.

  • Which Cranelift version / commit hash / branch are you using? 387593d

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions