Bug 55499 - [devirt] trunk fails to eliminate dead functions where all call sites were inlined
[devirt] trunk fails to eliminate dead functions where all call sites were in...
Status: UNCONFIRMED
Product: gcc
Classification: Unclassified
Component: ipa
4.9.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-27 22:23 UTC by Matt Hargett
Modified: 2014-01-28 01:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test case that devirtualizes correctly, but DCE fails (1.07 KB, application/octet-stream)
2012-11-27 22:26 UTC, Matt Hargett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hargett 2012-11-27 22:23:25 UTC
When compiling inline-devirt-1.C, all inlining happens correctly but the function bodies remain, with or without whole-program, with or without renaming main to main2 (and compiling as a shared lib):

g++-4.8 -fwhole-program -O3 -funroll-loops inline-devirt-1.C

0000000000400810 <_ZN10CalculableD1Ev>:
  400810:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400817:       c3                      ret    
  400818:       0f 1f 84 00 00 00 00    nop    DWORD PTR [rax+rax*1+0x0]
  40081f:       00 

0000000000400820 <_ZN1X9calculateEv>:
  400820:       b8 01 00 00 00          mov    eax,0x1
  400825:       c3                      ret    
  400826:       66 2e 0f 1f 84 00 00    nop    WORD PTR cs:[rax+rax*1+0x0]
  40082d:       00 00 00 

0000000000400830 <_ZN1Y9calculateEv>:
  400830:       b8 02 00 00 00          mov    eax,0x2
  400835:       c3                      ret    
  400836:       66 2e 0f 1f 84 00 00    nop    WORD PTR cs:[rax+rax*1+0x0]
  40083d:       00 00 00 

0000000000400840 <_ZN1YD1Ev>:
  400840:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400847:       c3                      ret    
  400848:       0f 1f 84 00 00 00 00    nop    DWORD PTR [rax+rax*1+0x0]
  40084f:       00 

0000000000400850 <_ZN1XD1Ev>:
  400850:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400857:       c3                      ret    
  400858:       0f 1f 84 00 00 00 00    nop    DWORD PTR [rax+rax*1+0x0]
  40085f:       00 

0000000000400860 <_ZN10CalculableD0Ev>:
  400860:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400867:       e9 94 fd ff ff          jmp    400600 <_ZdlPv@plt>
  40086c:       0f 1f 40 00             nop    DWORD PTR [rax+0x0]

0000000000400870 <_ZN1YD0Ev>:
  400870:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400877:       e9 84 fd ff ff          jmp    400600 <_ZdlPv@plt>
  40087c:       0f 1f 40 00             nop    DWORD PTR [rax+0x0]

0000000000400880 <_ZN1XD0Ev>:
  400880:       48 c7 07 d0 09 40 00    mov    QWORD PTR [rdi],0x4009d0
  400887:       e9 74 fd ff ff          jmp    400600 <_ZdlPv@plt>
  40088c:       0f 1f 40 00             nop    DWORD PTR [rax+0x0]
Comment 1 Matt Hargett 2012-11-27 22:26:28 UTC
Created attachment 28800 [details]
test case that devirtualizes correctly, but DCE fails
Comment 2 Matt Hargett 2014-01-28 01:06:02 UTC
still the case with current trunk.