This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/78819] New: [7 Regression] Wrong code with VRP caused by register assertions along default switch labels
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Dec 2016 10:42:37 +0000
- Subject: [Bug tree-optimization/78819] New: [7 Regression] Wrong code with VRP caused by register assertions along default switch labels
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78819
Bug ID: 78819
Summary: [7 Regression] Wrong code with VRP caused by register
assertions along default switch labels
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: ppalka at gcc dot gnu.org
Target Milestone: ---
Started with r238761, following test-case behaves wrongly:
$ cat /tmp/testcase.c
#include <stdio.h>
#include <stdlib.h>
int main(unsigned argc, char **argv)
{
if (argc <= 0)
return 0;
if (argc > 3)
return 0;
switch (argc)
{
case 1:
case 3:
fprintf (stderr, "value: %d\n", argc);
break;
case 2:
fprintf (stderr, "value: %d\n", argc);
break;
default:
abort();
}
return 1;
}
$ ./xgcc -B. /tmp/testcase.c -O0 -fdump-tree-optimized && ./a.out 1 1
value: 3
$ ./xgcc -B. /tmp/testcase.c -O2 -fdump-tree-optimized && ./a.out 1 1
value: 1
This miscompilation is detected by Python-2.7.12 package, that fails in
test_epoll test-case.
Thanks,
Martin