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.

关于release和debuge编译产物的优化问题



有一个函数,debug编译产物运行结果正确,release编译产产物运行结果有错误,请问优化导致了那些问题?

static __inline f8  __cal_BaseCarrPh1(chx_para* pCH,u4 RegH,u4 RegL)

double   result;
unsigned int  quotient;

IFCycleMod = 500000;

IF_ratio = 500000/25000000;

result = RegH*IFCycleMod + RegL*IF_ratio;


quotient =result/65536;


result = result - quotient*65536;

return result;

这个函数就是求RegH*IFCycleMod + RegL*IF_ratio对65536求余,并加上小数部分,其返回值应该小于65536,release版本固件返回值有的远大于65536。