Compiler toolchain migration for PPC 8540

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiler toolchain migration for PPC 8540

371 Views
sudhanshugarg
Contributor I

I am trying to migrate gcc toolchain from c3.4.5-p4 to c3.4.5-p5. CPU used is 8540 and OS is VxWorks.

On migration and running the image, I found that the stack for one of the task is overflowing in a particular function.

The Stack size allocated for this task is 30k bytes. With c.3.4.5-p4, max stack usage is less than 20k bytes but with the changed toolchain, it surges to around 58k bytes. The Stack pointer at the beginning of that function is well within limit.

I compared the dis-assembly of that function generated with the two toolchains and it is different.

Has anyone faced any such issue of stack overflow on migrating the toolchain?

0 Kudos
1 Reply

270 Views
alexander_yakov
NXP Employee
NXP Employee

From the description, it looks like compiler behavior regarding stack operations is changed with compiler upgrade.

As long as you are saying the disassembled function looks differently when compiled by different versions of tool chain you are using, this may mean only the fact that new compiler compiles your code in different way.

I can only suggest looking to your disassembled code to understand which particular part in your code causes this different behavior of compilers. If the particular place is known, please look it twice for any possible mistakes regarding the amount of data stored in stack. If there is no obvious mistakes, please try to approach toolchain vendor.


Have a great day,
Alexander

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos