https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64536
Bug ID: 64536 Summary: [4.9/5 Regression] Undefined .L* symbol starting with jump2 on s390x Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org CC: krebbel at gcc dot gnu.org, vmakarov at gcc dot gnu.org Target: s390x-linux struct S { long q; } *h; long a, b, g, j, k, *c, *d, *e, *f, *i; long *baz (void) { asm volatile ("" : : : "memory"); return e; } void bar (int x) { int y; for (y = 0; y < x; y++) { switch (b) { case 0: case 2: a++; break; case 3: a++; break; case 1: a++; } if (d) { f = baz (); g = k++; if (&h->q) { j = *f; h->q = *f; } else i = (long *) (h->q = *f); *c++ = (long) f; e += 6; } else { f = baz (); g = k++; if (&h->q) { j = *f; h->q = *f; } else i = (long *) (h->q = *f); *c++ = (long) f; e += 6; } } } int main () { return 0; } fails to link on s390x-linux with -O2 -m64 -fPIC, starting with r199754. For a tablejump, we load of the jump_table_data label is hoisted before the loop, then RA decides to spill it to stack (seems both with reload and lra), and then jump2 goes wild and deletes the casesi_jump instruction (and lots of other instructions it supposedly should not delete), but keeps the load of jump_table_data label (but the jump_table_data is gone).