https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115161
--- Comment #3 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Looking at -O2's bug.cc.265t.optimized tree optimizations come up with unfolded
saturated sub8:
_12 = __builtin_ia32_psubusb128 ({ -65, 0, 0, 0, -65, 0, 0, 0, -65, 0, 0, 0,
-65, 0, 0, 0 }, { -99, 0, 0, 0, -99, 0, 0, 0, -99, 0, 0, 0, -99, 0, 0, 0 });
_13 = __builtin_ia32_pminub128 (_12, { 32, 0, 0, 0, 32, 0, 0, 0, 32, 0, 0, 0,
32, 0, 0, 0 });
...
bug.cc.272r.cse1 still has that subtraction:
5: r119:V16QI=[`*.LC0']
REG_EQUAL const_vector
6: r120:V16QI=[`*.LC1']
REG_EQUAL const_vector
7: r118:V16QI=us_minus(r119:V16QI,r120:V16QI)
bug.cc.273r.fwprop1 does not anymore:
3: NOTE_INSN_BASIC_BLOCK 2
2: NOTE_INSN_FUNCTION_BEG
9: r122:V16QI=[`*.LC2']
REG_EQUAL const_vector
13: r123:V4SI=r122:V16QI#0<<0x17
REG_EQUAL const_vector
16: r128:SI=0x5f800000
15: r127:V4SI=vec_duplicate(r128:SI)
Could it be that constant folder "forgot" to generate anything for unsupported
saturated-sub instead of leaving it as is?