Skip to main content
Knowledgebase
Home
Renesas Electronics Europe - Knowledgebase

Effect: does Otail call on compiler to enable optimization of calls?

Latest Updated:09/04/2015

Question:

What effect does specifying the –Otail_call=on compiler option to enable the optimization of function calls at the ends of functions have when I start debugging?

Answer:

The compiler generates a branch instruction instead of a function calls for the the end of functions in the C source file. Thus a return instruction equivalent to a return statement is not generated.

This affects functionality which assumes a return statement, such as functions from which exit is not possible without a return instruction in stepped execution. For example, in the case of the code output by the compiler for the source code below, the optimization leads to return to main() rather than func1() when “return from the current function” is used for func2(). If the optimization is not used, return will be to func1().

--------------
int gi;
void func2()
{
	gi++;
}
void func1()
{
	funcx();
	func2(); //Final function call
}
void main()
{
	・・・
	func1();
	・・・
}
--------------
Suitable Products
C Compiler Package for RH850 Family
C Compiler Package for RL78 Family