Created attachment 42553 [details] Test-case which should succeed GCC Version: 6.4.0 Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-6.4.0/work/gcc-6.4.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.4.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.4.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/6.4.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/g++-v6 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/6.4.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 6.4.0 p1.0' --disable-esp --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp Flags: -O3 Failing Command: gcc -O3 test.c && ./a.out Compiling the attached source file and executing it results in an unexpected abort. Program should succeed silently.
*obj = (struct Example){ .bitmap = {0, 0, 0, 0, 0, 0} }; this _probably_ adds a single 0 for the flex array. The bug seems to be fixed on the GCC 7 branch, confirmed on the tip of the GCC 6 branch. GCC 6 DSEs the table[0] assignment in the following: Example_assignment () { struct Example * obj; struct Example * D.1788; struct Example * obj; <bb 2>: obj_6 = __builtin_malloc (64); obj_6->table[0] = 1000; *obj_6 = {}; return obj_6; Wonder what fixed it / which bug is the dup.
Started with r222305. Went away with r251217.
Dup then. *** This bug has been marked as a duplicate of bug 81884 ***