Closed apolukhin closed 3 years ago
I can't see how could this should be solved., the inliner takes the wrong decision. Which compiler and version?
Reported the issues here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91981 and here https://bugs.llvm.org/show_bug.cgi?id=43562
GCC and Clang of almost any version
Since it looks like an inliner issue, I'm closing this. thanks for the report.
Compilers inline the
priv_forward_range_insert_no_capacity
function and that function touches a lot of local variables. The compilers are forced to free up some registers and they push data on the stack.As a result here's how the small_vector::push_back looks like:
While the
std::vector::push_back
looks like the following:Godbolt playground: https://godbolt.org/z/CvRqMY
Note that adding
BOOST_NOINLINE
topriv_forward_range_insert_no_capacity
does not help.