Skip to content

Incorrect optimization in code fragment #18786

Closed
@nstoddard

Description

@nstoddard

I found some code that behaves differently with optimization. With -O0, it prints false; with any higher setting, it prints true.

Sorry about the poor variable names; this is (mostly) a translation from some Javascript code. I've tried to remove as much code as I can, but I'm sure it can still be reduced somewhat and still show the same incorrect behavior.

Edit: the old code sample linked to 'hello world' for some reason. I fixed it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions