https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98848
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Blocks| |53947 Last reconfirmed| |2021-01-27 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Probably because t.c:9:16: note: vect_recog_over_widening_pattern: detected: _9 = MIN_EXPR <_3, b_14>; t.c:9:16: note: demoting int to signed short t.c:9:16: note: created pattern stmt: patt_11 = MIN_EXPR <_2, patt_12>; t.c:9:16: note: over_widening pattern recognized: patt_6 = (int) patt_11; t.c:9:16: note: extra pattern stmt: patt_12 = (signed short) b_14; t.c:9:16: note: extra pattern stmt: patt_11 = MIN_EXPR <_2, patt_12>; which makes the reduction unhandled (we only support sign changing conversions, not truncations). We can restrict the over-widen pattern to not apply for reductions or see to use range-info (like pattern recog does) in the reduction handling somehow. I don't see a obvious place to add a reduction def check to vect_recog_over_widening_pattern, maybe Richard does. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations