GCC 11.2 - Illegal instruction in the numeric_limits<float>::max() function when including <limits>

Bug #1970029 reported by Carlos GP
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

# arm-none-eabi-g++ --version
arm-none-eabi-g++ (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 11.2.1 20220111
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# cat main.cpp
#include <limits>

int main()
{}

# arm-none-eabi-g++ -std=c++14 main.cpp
In file included from main.cpp:1:
/opt/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/arm-none-eabi/include/c++/11.2.1/limits:1676:7: internal compiler error: Illegal instruction
 1676 | max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
      | ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.linaro.org/> for instructions.

Tags: g++
tags: added: g++
Revision history for this message
Allen Blaylock (allenb-epg) wrote :

This may be related to these posts:
1) https://bugs.launchpad.net/gcc-arm-embedded/+bug/1970028
2) https://community.arm.com/support-forums/f/compilers-and-libraries-forum/52377/internal-compiler-errors-with-arm-none-eabi-gcc-11-2-2022-02-on-macs-with-apple-silicon
3) https://<email address hidden>/msg709750.html

I found that recompiling the compiler using the instructions provided in the "How to build the toolchain from sources" of the 11.2 release notes resolved the Illegal instruction error. I assume when the pre-packaged GCC was built it was targeting a newer x86_64 architecture than your processor (as was the case in my case).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.