https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104547

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If I change the type of n to match the type of v.size() the code size explodes:

#include <vector>

void shrink_assume(std::vector<int>& v, std::size_t n) {
    if (v.size() < n)
      __builtin_unreachable();
    v.resize(v.size() - n);
}


This adds 141 lines to the .s compared to the same function with unsigned n.

Reply via email to