This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: commoning up template instantiations
- From: Jay Foad <jay dot foad at gmail dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 4 Nov 2015 10:43:54 +0000
- Subject: Re: commoning up template instantiations
- Authentication-results: sourceware.org; auth=none
- References: <CANd1uZm3X9QWao1RigcAimz-hCLQNUhL1WoZj5aaL_=XdS0mWw at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1511041337310 dot 8142 at monopod dot intra dot ispras dot ru>
Thanks both. Would it be realistic to teach IPA ICF that in this case,
taking the address of the functions doesn't matter? Should I raise an
enhancement request?
Thanks,
Jay.
On 4 November 2015 at 10:41, Alexander Monakov <amonakov@ispras.ru> wrote:
> 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