Case Study – Compiler Optimization

They (compiler optimizations) do result in weird things sometimes and here is one such  found with FreeRTOS for ARM Cortex-M3 port. This is as result of “Tail Call Optimization” as I had mentioned it in detail in my last post here.

Such bugs can take a lot of time to debug and still keep you quite clueless because they manifest as if they are HeisenBug.

Nevertheless here is detailed summary of that bug,

*** Update:
To be precise above issue is actually compiler optimization magic coupled with how PendSV is handled by ARM Cortex-M3 NVIC.

This entry was posted in Coding and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s