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.

[参考译文] 编译器/BEAGLEBN:PRU 编译器的次要代码生成问题

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/652777/compiler-beaglebn-minor-code-generation-issue-with-pru-compiler

器件型号:BEAGLEBN

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

您好!

我注意到针对 特定临界情况、代码生成与 TI PRU 编译器 v2.2.1不一致。

struct a {};

struct a a;

unsigned test_add (unsigned a、struct a s、unsigned b)
{
返回 a + b;
} 

按预期生成 R14和 R15基准:

|TEST_ADDE||:
添加 R14、r14、R15 ;[ALU_PRU]|32| a,b
JMP r3.w2. ;[ALU_PRU]

但是、在调用此类函数时:

extern unsigned test_ADD2 (unsigned a、struct a s、unsigned b);
void test_call (void)
{
TEST_ADD2 (1、A、2);
} 

第二个 int 参数在 R16中传递:

|TEST_CALL ||:
子部分 R2、R2、0x02 ;
LDI R14、0x0001 ;
零 R15、4 ;
LDI R16、0x0002 ;<--应该是 R15
SBBO &R3.B2、R2、0、2 ;
日航 r3.w2、|test_ADD2||;
LBBO &R3.B2、R2、0、2 ;
添加 R2、R2、0x02 ;
JMP r3.w2. ;

此致、

Dimitar

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

    感谢您通知我们此问题并提交测试案例。  我可以重现问题。  我在 SDOWP 系统中提交了 CodeGen-4180以解决该问题。  欢迎您在我的签名中使用下面的 SDOWP 链接进行访问。

    谢谢、此致、

    乔治