Invalid VLD instruction in compiled code for armv7-a+nosimd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
I would like to update from the old linaro v6.5-latest GCC to the current 10.3 ARM-GCC (arm-linux-
https:/
https:/
If I compile the following program:
#include <map>
#include <iostream>
using namespace std;
int main() {
const map<const char*,int> m = {
{"foo",1},
{"bar",2},
};
for (const auto &[s, i] : m) {
cout << s << " " << i << '\n';
}
return 0;
}
// arm-linux-
The generated code has a VLD instruction, which triggers a SIGILL on the target (SAMA5D3 based board, Cortex-A5). From the datasheet:
The Floating-Point Unit (FPU) supports the ARMv7 VFPv4-D16 architecture without Advanced SIMD extensions (NEON).
I analyzed this by loading the coredump into gdb-multiarch and switching to asm layout:
#0 0x00098060 in memcpy () at ../sysdeps/
293 ../sysdeps/
layout asm
0x98060 <memcpy+32> vld1.8 {d0}, [r1]!
I couldn't find any (combination of) options of mtune, mcpu, march, and, mfpu, with which I could compile a program without the illegal instruction in it.
I have seen that between v6.5 and v10.x the defaults during compiler compilation were changed to --with-fpu=neon.
But based on the GCC-ARM option documentation, I would expect that -mcpu=cortex-
From https:/
For example, ‘cortex-a9’ can be found in three major configurations: integer only, with just a floating-point unit or with floating-point and Advanced SIMD. The default is to enable all the instructions, but the extensions ‘+nosimd’ and ‘+nofp’ can be used to disable just the SIMD or both the SIMD and floating-point instructions respectively.
If I overlooked something, also thanks for pointing that out, but with the bootlin 10.2 toolchain and the same compiler options it works
https:/
description: | updated |
tags: | added: illegal-instruction |
description: | updated |