commoning up template instantiations

Alexander Monakov amonakov@ispras.ru
Wed Nov 4 10:41:00 GMT 2015


Starting from release 5.1, GCC has IPA ICF (identical code folding) that can
perform such transform: you can use -fdump-ipa-icf to inspect its log file.
However, it doesn't eliminate the functions in your example, because they have
their address taken (and the pass does not realize that it doesn't matter).
Therefore it creates a wrapper rather than an alias, and then inlining undoes
that transform.

Alexander



More information about the Gcc-help mailing list