https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121264
Bug ID: 121264
Summary: ifcombine wrong code
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: kristerw at gcc dot gnu.org
Target Milestone: ---
The following program (from testsuite/gcc.c-torture/compile/pr103813.c) is
miscompiled for x86_64 with -O1 or higher optimization levels.
struct A { char b; char c[0x21000000]; };
struct A d;
int
foo ()
{
return d.c[0x20000000] || d.c[1];
}
Ifcombine transforms this into the equivalent of
return d.c[1] != 0;