https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80277
Bug ID: 80277 Summary: ipa-icf missing overlooking functions Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: linux at carewolf dot com Target Milestone: --- Created attachment 41100 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41100&action=edit icf.cc Several functions that produce identical assembler are not merged by ipa-icf. I have attached an example, and only the two functions foo0 and foo1 that are identical in every detail are meged, though all the foo* functions produce identical assembler. I theorice it is because the function signature is compared before the content, and the templates and different types might cause that early comparison to fail when it shouldn't. I added a second test that just changed the return value but kept everything else identical and it also wasn't merged. A little unrelated: I noted the ipa-icf optimization is undone by -O3 as it re-inlines, though that is kind of pointless unless it is needed for second level inlining.