https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118865
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 60490 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60490&action=edit Improve list assumetions after constructor I have not tested this patch but this should improve the situtation I think. It is similar to doing: std::list<int> listJets(jbeg, jend); if (listJets.begin() == listJets.end()) __builtin_unreachable(); but inside the constructor. This makes things optimize better due and such. Note it could be better optimized to hold a bool before the for loop instead of copying the whole iterator.
