Is it possible to disable the optimization?
a = 1
b = 1
In my code, however a and b never used.
You have two options for that. Either you make those variables volatile or you disable all optimizations with their corresponding command line option as described in the manual.