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.

CCS/MSP430F5329: MSP430-GCC internal compiler error

Part Number: MSP430F5329

Tool/software: Code Composer Studio

I updated from the version 5 to the 9.2.0.50 of the gcc compiler for MSP430. Now in one file it says: font.c: In function 'eve_font_char_multi': font.c:253:1: error: unable to generate reloads for: 253 | } | ^ (insn 111 110 112 7 (set (reg:SI 6 R6 [orig:72 _100 ] [72]) (ashift:SI (zero_extend:SI (reg:QI 6 R6 [orig:96 handle ] [96])) (const_int 7 [0x7]))) 59 {*msp430.md:757} (expr_list:REG_DEAD (reg:QI 6 R6 [orig:96 handle ] [96]) (nil))) during RTL pass: reload font.c:253:1: internal compiler error: in find_reloads, at reload.c:3814 Compilation is done with msp430-elf-gcc -c -mmcu=msp430f5329 -O2 -Wall -Wextra -g2 -mlarge (even with lto the problem remains) Is this a known problem? Do you need the preprocessed source to test? Thanks in advance
  • Hi,

    Yes this looks like a bug.

    Some work was done in this area in the upcoming 9.3.0.31 release (to be made available within a couple of weeks I think), so it may be fixed already.

    For now I think you may be able to work around it by using shift amounts less than or equal to 4. Try shifting the value by 4 and then by 3.

    Or put the shift amount in a "volatile" variable so it is stored in memory.

    I know these work arounds are annoying, sorry!

    If you can post the preprocessed source, I'll be able to check if it is fixed already in 9.3.0.31 or if we need to fix it in a future release.

    Thanks

  • font.zipThis could explain the issue… the culprits seems to be in a called function which is (correctly) automatically inlined (eve_font_char_multi_glyph, for the records). The program uses an unholy amount of shift in macros to compose control word for a graphics chip so there are many things like

    eve_copro_bypass(((2UL<<30)|(((x)&511UL)<<21)|(((y)&511UL)<<12)|(((handle)&31UL)<<7)|(((cell)&127UL)<<0)));

    which are in the form you said could trigger the bug. Anyway, I'll try the workaround and if all else fails revert to the old compiler.

    Attached the preprocessed file to test. Compile with msp430-elf-gcc -c -mmcu=msp430f5329 -O2 -Wall -Wextra -g2 -mlarge font.i

  • Hi Jozef,

    I have a question that GCC maintenance has been moved to you?

    Eason

  • Thank you very much for providing the test case.

    I can reproduce the the internal compiler error with 9.2.0.50, and can confirm that the bug is fixed in 9.3.0.31. The source compiles without any problems.

    If it is going to be a lot of work to implement the work arounds, I would suggest using the version you were previously using, since 9.3.0.31 should be released very soon and any work arounds will be redundant.

    Regards,

  • Hi Eason,

    Yes, where possible I try to provide support for MSP430-GCC directly. However, if I'm not able to reply within a couple of days then TI should engage with the customer.

    Regards,

  • Hi Jozef,

    It is nice to hear that!

    Eason

**Attention** This is a public forum