|Optimizing empty functions in C firstname.lastname@example.org (Andrzej Wasowski) (2002-06-13)|
|Re: Optimizing empty functions in C email@example.com (Scott Nicol) (2002-06-14)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Joachim Durchholz) (2002-06-14)|
|Re: Optimizing empty functions in C email@example.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 firstname.lastname@example.org (Christopher Glaeser) (2002-06-17)|
|Re: Optimizing empty functions in C email@example.com (Andrzej Wasowski) (2002-06-20)|
|[10 later articles]|
|From:||"Andrzej Wasowski" <firstname.lastname@example.org>|
|Date:||13 Jun 2002 21:01:12 -0400|
|Keywords:||C, optimize, question|
|Posted-Date:||13 Jun 2002 21:01:12 EDT|
hello all C-compiler gurus,
I just wondered what is the tradition of C-compilers about redundeant
code. Will two identical functions generate the same code twice? A
special case of this problem is most interesting for me: if I put many
empty functions of the same time (let's say void f(void)) in my code -
will I get many empty functions generated, just one of them, or
perhaps none (because the compiler can eliminate the call alread)?
what if the function is potentially called via function pointer? (I
belive it is non-trivial to eliminate the call then).
Last but not the list: what would be normally faster to execute:
a call to an empty function or a check of integer flag (check if there
is any function to call), sthg like"
if non_empty_f then f(); /* if f is empty */
String.concat[ "wasowski", "@", "data", ".", "pl"]
Return to the
Search the comp.compilers archives again.