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.

Linux/MSP430FR2422: MSP430-GCC 6.1.0.0 produces poor performance code for MSP430FR2422

Part Number: MSP430FR2422
Other Parts Discussed in Thread: MSP430G2553,

Tool/software: Linux

I am compiling the following code segment for MSP430G2553 and MSP430FR2422:

__attribute((interrupt))
void i2c_recv_data_0(){
  cmd_buffer[0] = UCB0RXBUF;
  i2c_irq = i2c_recv_data_1;
}

Compiling for the G2553 I get the following assembler:

/opt/ti/msp430-6.1.0.0/bin/msp430-elf-gcc -M -mmcu=msp430g2553 -std=gnu11 -g -Os -Wall -pedantic -Wunused -ffunction-sections -fdata-sections -minrt -fomit-frame-pointer -fwrapv -MMD 

 f73c: d2 42 6e 00   mov.b &0x006e,&0x022a ;0x006e

Compiling for the FR2422 I get the following:

/opt/ti/msp430-6.1.0.0/bin/msp430-elf-gcc -M -mmcu=msp430fr2422 -msmall -std=gnu11 -g -Os -Wall -pedantic -Wunused -ffunction-sections -fdata-sections -minrt -fomit-frame-pointer -fwrapv -MMD

 f672: 0c 15         pushm #1, r12 ;16-bit words

f674: 1c 42 4c 05   mov &0x054c,r12 ;0x054c

f678: c2 4c 3b 20   mov.b r12,  &0x203b

...

f682: 0c 17         popm  #1, r12 ;16-bit words

As you can see, the code for the FR2422 entails an extra register transfer that bloats my code size.

I would expect to see similar output as the G2553 case.

Why is there an extra register usage???

**Attention** This is a public forum