On Tuesday, July 31, 2012 12:19:44 PM UTC+3, Andrew Haley wrote:
Hi,
Our OS is FreeRTOS and use MIPS without shadow registers. so upon context switch we save all current registers on the stack of the task/interrupt (in the 'red zone').
So far we worked with an old version of the compiler 'gcc version 3.4.4 mipssde-6.06.01-20070420' - we didn't see the problem there, the 'red zone' was never used by a function.
Recently we switched to a new compiler 'gcc version 4.5.2 Sourcery CodeBench Lite 2011.09-86' and we started seeing this problem.
Note that this will only happen if we compile to mips16 and apply size optimization. Otherwise this problem won't occur.
We can change our code and save the context elsewhere.. but isn't there a convention for a function not to read / use the 'red zone'? maybe this is a bug in the compiler optimization module.
Thanks,
El