Forums

Notifications
Clear all

[Sticky] Troubleshooting Checklist: Undefined Behavior, Optimization, and Startup Surprises

1 Posts
1 Users
0 Reactions
0 Views
Saeid Yazdani working at an electronics workbench
(@saeid_yazdani)
Member Admin
Joined: 11 years ago
Posts: 37
Topic starter   [#28]

If code only breaks at higher optimization levels, assume the compiler found a contract violation before assuming the compiler is wrong.

  • Check initialization order
  • Check aliasing and lifetime assumptions
  • Check ISR/shared-data rules
  • Check memory sections and startup copy/zero logic

Reduce the bug to the smallest hardware-real case you can still explain.



   
Quote
Share: