[Bug driver/83206] -mfpu=auto does not work on ARM (armv7l-unknown-linux-gnueabihf)

andrewm.roberts at sky dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 5 07:32:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83206

--- Comment #14 from Andrew Roberts <andrewm.roberts at sky dot com> ---
Richard, I have checked with latest snapshot (20171203) and problem persists.

I think the issue is that the CPU on the original Raspberry Pi and Pi Zero is
not detected properly by gcc. 

/usr/local/gcc/bin/gcc -mcpu=native -Q --help=target | grep mcpu=
  -mcpu=                                arm1176jz-s

But the processor is actually an arm1176jzf-s

Using:
/usr/local/gcc/bin/gcc -o matrix-v6  -mcpu=arm1176jzf-s  -mfpu=auto -O3
matrix.c
works

whereas using -mcpu=native or -mcpu=arm1176jz-s fails (no FPU).

gcc seems to parse /proc/cpuinfo to get the MIDR details and this is correct
(as far as it goes). But it doesn't parse the Features line to get the FPU
details. Which is the only way of telling the arm1176jz-s from arm1176jzf-s (as
Linux doesn't give access to control registers).

On Raspberry Pi B/Zero:
Features        : half thumb fastmult vfp edsp java tls

I've attached /proc/cpuinfo for all arm processors I have.

While looking at this it might be worth also looking at bug 83207 (big/little
cpu detection) as that is just a case of parsing out both processors from the
/proc/cpuinfo file (see odroid-xu4 file)

It might be worth soliciting additional /proc/cpuinfo files from the mailing
list, if anybody has them.


More information about the Gcc-bugs mailing list