This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Static function register optimization

Can someone tell me why all functions declared as "static" do not seem to have any register optimization done on them? At least this is implied since they are not listed in the map file where register usage is specified but become listed if the "static" declaration is removed.

Does this imply that I should remove the "static" declaration from any function to which I have set a global pointer in order to ensure optimization is done on that function?

Parents
  • The compiler generates the functions in the order they appear in the source module. Even on global functions that are in the same module you must keep the structure described in: http://www.keil.com/support/docs/2809.htm.

    We are working on an enhanced strategy for the ARM Compiler where this structure is no longer required. But it involves that the Compiler make s a call tree analysis before generating the code (you need to know how many registers a function uses to generate optimum code for other functions).

    I think for the moment, you should consider to re-organize your code.

Reply
  • The compiler generates the functions in the order they appear in the source module. Even on global functions that are in the same module you must keep the structure described in: http://www.keil.com/support/docs/2809.htm.

    We are working on an enhanced strategy for the ARM Compiler where this structure is no longer required. But it involves that the Compiler make s a call tree analysis before generating the code (you need to know how many registers a function uses to generate optimum code for other functions).

    I think for the moment, you should consider to re-organize your code.

Children
No data