Skip to content

Debug location mismatch after argument promotion pass #129503

Open
@afikcohen1

Description

@afikcohen1

When ArgumentPromotionPass optimizes a function, it changes some arguments to be passed by value instead of by pointer or reference. As part of this optimization, it creates a load instruction before the function call and removes the original load inside the function. However, the debug location of the new load instruction is incorrectly set to the location of the call instruction, instead of the original load inside the function. This results in incorrect debug information and makes it harder to trace the source code during debugging.

https://godbolt.org/z/7d969doK6

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