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.

[参考译文] TMS570LC4357:编译器5.2.2优化非法操作数错误

Guru**** 2463330 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1104809/tms570lc4357-compiler-5-2-2-optimization-illegal-operand-error

器件型号:TMS570LC4357

我正在使用 过程间优化来编译源文件。 编译器无法汇编、出现以下错误

1259 00000c98 E04CC000 SUB V9、V9、D0、LSR #1;[DPU_4_PIPE0]|106|
"C:\Users\Txxx\AppData\Local\Temp\1874410"、错误! 第1259行:[E0001]未定义符号
"C:\Users\Txxx\AppData\Local\Temp\1874410"、错误! 在第1259行:[E0003]意外的尾随操作数
"C:\Users\Txxx\AppData\Local\Temp\1874410"、错误! 在第1259行:[E0004]非法操作数

编译器版本为 带有选项的 ti-cgt-arm_5.2.2

-mv7R5 --code_state=32 --float_support=VFPv3D16 --abi=eabi -O2 --opt_for_speed=5 --symdebug:none --c99 --strict_ansi --define=_inline --define=_define=_off-define=v_ench_off-define=v=v_ench_code_remap_en_off-code_supervise_v=v-code_v=v-reg=v-codest_en_en_en_en_example_us=v-code_supervise_v=v-reg=v-reg=v-reg=v-reg=v-off-code_remap_en_en_en_off-reg=v-reg=v-reg_off-reg=v-off-reg=v-code_remap_en_en_en_off-reg=v-reg_off-reg=v  

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

    优化器无法成功编译以下函数:

    静态内联 float32_t FastInvSqrtf( float32_t 雪崩);
    静态内联 float32_t FastInvSqrtf (float32_t 雪崩)

    /*
    *前提条件分析:不明确检查此条件、因为
    *此函数必须在一个非常高速的环路中运行、每个环路的采样频率为60kHz
    8通道速率和吞吐量冲击是不可接受的。
    *

    const float32_t X_half = 0.5F *雪崩;

    /*初始猜测*/
    typedef union F32U32_u

    uint32_t asU32;
    float32_t asF32;
    } F32U32_t;

    F32U32_t xunion;/*lint !e9018 [MISRA 2012 Rule 19.2,Advisory ]在这种情况下联合声明是可以的*/
    xunion.asF32 =雪崩;

    const uint32_t i = xunion.asU32;
    xunion.asU32 =( 0x5F375A86U -( I >> 1U ));
    float32_t x = xunion.asF32;

    //牛顿近似的两次迭代*/
    x = x *(1.5F -((X_Half * x)* x));
    x = x *(1.5F -((X_Half * x)* x));
    返回 x;

    它在  xunion.asU32 =( 0x5F375A86U -( I >> 1U )) lne 上失败

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

    我使用 TI ARM 编译器编译了您的代码:TI v16.9.11.LTS 和 TI v20.2.6.LTS、但我没有看到问题。

    请检查 TEMP 和 TMP 环境变量是否已定义。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="458865" URL"~/support/microcontrollers/arm-based microcontrollers-group/arm-based microcontrollers/f/arm-based microcontrollers-forume/1104809/tms570lc4357-compiler-5-2-optimizing-ilical-operal-error"]编译器版本为 ti-cgt-arm_5.2.2[包含选项]

    使用 Linux 下的 CCS 11.2、我将代码粘贴到项目中、并尝试使用不同版本的 TI ARM 编译器使用优化设置进行编译。 结果为:

    TI ARM 编译器版本 结果
    TI-CGT-ARM_5.2.2 5组装错误、无组装警告
    TI-CGT-ARM_5.2.9 5组装错误、无组装警告
    TI-CGT-ARM_15.9.0.STS 5组装错误、无组装警告
    TI-CGT-ARM_15.12.7.LTS 无编译器错误或警告

    为了便于参考、随附了示例工程。

    您是否能够更改为更高版本的编译器以解决错误?

    我从5.2.2开始、在重新创建错误后、编译器版本会进行高级操作、尝试查找不再报告错误的第一个编译器版本。

    e2e.ti.com/.../TMS570LC4357_5F00_inter_5F00_procedural_5F00_error.zip