http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59803
Bug ID: 59803 Summary: [4.8 Regression] s390x -march=z10 reload ICE Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org extern void baz (void) __attribute__ ((__noreturn__)); struct A { int g, h; }; extern struct A a; struct B { unsigned char i, j, k, l, m; }; int c, d, e; static int f; void foo (void) { f = 1; } void bar (struct B *x) { x->i = e; x->k = c; x->l = d; x->j = a.h; x->m = f; if (x->i != e) baz (); if (x->k != c) baz (); if (x->j != a.h) baz (); } ICEs with -O2 -march=z10 on 4.8 branch (verified with x86_64-linux -> s390x-linux cross at r206599). Works in 4.6 and works on the trunk, though it is unclear if it just isn't latent. Before reload we have: (insn 10 9 11 2 (set (reg:SI 58 [ d ]) (mem/c:SI (symbol_ref:DI ("d") <var_decl 0x7f11a63617b8 d>) [2 d+0 S4 A32])) rh1052372.ii:19 67 {*movsi_zarch} (expr_list:REG_EQUIV (mem/c:SI (symbol_ref:DI ("d") <var_decl 0x7f11a63617b8 d>) [2 d+0 S4 A32]) (nil))) (insn 11 10 13 2 (set (mem:QI (plus:DI (reg/v/f:DI 57 [ x ]) (const_int 3 [0x3])) [0 x_4(D)->l+0 S1 A8]) (subreg:QI (reg:SI 58 [ d ]) 3)) rh1052372.ii:19 74 {*movqi} (expr_list:REG_DEAD (reg:SI 58 [ d ]) (nil))) and the ICE is about unrecognized instruction: (insn 61 10 11 2 (set (reg:DI 12 %r12) (const:DI (plus:DI (symbol_ref:DI ("d") <var_decl 0x7fbc425267b8 d>) (const_int 3 [0x3])))) rh1052372.ii:19 -1 (nil)) If I look at trunk dumps, it seems the difference there is already at expansion time, while on the trunk *.expand has separate insns to set (symbol_ref:DI ("d") to a pseudo and load (mem:SI (that pseudo)), 4.8 branch uses movsi_zarch insn which is load from (mem:SI (symbol_ref:DI ("d"))). Then, at combine time trunk combines the store with the load (and not symbol_ref larl), while 4.8 fails to combine the store with the load because I suppose lowest bit in larl loaded value can't be set?