Skip to content

Failure to optimize out redundant compare #45505

@GabrielRavier

Description

@GabrielRavier
Bugzilla Link 46160
Version trunk
OS Linux
CC @RKSimon,@rotateright

Extended Description

bool f(int a, int b, int c)
{
return (a == b) && (b == c) && (a == c);
}

This can be optimized to return (a == b) && (a == c);. GCC does this transformation, but LLVM does not.

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