Skip to content

[DebugInfo] Line 0 record not inserted before prologue moved via shrinkwrap optimisation #157887

@Heath123

Description

@Heath123

In the following code:
https://godbolt.org/z/hh4aYGbr7
in this snippet:

        .loc    1 14 1
        ret
.LBB0_1:
        push    r15
        .cfi_def_cfa_offset 16
        push    r14
        .cfi_def_cfa_offset 24
        push    rbx
        .cfi_def_cfa_offset 32
        .cfi_offset rbx, -32
        .cfi_offset r14, -24
        .cfi_offset r15, -16
        xor     ebx, ebx
        lea     r14, [rip + .Lstr.2]
        lea     r15, [rip + .Lstr]
.Ltmp3:
        .loc    1 0 1 is_stmt 0

there is a location directive inserted into the assembly that points to the end of the function, used for the ret instruction. However, no line 0 directive is inserted before the generated prologue code, meaning the last directive of line 14 continues to apply. This means that the prologue is incorrectly assigned to line 14.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions