Warnning! fxc compilation bugs(DirectX)

I have been working on DX11 and tessellation lately. It turns out my tessellation shaders are broken when I let fxc optimize my shader. The “solution” is to specify the flag /Od which tells fxc to not do any optimizations.
This will have to do for now, but you realize how deadly it can be. You might work on a problem for a long time and not solve it because of unsafe optimizations, and then suddenly you turn into debug and it works. Scary stuff.
I must note that I don’t have any warnings from fxc.

I tried to look at the assembly code, and the biggest thing I noticed is that the “Release” code has loop unrolling while the “Debug” code has real loops. I think most of the optimizations are the loop unrolling anyway.

Here is the unoptimized shader results compared to the optimized shader results: