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.

[参考译文] 编译器:C2000:编译器16.9 .3.LTS可能出现优化器问题

Guru**** 2595770 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/620642/compiler-c2000-possible-optimizer-issue-with-compiler-16-9-3-lts

工具/软件:TI C/C++编译器

我看到 C2000编译器16.9 v.3.LTS出现优化问题。  7.2 的0测试箱已连接。  问题在于 文件test.c中的以下功能:

typedef结构
 {
 INT M1;
 内部m2;
 }标清;
Const SD D[2]={{1000,1000},{1000,1000}};

Int DemonstrateOptimizationIssu()

 int i;
 unsigned long v1 = 0;
 Int V0 = 1,v2 = 0,v3 = 0;
 (i = 0;i < 2;I++)
   {
   V1 +=(无符号长)(D[I].m2)* V0;
   V2 += D[I].M1;
   v3 += D[I].m2;
   V0 += I;
   }
 V1 = v1 / v3;
 如果(!v1 &&!v2)返回(0);
 返回(1);

 

正确的返回值为1。  如果为test.c调用-o3优化,则返回0。  编译器似乎忽略了许多计算,包括v1的乘法。  这通常不会影响我,因为这些是本地广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域广域

构建线为:

c:/ti/ccsv7/tools/compiler/ti-CGT-2000_LTS/bin/cl2000"<xmt-block0>2000 16.9 -v28 -ml -mt --float_support=fpu32 -o3 --include_path="C:16.9 /ti/ccsv7/tools/ti-CGtg-trs/ti_compiler/ti_lose.3.3.3m/src/reflem_ram_reflect=-reflect_refle_d=-reflect_reflect_refl_reflect_d=-reflect_reflect_d_cr_reflect_reflect_cr_crus_cr_d=-reflect_cr_crus_cr_cr_cr_cr_-c_cr_d=-refl=-c_cr_cr_c_cr_cr_cr_cr_c_crms/cr_cruelf_cr_-c_crms/-c_cr_cr_cr_-c_-c_cr_crms/cr_cr_cr_-c_crms_refl=-

我能否在此处获得一个健全性检查,以确定这不是C代码中的问题(例如,缺少所需的易失性或其他问题)。

谢谢!

David

e2e.ti.com/.../F2.8335万_5F00_example_5F00_nonBIOS_5F00_ram.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您通知我们此问题并发送简明的测试案例。  我可以复制它。  我在 SDOWP系统中提交了CodeGen-3655以获得此地址。  欢迎您使用我签名中下面的SDOWP链接进行关注。

    谢谢,此致,

    -George