[Bug c/83943] New: internal compiler error: in get_constraint_for_ptr_offset, at tree-ssa-structalias.c:3155

2018-01-19 Thread matt.sexton at redlinetrading dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83943

Bug ID: 83943
   Summary: internal compiler error: in
get_constraint_for_ptr_offset, at
tree-ssa-structalias.c:3155
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matt.sexton at redlinetrading dot com
  Target Milestone: ---

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

[Bug c/83944] New: internal compiler error: Segmentation fault with -O -ftree-pre

2018-01-19 Thread matt.sexton at redlinetrading dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83944

Bug ID: 83944
   Summary: internal compiler error: Segmentation fault with -O
-ftree-pre
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matt.sexton at redlinetrading dot com
  Target Milestone: ---

This bug has been observed with MinGW-w64 on Fedora 27 (gcc 7.2.0).  It is not
observed with a native Linux compile on Fedora 27 (gcc 7.2.1).

$ cat bug.c
typedef enum { a } b;
typedef struct { b action } c;
d;
inline e(void *p1) {
  long *f = p1;
  long g = f[g] = d;
}
typedef struct { int h } i;
__thread i j;
k() {
  int *l = &j.h;
  c *entryp = l;
  int m = &entryp[m];
  for (;;) {
e(&entryp[m]);
entryp[m].action = a;
  }
}

$ x86_64-w64-mingw32-gcc -c -O -ftree-pre bug.c
bug.c:2:27: warning: no semicolon at end of struct or union
 typedef struct { b action } c;
   ^
bug.c:3:1: warning: data definition has no type or storage class
 d;
 ^
bug.c:3:1: warning: type defaults to 'int' in declaration of 'd'
[-Wimplicit-int]
bug.c:4:8: warning: return type defaults to 'int' [-Wimplicit-int]
 inline e(void *p1) {
^
bug.c:8:24: warning: no semicolon at end of struct or union
 typedef struct { int h } i;
^
bug.c:10:1: warning: return type defaults to 'int' [-Wimplicit-int]
 k() {
 ^
bug.c: In function 'k':
bug.c:12:15: warning: initialization from incompatible pointer type
[-Wincompatible-pointer-types]
   c *entryp = l;
   ^
bug.c:13:11: warning: initialization makes integer from pointer without a cast
[-Wint-conversion]
   int m = &entryp[m];
   ^
bug.c:10:1: internal compiler error: Segmentation fault
 k() {
 ^
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

[Bug c/83945] New: internal compiler error: Segmentation fault with -O -fcode-hoisting

2018-01-19 Thread matt.sexton at redlinetrading dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83945

Bug ID: 83945
   Summary: internal compiler error: Segmentation fault with -O
-fcode-hoisting
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matt.sexton at redlinetrading dot com
  Target Milestone: ---

This bug has been observed with MinGW-w64 on Fedora 27 (gcc 7.2.0).  It is not
observed with a native Linux compile on Fedora 27 (gcc 7.2.1).

$ cat bug.c
typedef struct {
  struct {
int a[0]
  }
} b;
typedef struct { int c } d;
__thread d e;
f;
g() {
  b *h = &e.c;
  for (;;) {
int *a = h->a;
int i;
for (; i; i--)
  j(a[f]);
j(a[f]);
  }
}


$ x86_64-w64-mingw32-gcc -c -O -fcode-hoisting 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:15:7: warning: implicit declaration of function 'j'
[-Wimplicit-function-declaration]
   j(a[f]);
   ^
bug.c:9:1: internal compiler error: Segmentation fault
 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