https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85822
Bug ID: 85822
Summary: [8/9 Regression] Maybe wrong code in VRP since r249150
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org, ygribov at gcc dot gnu.org
Target Milestone: ---
I've saw that in qtscript, isolated test-case looks as follows:
$ cat vrp.c
static const long int TagTypeNumber = 0xffff000000000000ll;
long int x;
void foo(void)
{
x = TagTypeNumber + 1;
}
int main(int argc, char **argv)
{
if (argc > 0)
foo ();
if ((x & TagTypeNumber) == TagTypeNumber)
{
unsigned y = (unsigned)x;
__builtin_printf ("v: %u\n", y);
if (y != 1)
__builtin_abort ();
}
return 0;
}
$ gcc -O2 vrp.c && ./a.out
v: 0
Aborted (core dumped)
$