Is there a way to mark a block of code or a function as an excluded part of the compiler's optimization feature?

I have a bug that occur only when the optimization feature is on. I have some guesses about where it might be, and this macro can be a nice help.