f_x2 = f_x1;
f_x1 = f_x0;
f_x0 = st_UGrid3S2R.f_C;
上述代码在CPU中执行,f_x1比f_x0慢1拍,f_x2比f_x0慢2拍,但在CLA中执行的时候f_x2始终和f_x0相等,感觉是代码被CLA优化了,如何避免这种优化?本人已尝试给这几个变量定义都加了关键字volatile,还是不行。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
f_x2 = f_x1;
f_x1 = f_x0;
f_x0 = st_UGrid3S2R.f_C;
上述代码在CPU中执行,f_x1比f_x0慢1拍,f_x2比f_x0慢2拍,但在CLA中执行的时候f_x2始终和f_x0相等,感觉是代码被CLA优化了,如何避免这种优化?本人已尝试给这几个变量定义都加了关键字volatile,还是不行。