http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55478
Bug #: 55478 Summary: [devirt] trunk fails inline-devirt test #4 Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: m...@use.net Created attachment 28783 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28783 test case that fails in trunk but passed with Maxim's devirt patches trunk currently fails test #4 here (also attached): http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02589.html $ g++-4.8 -O2 inline-devirt-4.C && objdump -d -Mintel a.out | less -p main\> 0000000000400630 <main>: 400630: 48 83 ec 18 sub rsp,0x18 400634: 48 89 e7 mov rdi,rsp 400637: 48 c7 04 24 d0 09 40 mov QWORD PTR [rsp],0x4009d0 40063e: 00 40063f: c6 44 24 0a 00 mov BYTE PTR [rsp+0xa],0x0 400644: c6 44 24 08 61 mov BYTE PTR [rsp+0x8],0x61 400649: c6 44 24 09 62 mov BYTE PTR [rsp+0x9],0x62 40064e: e8 2d 01 00 00 call 400780 <_Z12print_lengthRK6String> 400653: 31 c0 xor eax,eax 400655: 48 83 c4 18 add rsp,0x18 400659: c3 ret 40065a: 66 0f 1f 44 00 00 nop WORD PTR [rax+rax*1+0x0] It does inline the FixedString ctor, but not print_length(const String&), nor does it even inline FixedString::length() into print_length(const String&). I tried -O3 and -Ofast along with various inline --params, but to no avail.