https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109443
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-04-11 Status|UNCONFIRMED |NEW Version|unknown |13.0 Component|tree-optimization |c++ See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=35269 --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- Well, but v.size () is not loop invariant. As Andrew says 'v' is passed by (const?) reference but the PTA solution doesn't exactly reflect this so we do think the call clobbers it: # USE = nonlocal escaped # CLB = nonlocal escaped f (_1); ... # PT = nonlocal escaped null _10 = MEM[(const struct vector *)v_5(D)].D.35644._M_impl.D.34955._M_finish; # PT = nonlocal escaped null _11 = MEM[(const struct vector *)v_5(D)].D.35644._M_impl.D.34955._M_start; _12 = _10 - _11; _13 = _12 /[ex] 4; _14 = (long unsigned int) _13; if (i_8 < _14) goto <bb 3>; [89.00%] so somehow the C++ handling of value-as-reference passing doesn't work (it should set TYPE_RESTRICT on the argument type used.