Re: Optimizing empty functions in C

"Mark Lacey \[MSFT\]" <mlacey@microsoft.com>
20 Jun 2002 21:58:13 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: Optimizing empty functions in C vbdis@aol.com (VBDis) (2002-06-14)
Re: Optimizing empty functions in C debray@CS.Arizona.EDU (Saumya K. Debray) (2002-06-14)
Re: Optimizing empty functions in C cdg@nullstone.com (Christopher Glaeser) (2002-06-17)
Re: Optimizing empty functions in C wasowski@data.pl (Andrzej Wasowski) (2002-06-20)
Re: Optimizing empty functions in C wasowski@data.pl (Andrzej Wasowski) (2002-06-20)
Re: Optimizing empty functions in C wasowski@data.pl (Andrzej Wasowski) (2002-06-20)
Re: Optimizing empty functions in C mlacey@microsoft.com (Mark Lacey \[MSFT\]) (2002-06-20)
Re: Optimizing empty functions in C dnovillo@redhat.com (Diego Novillo) (2002-06-28)
Re: Optimizing empty functions in C snicol@apk.net (Scott Nicol) (2002-06-28)
Re: Optimizing empty functions in C haberg@matematik.su.se (Hans Aberg) (2002-06-28)
Re: Optimizing empty functions in C ralph@inputplus.co.uk (Ralph Corderoy) (2002-06-28)
Re: Optimizing empty functions in C iddw@hotmail.com (Dave Hansen) (2002-06-28)
Re: Optimizing empty functions in C Peter-Lawrence.Montgomery@cwi.nl (Peter L. Montgomery) (2002-06-28)
[1 later articles]
| List of all articles for this month |

From: "Mark Lacey \[MSFT\]" <mlacey@microsoft.com>
Newsgroups: comp.compilers
Date: 20 Jun 2002 21:58:13 -0400
Organization: Compilers Central
References: 02-06-025 02-06-042
Keywords: C, optimize
Posted-Date: 20 Jun 2002 21:58:13 EDT

> [What do C++ compilers do? Identical functions in C++ are pretty common
> when using templates, particularly templates for container classes that
> don't interpret the data they're containing. -John]


The Microsoft Visual C++ toolset will eliminate duplicated functions
through a process it calls "identical COMDAT folding" (ICF). By
specifying -O1 or -O2 for the compilation and -opt:icf as a link
option, you get this effect. For elimination of (statically)
unreferenced functions, you again need either -O1 or -O2 on the
compilation and -opt:ref as a link option. -opt:ref implies -opt:icf
by default.
--
Mark Lacey
mlacey at microsoft dot com
Microsoft Visual C++ Program Management


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.