[Bug rtl-optimization/80301] Sub-optimal code with an array of structs offsetted inside a struct global on x86/x86_64 at -O2
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 4 07:36:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80301
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-04-04
Component|target |rtl-optimization
Version|unknown |7.0.1
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we fail to combine/fwprop
(insn 9 8 4 2 (parallel [
(set (reg:DI 92)
(plus:DI (reg:DI 91 [ index ])
(const_int 2 [0x2])))
(clobber (reg:CC 17 flags))
]) "t.c":14 218 {*adddi_1}
(expr_list:REG_DEAD (reg:DI 91 [ index ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 10 4 11 2 (set (reg:CCZ 17 flags)
(compare:CCZ (mem:SI (plus:DI (mult:DI (reg:DI 92)
(const_int 8 [0x8]))
(symbol_ref:DI ("m") [flags 0x2] <var_decl 0x7f8f2c5b4e10
m>)) [2 m.s[index_4(D)].a+0 S4 A32])
(reg:SI 88 [ <retval> ]))) "t.c":14 7 {*cmpsi_1}
(nil))
which is because simply forwarding reg:DI 92 isn't possible and we do not know
how to simplify it into sth valid by associating the 2 into the symbol_ref part
of the outer plus. For the other MEM things happen to be associated
differently
by CSE1.
More information about the Gcc-bugs
mailing list