Re: Optimizing empty functions in C

"Andrzej Wasowski" <wasowski@data.pl>
20 Jun 2002 21:43:58 -0400

          From comp.compilers

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

From: "Andrzej Wasowski" <wasowski@data.pl>
Newsgroups: comp.compilers
Date: 20 Jun 2002 21:43:58 -0400
Organization: UNI-C
References: 02-06-025 02-06-037
Keywords: C, optimize
Posted-Date: 20 Jun 2002 21:43:58 EDT

Scott Nicol wrote:


> On a typical risc processor, evaluating an if and calling a function take
> about the same amount of time, so you should just call the function. On
> intel, function calls take a lot longer, so it is probably worth evaluating
> the if.
>
> 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. Is there anybody who knows
if it pays of to check if the call is redundant in typical
microcontroller? Otherwise how cost of a condition test relates to
cost of function call on MCU?


andrzej


Post a followup to this message

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