Is there a switch in the compiler or assembler for optimization
No, the optimization is done by the person behind the keyboard.

Again, if you post your code someone may be able to help.