https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93781
Bug ID: 93781
Summary: Optimizer produces suboptimal code related to
-ftree-vrp
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zhongyunde at huawei dot com
Target Milestone: ---
For the following code, we can known the value C000003FE is always less then 5,
so the return value should be true.
test base on the x86-64 gcc 9.2 on https://gcc.godbolt.org/, so get complicated
assemble.
unsigned int foo (unsigned int arg)
{
int C00000400 = arg - 3;
unsigned int C000003FE = 4;
int C000003FF = 0x1 << arg;
if (C00000400 < 0)
C000003FE = C000003FF;
return C000003FE < 5;
}