https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78717
--- Comment #4 from Jonathan Wakely ---
This is because the std::basic_string::find function isn't marked 'inline' and
there is an explicit instantiation declaration for std::string. GCC simply
won't inline a non-inline function if there's an exp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78717
--- Comment #3 from AK ---
Even with a high inline limit, string::find didn't inline.
g++-11.0.2 -O3 -finline-limit=10 -S -o a.s s.cpp
cat a.s
```
_Z3fooRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i:
.LFB1240:
.cfi_s
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78717
--- Comment #2 from AK ---
With -O3 I see only the following definition of find which calls the real find
function I was expecting to be visible in the gimple.
D.12805 =
_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_mD.11635
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78717
--- Comment #1 from Marc Glisse ---
Did you forget to enable optimizations? At -O0, there is no point keeping those
extern templates around, so gcc saves time by dropping them. At -O1 and above,
I do see some extra functions in the gimple dump. I