Skip to content

u <= (u <= (unsigned)b) can be folded into (u <= (unsigned)b) #132508

@k-arrows

Description

@k-arrows

Consider the following test case which is taken from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119422.
https://godbolt.org/z/feoGYh15d
https://alive2.llvm.org/ce/z/AjmXuN

int src(unsigned u, bool b)
{
  return u <= (u <= (unsigned)b);
}

int tgt(unsigned u, bool b)
{
  return u <= (unsigned)b;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions