GCC 11.2 - Illegal instruction in the numeric_limits<float>::max() function when including <limits>
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-
1676 | max() _GLIBCXX_
| ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https:/
This may be related to these posts: /bugs.launchpad .net/gcc- arm-embedded/ +bug/1970028 /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 /msg709750. html
1) https:/
2) https:/
3) https://<email address hidden>
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).