Skip to content

C goto loops are optimized out in LLVM versions ABOVE 12 #149675

@gkgoat1

Description

@gkgoat1

Resurgence of old bug 965 within C loops made with goto statements. Since they aren't iteration statements, they should not be affected and should not be required to progress. This bug has existed since at least Clang 20, possibly stretching back to Clang 12. This should not cause problems with Rust code, but their team probably should be contacted anyway

this C source reproduces, on latest Clang

This is a miscompilation, but usually comes up in compiler outputs, not hand-written source; Rust, Zig, and modern LLVM languages should not be affected as they never set any progress attributes. (C++ faces this issue only in extern "C" function definitions, which are rarely compiled to)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions