https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125790
Bug ID: 125790
Summary: Wrong code for `(~x) >> (unsigned int)x`
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: kristerw at gcc dot gnu.org
Blocks: 118443
Target Milestone: ---
The test below fails on x86_64 when compiled with -O1:
long
f(long x)
{
return (~x) >> (unsigned int)x;
}
int
main(void)
{
if (f(0xffffffff0000003fL) != 0)
__builtin_abort();
return 0;
}
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118443
[Bug 118443] [Meta bug] Bugs triggered by and blocking more smtgcc testing