[Bug c++/104597] LTO does not inline indirect call

2022-02-18 Thread m.cencora at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104597 --- Comment #2 from m.cencora at gmail dot com --- Similarly when indirect call is a result of virtual function call, gcc cannot optimize it, while clang can: // main.cpp struct foo { virtual int getInt0() const = 0; virtual int getInt1()

[Bug c++/104597] LTO does not inline indirect call

2022-02-18 Thread m.cencora at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104597 --- Comment #1 from m.cencora at gmail dot com --- clang-12 optimizes it to: Dump of assembler code for function main: 0x00401110 <+0>: mov$0x1,%eax 0x00401115 <+5>: ret