Re: Optimizing empty functions in C

"Scott Nicol" <snicol@apk.net>
28 Jun 2002 18:06:22 -0400

          From comp.compilers

Related articles
[5 earlier articles]
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)
| List of all articles for this month |

From: "Scott Nicol" <snicol@apk.net>
Newsgroups: comp.compilers
Date: 28 Jun 2002 18:06:22 -0400
Organization: APK Net
References: 02-06-025 02-06-037 02-06-061
Keywords: C, optimize
Posted-Date: 28 Jun 2002 18:06:22 EDT

"Andrzej Wasowski" <wasowski@data.pl> wrote in message
> > The only way to figure out what works best is to write some test code
> > and try it on potential target compilers.


> Thanks for the reply. The problem is I target embedded systems
> compilers mostly. This also means that I have no way to try this out
> and I am asking for common experience here.


The answer remains the same. It's mostly the processor. On some
processors, calls are cheap. On others, calls are expensive. If I
were generating code that could be targetted at any processor, I'd put
in the if (flag) because at best it is a big win, and at worst it is a
small loss.
--
Scott Nicol
snicol@apk.net


Post a followup to this message

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