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

            Bug ID: 85168
           Summary: ICE in tree-ssa-coalesce.c: SSA corruption: Unable to
                    coalesce ssa_names which are marked as MUST COALESCE
                    when -O2 is used
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ivo.raisr at oracle dot com
  Target Milestone: ---

Created attachment 43815
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43815&action=edit
reproducer.c

With gcc 8.0.1 built recently from SVN, I receive internal compiler error: SSA
corruption when -O2 is used:


 void g(void) {
      ^
0xdcec2e fail_abnormal_edge_coalesce
        ../../src/gcc/tree-ssa-coalesce.c:1012
0xdcec2e coalesce_partitions
        ../../src/gcc/tree-ssa-coalesce.c:1401
0xdcec2e coalesce_ssa_name()
        ../../src/gcc/tree-ssa-coalesce.c:1888
0xd6450e remove_ssa_form
        ../../src/gcc/tree-outof-ssa.c:948
0xd6450e rewrite_out_of_ssa(ssaexpand*)
        ../../src/gcc/tree-outof-ssa.c:1174
0x8b2820 execute
        ../../src/gcc/cfgexpand.c:6227


The full source module is not publicly available. I have creduce'd it to the
following minimal form:
----------------------------------------
typedef struct {
  struct {
    char a;
  } b;
} c;

int d, f;
c *e;

extern void i(void);

void g(void) {
  c *h = e;
  if (f) {
    i();
    h--;
    if (d)
      if (h->b.a)
        i();
  }
  if (h->b.a)
    __builtin_setjmp(0);
  e = h;
}
----------------------------------------

The problem is reproducible with:
    $ gcc -fdump-rtl-expand-details -O2 -c <reproducer.c>
but not with:
    $ gcc -fdump-rtl-expand-details -O1 -c <reproducer.c>

Reply via email to