https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98674
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marxin at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > While GCC 9 vectorizes this case (and thus the vectorization failure is a > regression) dependence analysis isn't presented with the problematical access > but instead we see > > _1 = *p_22; > _5 = (unsigned short) _1; > bswapdst_10 = _5 r>> 8; > _8 = (short int) bswapdst_10; > *p_22 = _8; > > where the problematical access is created by the bswap pass which > detects > > 16 bit bswap implementation found at: _8 = _4 | _7; > > creates the replacement load but then fails half-way, not emitting a > bswap!? That's a bug worth fixing IMHO (either do all or none of the > transform). Oh, so it produces load_dst_11 = MEM[(short int *)p_22]; bswapdst_10 = load_dst_11 r>> 8; _8 = (short int) bswapdst_10; *p_22 = _8; it's just pattern recog that turns the rotate back to a shift sequence. So indeed dependence analysis is what should be fixed.