https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82102

            Bug ID: 82102
           Summary: [8 Regression] ICE: Segmentation fault in
                    /home/arnd/git/gcc/gcc/tree-ssa-pre.c:4863
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arnd at linaro dot org
  Target Milestone: ---

I ran into a segmentation fault on today's snapshot (now at r251683):

$ x86_64-linux-gcc-8.0.0 -c pt3_i2c.c -Wall -O2
during GIMPLE pass: pre
pt3_i2c.c: In function 'pt3_i2c_master_xfer':
pt3_i2c.c:12:6: internal compiler error: Segmentation fault
 void pt3_i2c_master_xfer(int p1) {
      ^~~~~~~~~~~~~~~~~~~
0xaa657f crash_signal
        /home/arnd/git/gcc/gcc/toplev.c:341
0xbeeb7a fini_eliminate
        /home/arnd/git/gcc/gcc/tree-ssa-pre.c:4863
0xbf8a4d execute
        /home/arnd/git/gcc/gcc/tree-ssa-pre.c:5201
Please submit a full bug report...

I can reproduce this with x86_64-linux-gcc (both 32 and 64 bit) and
aarch64-linux-gcc, but not arm-linux-gnueabi-gcc using the same gcc source.

See below for a reduced test case.

8<-------
void *a, *b;
struct pt3_i2cbuf {
  int num_cmds;
} c;
void *memcpy(void *, void *, long);
void put_stop();
void translate(struct pt3_i2cbuf *p1, int p2) {
  p1->num_cmds = 0;
  if (p2)
    put_stop();
}
void pt3_i2c_master_xfer(int p1) {
  translate(&c, p1);
  memcpy(a, b, c.num_cmds);
  for (; p1;)
    ;
}

Reply via email to