internal compiler error

Mason slash.tmp@free.fr
Mon Jan 22 13:14:00 GMT 2018


On 19/01/2018 14:16, Matt Sexton wrote:

> I am encountering an internal compiler error when compiling with -O2

Is there any way to get mingw-w64 7.2 short of installing a full-blown
distro, or compiling from source?

Do the following testcases (slight variations on the one you provided)
also cause an ICE?

I used the following command-line:
gcc-7 -Wall -Wextra -std=gnu11 -O2 -S testcase.c


TESTCASE 1

struct b {
	struct { int a[0]; };
};
struct d { int c; };
__thread struct d e;
extern int f;
extern void foo(int i);
void g(void)
{
  struct b *h = &e.c;
  int *a = h->a;
  foo(a[f]);
  foo(a[f]);
}


TESTCASE 2

struct b {
	struct { int a[4]; };
};
struct d { int c; };
__thread struct d e;
extern int f;
extern void foo(int i);
void g(void)
{
  struct b *h = &e.c;
  int *a = h->a;
  foo(a[f]);
  foo(a[f]);
}


TESTCASE 3

struct b {
	struct { int a[1]; };
};
struct d { int c; };
struct d e;
extern int f;
extern void foo(int i);
void g(void)
{
  struct b *h = &e.c;
  int *a = h->a;
  foo(a[f]);
  foo(a[f]);
}


Regards.



More information about the Gcc-help mailing list