https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81063
Bug ID: 81063
Summary: wrong code at -O1 and above on x86_64-linux-gnu
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
This appears to be a very recent regression.
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20170611 (experimental) [trunk revision 249105] (GCC)
$
$ gcc-trunk -O0 small.c; ./a.out
$
$ gcc-trunk -O1 small.c
$ ./a.out
Aborted (core dumped)
$
---------------------------------
struct A
{
int b;
int c:2;
};
struct B
{
int e;
struct A f;
} g = {0, {0, 1}}, j;
struct A *h = &g.f;
int main ()
{
struct A k;
struct B l = j, i = l;
if (!i.f.b)
k = i.f;
*h = k;
if (g.f.c != 0)
__builtin_abort ();
return 0;
}