This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Merging identical functions in GCC
- From: Mike Stump <mrs at apple dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Sep 2006 11:38:14 -0700
- Subject: Re: Merging identical functions in GCC
- References: <E1GOLIP-0008Gh-TX@caffeine.csclub.uwaterloo.ca>
On Sep 15, 2006, at 2:32 PM, Ross Ridge wrote:
Also, I don't think it's safe if you merge only functions in COMDAT
sections.
Sure it is, one just needs to merge them as:
variant1: nop
variant2: nop
variant3: nop
[ ... ]
this way important inequalities still work. This requires multiple
entry points for a function, which will give some platforms fits,
but, oh well. Further, the optimizer can do enough analysis to
squeeze out some of the nops, some of the time. This should be
slightly better than the jmp scheme Roman proposed.