This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71587] New: missed inlining extern template function
- From: "programmerjake at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Jun 2016 02:03:07 +0000
- Subject: [Bug c++/71587] New: missed inlining extern template function
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71587
Bug ID: 71587
Summary: missed inlining extern template function
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: programmerjake at gmail dot com
Target Milestone: ---
missed inlining fn2<false>
version: (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204
command: g++-5 -O3 -S -std=c++11 -xc++ -
source:
template <bool V>
void fn2();
extern template void fn2<false>();
void fn3();
void fn()
{
fn2<false>();
fn3();
}
template <bool V>
void fn2()
{
}
template void fn2<false>();
It generates
subq $8, %rsp
call void fn2<false>()
addq $8, %rsp
jmp fn3()
It should generate
jmp fn3()