http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60979

            Bug ID: 60979
           Summary: [4.9/4.10 Regression] ICE: in
                    gimple_redirect_edge_and_branch_force, at
                    tree-cfg.c:5544, w/ -O -ftree-loop-linear or
                    fgraphite-identity
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com

gcc 4.9.0 and newer fails when compiling the following reduced testcase w/ -O1
and above and either -ftree-loop-linear or -fgraphite-identity:

typedef long int __jmp_buf[8];

typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof(unsigned long int)))];
} __sigset_t;

struct __jmp_buf_tag
{
  __jmp_buf __jmpbuf;
  int __mask_was_saved;
  __sigset_t __saved_mask;
};

typedef struct __jmp_buf_tag jmp_buf[1];

extern int _setjmp(struct __jmp_buf_tag __env[1]);

struct x;

typedef struct x **(*a)(struct x *);

struct x {
  union {
    struct {
      union {
        a *i;
      } l;
      int s;
    } y;
  } e;
};

jmp_buf c;

void
b(struct x *r)
{
  int f;
  static int w = 0;
  volatile jmp_buf m;
  f = (*(((struct x *)r)->e.y.l.i[2]((struct x *)r)))->e.y.s;
  if (w++ != 0)
    memcpy((char *)m, (const char *)c, sizeof(jmp_buf));
  if (_setjmp(c) == 0) {
    int z;
    for (z = 0; z < 0; ++z)
      ;
  }
  d((const char *)m);
}

nl8dmqci.c:37:1: internal compiler error: in
gimple_redirect_edge_and_branch_force, at tree-cfg.c:5544
 b(struct x *r)
 ^

Reply via email to