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

Stack Pointers

We are using our own developed RTOS,

Our developed software is working fine up to optimization level 6, but when we change the level to 8, the software was not working. We observed that the stack pointer is not same as we level 6. In level 6 when we are calling a function SP was going incremented with 2. Again from the function if we are calling another function than again SP is incrementing by 2.

But in level 8 we observed that in above case SP is incrementing by 2 and not by 4.

So we made necessary corrections in our RTOS related software and it worked.

After working with level 8 we changed the level to 9. But this time also the software having problems. So please give information about stack Pointers. How it is working (SP) with different optimization levels.

Parents
  • Your RTOS is incompatible with one of the optimizations performed at OP(8), most likely the one the streamlines tail recursions. This optimizes

       lcall foo
       ret
    into the shorter, faster, and less stack-hungry alternative
       ljmp  foo
    If your RTOS can't handle this optimization, you should re-think its design --- it's making unwarranted assumptions about the compiler.

Reply
  • Your RTOS is incompatible with one of the optimizations performed at OP(8), most likely the one the streamlines tail recursions. This optimizes

       lcall foo
       ret
    into the shorter, faster, and less stack-hungry alternative
       ljmp  foo
    If your RTOS can't handle this optimization, you should re-think its design --- it's making unwarranted assumptions about the compiler.

Children