Re: Optimizing empty functions in C

"Joachim Durchholz" <joachim_d@gmx.de>
14 Jun 2002 15:19:39 -0400

          From comp.compilers

Related articles
Optimizing empty functions in C wasowski@data.pl (Andrzej Wasowski) (2002-06-13)
Re: Optimizing empty functions in C snicol@apk.net (Scott Nicol) (2002-06-14)
Re: Optimizing empty functions in C joachim_d@gmx.de (Joachim Durchholz) (2002-06-14)
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)
[8 later articles]
| List of all articles for this month |
From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 14 Jun 2002 15:19:39 -0400
Organization: Compilers Central
References: 02-06-025
Keywords: optimize, C, comment
Posted-Date: 14 Jun 2002 15:19:39 EDT

Andrzej Wasowski wrote:
> I just wondered what is the tradition of C-compilers about redundeant
> code. Will two identical functions generate the same code twice?


Given that having two identical functions in C is exceedingly rare (why
should a programmer write something like that?), I don't see that any
compiler vendor would invest his time in implementing this. There are
more interesting optimizations around.


If you're generating C code, you'll have to do this analysis yourself.
(Essentially, it's the same algorithm as the one that a C compiler would
have to employ.)
TANSTAAFL.


Regards,
Joachim
[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]


Post a followup to this message

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