Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm-none-eabi-gcc internal compiler error in arm_max_no_idx_f16 #242

Closed
loregualni opened this issue Mar 14, 2025 · 3 comments
Closed

arm-none-eabi-gcc internal compiler error in arm_max_no_idx_f16 #242

loregualni opened this issue Mar 14, 2025 · 3 comments
Labels
DONE Issue done but not yet closed question Further information is requested

Comments

@loregualni
Copy link

Hi, I encountered an issue with GCC ARM toolchain when trying to compile CMSIS-DSP from source for a Cortex-M55 MCU.

CMSIS-DSP is a dependency of the following ARM repo: mlek and I was trying to compile the examples for the "simple_platform" target.

Here is the output of make:

[ 15%] Built target cmsis-nn
[ 15%] Built target cmsis_device
[ 16%] Built target ethosu_core_driver
[ 36%] Built target tflu
[ 36%] Building C object math/CMakeFiles/cmsis-dsp.dir/__/__/dependencies/cmsis-dsp/Source/StatisticsFunctions/arm_max_no_idx_f16.c.obj
/home/gualor/git/ml-embedded-evaluation-kit/dependencies/cmsis-dsp/Source/StatisticsFunctions/arm_max_no_idx_f16.c: In function 'arm_max_no_idx_f16':
/home/gualor/git/ml-embedded-evaluation-kit/dependencies/cmsis-dsp/Source/StatisticsFunctions/arm_max_no_idx_f16.c:107:1: error: unrecognizable insn:
  107 | }
      | ^
(insn 41 40 42 8 (set (reg:HF 148 [ _49 ])
        (if_then_else:HF (lt (reg:CCFPE 100 cc)
                (const_int 0 [0]))
            (reg/v:HF 127 [ newVal ])
            (reg/v:HF 117 [ maxValue ]))) -1
     (nil))
during RTL pass: vregs
/home/gualor/git/ml-embedded-evaluation-kit/dependencies/cmsis-dsp/Source/StatisticsFunctions/arm_max_no_idx_f16.c:107:1: internal compiler error: in extract_insn, at recog.cc:2812
0x19e6fb8 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
	???:0
0x19e7e57 internal_error(char const*, ...)
	???:0
0x6d9673 fancy_abort(char const*, int, char const*)
	???:0
0x6b490b _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	???:0
0x6b4927 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	???:0
0x6b3df8 extract_insn(rtx_insn*) [clone .cold]
	???:0
0x987dad (anonymous namespace)::pass_instantiate_virtual_regs::execute(function*)
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.linaro.org/> for instructions.
make[2]: *** [math/CMakeFiles/cmsis-dsp.dir/build.make:2078: math/CMakeFiles/cmsis-dsp.dir/__/__/dependencies/cmsis-dsp/Source/StatisticsFunctions/arm_max_no_idx_f16.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1696: math/CMakeFiles/cmsis-dsp.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

The problem seems related to the _Float16 macro used here:
if ((_Float16)minValue > (_Float16)newVal)

I am working on WSL2 environment running Ubuntu22, here is the versions of the tools:

Cmake: 3.30.5
Make: 4.3
Arm GNU Toolchain: 14.2.Rel1

Compilation flags are the ones specified in the ml-embedded-evaluation-kit/scripts/cmake/cmsis-dsp.cmake e.g., ARM_MATH_LOOPUNROLL.

BR,
Lorenzo

@christophe0606
Copy link
Contributor

@loregualni You should report this to the compiler team.
Support for half floats in compilers can still cause some issues in some cases. If you don't need half floats for the MLEK you can disable it by setting the CMSIS-DSP cmake option DISABLEFLOAT16 to ON.

@christophe0606 christophe0606 added question Further information is requested DONE Issue done but not yet closed labels Mar 17, 2025
@loregualni
Copy link
Author

@christophe0606 Thanks for the response. I agree this is a compiler issue, I opened the issue here (not sure if is the right place).

Anyway, probably also ML team should be notified that any examples in mlek that depends on CMSIS-DSP cannot be compiled with GCC toolchain as of today.

I will apply your Cmake option for the moment, thank you.

BR,
Lorenzo

@christophe0606
Copy link
Contributor

@loregualni I have reported the issue to MLEK team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONE Issue done but not yet closed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants