https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108826
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Last reconfirmed| |2023-02-16 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Trying 13, 14, 15 -> 16: 13: r84:DI=r83:DI+0xc8 REG_DEAD r83:DI 14: r85:DI=r84:DI<<0x2 REG_DEAD r84:DI 15: r86:DI=r72:DI+r85:DI REG_DEAD r85:DI 16: r76:DI=sign_extend([r86:DI]) REG_DEAD r86:DI Failed to match this instruction: (set (reg:DI 76 [ _5 ]) (sign_extend:DI (mem:SI (plus:DI (plus:DI (mult:DI (reg:DI 83) (const_int 4 [0x4])) (reg/f:DI 72 [ _nettle_aes_decrypt_T.0_1 ])) (const_int 800 [0x320])) [2 _nettle_aes_decrypt_T.0_1->table[2][_4]+0 S4 A32]))) Failed to match this instruction: (set (reg/f:DI 86) (plus:DI (ashift:DI (reg:DI 83) (const_int 2 [0x2])) (reg/f:DI 72 [ _nettle_aes_decrypt_T.0_1 ]))) So combine does know how to combine all 4 instructions and produce the plus 800 there. But then it goes and splits it up and fails. I can't remember if there is 4->3 splitting or just 4->2 .