https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128410
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Actually, maybe I was just misreading the dumps. Cunroll turns bit_repeat (x, 3) into __x_6 = x_2(D) & 7; _14 = __x_6 << 3; __x_16 = __x_6 | _14; _22 = __x_16 << 6; __x_23 = __x_16 | _22; _29 = __x_23 << 12; __x_30 = __x_23 | _29; _36 = __x_30 << 24; __x_37 = __x_30 | _36; _9 = __x_37 << 48; __x_10 = _9 | __x_37; return __x_10; vrp2 turns those iors into multiplications __x_6 = x_2(D) & 7; _14 = __x_6 << 3; - __x_16 = __x_6 | _14; + __x_16 = __x_6 * 9; _22 = __x_16 << 6; - __x_23 = __x_16 | _22; + __x_23 = __x_16 * 65; _29 = __x_23 << 12; - __x_30 = __x_23 | _29; + __x_30 = __x_23 * 4097; _36 = __x_30 << 24; - __x_37 = __x_30 | _36; + __x_37 = __x_30 * 16777217; _9 = __x_37 << 48; - __x_10 = _9 | __x_37; + __x_10 = __x_37 * 281474976710657; return __x_10; and forwprop4 optimizes that into __x_6 = x_2(D) & 7; __x_10 = __x_6 * 10540996613548315209; return __x_10;
