https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92655
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-11-25 CC| |jakub at gcc dot gnu.org, | |rsandifo at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The issue here is that we see t.ii:10:76: note: ==> examining statement: _2 = x.val[j_22]; t.ii:10:76: note: precomputed vectype: vector(4) long unsigned int t.ii:10:76: note: nunits = 4 t.ii:10:76: note: ==> examining statement: _10 = (unsigned int) _1; t.ii:10:76: note: get vectype for scalar type: unsigned int t.ii:10:76: note: vectype: vector(8) unsigned int t.ii:10:76: note: nunits = 8 t.ii:10:76: note: ==> examining statement: _14 = _2 << _10; t.ii:10:76: note: skip. t.ii:10:76: note: ==> examining pattern def stmt: patt_38 = _1 & 4294967295; t.ii:10:76: note: precomputed vectype: vector(4) long unsigned int t.ii:10:76: note: nunits = 4 t.ii:10:76: note: ==> examining pattern statement: patt_37 = _2 << patt_38; t.ii:10:76: note: precomputed vectype: vector(4) long unsigned int ... t.ii:10:76: note: ==> examining statement: _16 = 61 - _10; t.ii:10:76: note: get vectype for scalar type: unsigned int t.ii:10:76: note: vectype: vector(8) unsigned int t.ii:10:76: note: nunits = 8 t.ii:10:76: note: ==> examining statement: _17 = _2 >> _16; t.ii:10:76: note: skip. t.ii:10:76: note: ==> examining pattern def stmt: patt_36 = (long unsigned int) _16; t.ii:10:76: note: precomputed vectype: vector(4) long unsigned int t.ii:10:76: note: get vectype for smallest scalar type: unsigned int t.ii:10:76: note: nunits vectype: vector(8) unsigned int t.ii:10:76: note: nunits = 8 t.ii:10:76: note: ==> examining pattern statement: patt_35 = _2 >> patt_36; t.ii:10:76: note: precomputed vectype: vector(4) long unsigned int t.ii:10:76: note: nunits = 4 because <bb 3> [local count: 858993460]: # j_22 = PHI <0(2), j_12(5)> # ivtmp_40 = PHI <4(2), ivtmp_39(5)> _1 = SPECIALMUL.val[j_22]; _2 = x.val[j_22]; _10 = (unsigned int) _1; _14 = _2 << _10; _15 = _14 & 2305843009213693951; _16 = 61 - _10; _17 = _2 >> _16; _18 = _15 + _17; <retval>.val[j_22] = _18; j_12 = j_22 + 1; ivtmp_39 = ivtmp_40 - 1; if (ivtmp_39 == 0) goto <bb 4>; [25.00%] else goto <bb 5>; [75.00%] so _10 is used twice and the 2nd shift argument isn't promoted to unsigned long by any pattern (instead it was demoted earlier). Even if fixing that in source there's vect_recog_over_widening_pattern undoing that: t.ii:10:76: note: vect_recog_over_widening_pattern: detected: xyz_10 = 61 - _1; t.ii:10:76: note: demoting long unsigned int to unsigned int t.ii:10:76: note: created pattern stmt: patt_40 = 61 - patt_41; :/ so it looks like those work against each other here.