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.

bug in _disable_interrupts() in msp430-elf GCC_RH_20140508.zip

Back when I added intrinsics to mspgcc I got confirmation that CCS and IAR both implicitly added the required NOP after a DINT instruction generated with _disable_interrupts().  (The MSP430 instruction set explains that this is necessary to eliminate the possibility of interrupting a subsequent pipelined instruction.)

The implementation of _disable_interrupts() in in430.h from TI's GCC_RH_20140508.zip does not include this required instruction, making it inconsistent with all other MSP430 toolchains.  (Fortunately, msp430-elf does generate a warning in this situation.)

Interestingly, the implementation of _enable_interrupts() unconditionally adds a NOP after EINT, even though that workaround is arguably required only on certain devices with a specific erratum, and this behavior is AFAIK also inconsistent with other toolchains.

msp430-elf should behave as close to CCS and IAR as possible so developers don't have to work around toolchain-specific inconsistencies in how these operations are implemented.

Please fix this for the next header release. 

Please also add a monotonically increasing version number to in430.h or iomacros.h so applications can work around bugs like this.

Thanks.

Peter