https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97873
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Target| |x86_64-*-* i?86-*-* Status|UNCONFIRMED |NEW Component|tree-optimization |target Last reconfirmed| |2020-11-17 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- We're expanding from _2 = ABS_EXPR <x_1(D)>; return _2; that's nothing to improve on the GIMPLE level. x86 has an abs expander that might or might not trigger (it doesn't look like for generic). We expand as insn 6 3 7 2 (parallel [ (set (reg:SI 85) (neg:SI (reg/v:SI 83 [ x ]))) (clobber (reg:CC 17 flags)) ]) "t.i":3:29 -1 (nil)) (insn 7 6 8 2 (parallel [ (set (reg:SI 84) (smax:SI (reg/v:SI 83 [ x ]) (reg:SI 85))) (clobber (reg:CC 17 flags)) ]) "t.i":3:29 -1 (nil)) (insn 8 7 12 2 (set (reg:SI 82 [ <retval> ]) (reg:SI 84)) "t.i":3:29 -1 (nil)) (insn 12 8 13 2 (set (reg/i:SI 0 ax) (reg:SI 82 [ <retval> ])) "t.i":4:1 -1 (nil)) where the smax:SI is late splitted IIRC. That's probably not the optimal expansion choice. I remember a duplicate bug.