This bug has been observed with MinGW-w64 on Fedora 27 (gcc 7.2.0) and Fedora 25 (gcc 6.4.0). It is not seen on any native Linux builds, including gcc 7.2.0, or on MinGW-w64 on Fedora 21 (gcc 4.9.2). $ cat bug.c typedef struct { struct { int a[0] } } b; typedef struct { int c } d; __thread d e; f; g() { b *h = &e.c; int *a = h->a; i(a[f]); i(a[f]); } $ x86_64-w64-mingw32-gcc -c -O2 bug.c bug.c:4:3: warning: no semicolon at end of struct or union } ^ bug.c:5:1: warning: no semicolon at end of struct or union } b; ^ bug.c:6:24: warning: no semicolon at end of struct or union typedef struct { int c } d; ^ bug.c:8:1: warning: data definition has no type or storage class f; ^ bug.c:8:1: warning: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] bug.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int] g() { ^ bug.c: In function 'g': bug.c:10:10: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] b *h = &e.c; ^ bug.c:12:3: warning: implicit declaration of function 'i' [-Wimplicit-function-declaration] i(a[f]); ^ bug.c:9:1: internal compiler error: in get_constraint_for_ptr_offset, at tree-ssa-structalias.c:3155 g() { ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. $ x86_64-w64-mingw32-gcc -v Using built-in specs. COLLECT_GCC=x86_64-w64-mingw32-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper Target: x86_64-w64-mingw32 Configured with: ../configure --prefix=/usr --bindir=/usr/bin --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --with-gnu-as --with-gnu-ld --verbose --without-newlib --disable-multilib --disable-plugin --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-languages=c,c++,objc,obj-c++,fortran --with-bugurl=http://bugzilla.redhat.com/bugzilla --with-cloog --enable-threads=posix --enable-libgomp --target=x86_64-w64-mingw32 --with-sysroot=/usr/x86_64-w64-mingw32/sys-root --with-gxx-include-dir=/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++ Thread model: posix gcc version 7.2.0 20170814 (Fedora MinGW 7.2.0-1.fc27) (GCC) $ rpm -qf `which x86_64-w64-mingw32-gcc` mingw64-gcc-7.2.0-1.fc27.x86_64 $ uname -a Linux build-fedora27 4.14.6-300.fc27.x86_64 #1 SMP Thu Dec 14 15:31:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Dup. *** This bug has been marked as a duplicate of bug 83945 ***