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.

[参考译文] 编译器/MSP430-GCC-opensource:MSP430-GCC 9.2.0.0中断处理程序中生成的额外跳转指令

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/939600/compiler-msp430-gcc-opensource-msp430-gcc-9-2-0-0-extra-jump-instruction-generated-in-interrupt-handler

器件型号:MSP430-GCC-opensource

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

使用 MSP430-GCC 9.2.0.0编译

标志:

CFLAGS =-mmcu=$(MCU)-std=gnu11 -g -OS -fno-IPA-ICF 函数\
-wound-wunused_ffunion-sections -fdata-sections -f省 略-frame-pointer -fwrapv -MMD

源代码决定是发送另一个数据包还是停止。

__attribute (((中断))
void xmit_char_3 (void)
{
UCA0TXBUF_L = UART_txbuf.buf.buf[3];
if (UART_TX_msg_sent!= UART_TX_msg_PENDING)
IRQ_UART_TX = UART_TX_NEXT;
否则
IRQ_UART_TX = RETI;
}

生成的汇编器。 请注意、带粗体跳转的目标只是 RETI。

在这种情况下、编译器应简单地发出 RETI、从而节省该处理程序2个时钟周期。

0xe7fe:0x42d2 mov.b &0x2569、&0x050e 6.
0xe800:0x2569
0xe802:0x050e
0xe804:0x9292 CMP.w &0x2564、&0x2562 6.
0xe806:0x2564
0xe808:0x2562
0xe80a:0x2404 jeq 0xe814 (偏移量:8) 2.
0xe80c:0x4292 mov.w &0x2002、&0x27d6 6.
0xe80e:0x2002
0xe810:0x27d6
0xe812:0x1300 eti 5.
0xe814:0x40b2 mov.w #0xx288、&0x27d6 5.
0xe816:0xx288
0xe818:0x27d6
0xe81a:0x3ffb JMP 0xe812 (偏移:-10) 2.

 


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

    您好!

    您能否提供一个无需进一步修改即包含全局变量声明的编译测试用例。 然后、我可以检查下一版 MSP430-GCC 中的指令成本模型调整调整是否解决了这一问题(我想这将在大约一个月内公开)。

    谢谢、

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

    本周我因工作而满贯、但下周我将为您准备一个测试案例。

    一如既往的感谢、

    Dave