This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Beware of GNU-ARM compiler for Cortex-M0/M0+/M1

The popular GNU-ARM toolset has had long-known issues for the Cortex-M0/M0+/M1 (ARMv6-M architecture). Specifically, people have reported very inefficient code generated, see "Cortex M0/M0+/M1/M23 BAD Optimisation in GCC" https://embdev.net/topic/426508 . 

But while so far people reported only inefficient code, I would like to make people aware of *incorrect* code generated by GNU-ARM for Cortex-M0/M0+. 

The issue was detected with interrupt disabling and has been documented in a bug report for the QP framework, see https://sourceforge.net/p/qpc/bugs/184/. The experiments performed with the latest available GUN-ARM (GNU Tools for ARM Embedded Processors 6-2017-q2-update, 6.3.1 20170620 release) clearly show incorrect code generated at optimization level -O, while the same code compiled at -O2 level seemed to be correct. 

Please be careful with GNU-ARM for ARMv6-M architecture and preferably avoid using it for these CPUs as long as the issue remains unresolved. 

Miro Samek 
state-machine.com 
Parents
  • Hi Miro,

    I've posted a reply to the sourceforge bug report you mention. Let's try to continue this discussion on our launchpad page and if we can confirm it is a bug in the compiler we will look into it and provide a fix. Correctness is of the utmost importance to us, so while bugs do happen fixing them is our priority.

    Please note that we cannot monitor every single forum out there for people reporting bugs so if you suspect you found an issue with our toolchain in the future, please let us know either here, on our launchpad pages [1][2] or on GCC's bugzilla (only if you are confident that the bug is also present on stock GCC compiler)

    [1] https://bugs.launchpad.net/gcc-arm-embedded
    [2] https://answers.launchpad.net/gcc-arm-embedded
    [3] https://gcc.gnu.org/bugzilla/

    Best regards,

    Thomas [on behalf of the GNU Arm Embedded Toolchain team]

Reply
  • Hi Miro,

    I've posted a reply to the sourceforge bug report you mention. Let's try to continue this discussion on our launchpad page and if we can confirm it is a bug in the compiler we will look into it and provide a fix. Correctness is of the utmost importance to us, so while bugs do happen fixing them is our priority.

    Please note that we cannot monitor every single forum out there for people reporting bugs so if you suspect you found an issue with our toolchain in the future, please let us know either here, on our launchpad pages [1][2] or on GCC's bugzilla (only if you are confident that the bug is also present on stock GCC compiler)

    [1] https://bugs.launchpad.net/gcc-arm-embedded
    [2] https://answers.launchpad.net/gcc-arm-embedded
    [3] https://gcc.gnu.org/bugzilla/

    Best regards,

    Thomas [on behalf of the GNU Arm Embedded Toolchain team]

Children