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

Inconsistent stack sizes in linker map

When the option '--info stack' is added to the Linker, the generated linker map file contains stack usage for each function.
One function written in C is not calculated correctly:
The function repeatedly calls another function that returns a struct. For each call the stack usage in the map file increases when compiled with compiler version 6 (tested with 6.12, 6.15 and 6.20.1).
Debugging through the function shows that R13(SP) is not increased after each call.
This behavior is not if the compiler version 5 is used, or the file is in C++ (filename ending changed .cpp)
Is there an error in the Linker? We need this value to check automatically if the stack size declared too small.

Examplecode:

0