]> granicus.if.org Git - clang/commit
[ARM] Fix recent breakage of -mfpu=none.
authorSimon Tatham <simon.tatham@arm.com>
Mon, 3 Jun 2019 11:02:53 +0000 (11:02 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Mon, 3 Jun 2019 11:02:53 +0000 (11:02 +0000)
commita6289dec43c7e84385a4b865db7cba66333f90a1
treee444931d72abe893062d93ab1e490b444b35480e
parent6137a708dd64da59e28c5ede4fa3157d25613823
[ARM] Fix recent breakage of -mfpu=none.

The recent change D60691 introduced a bug in clang when handling
option combinations such as `-mcpu=cortex-m4 -mfpu=none`. Those
options together should select Cortex-M4 but disable all use of
hardware FP, but in fact, now hardware FP instructions can still be
generated in that mode.

The reason is because the handling of FPUVersion::NONE disables all
the same feature names it used to, of which the base one is `vfp2`.
But now there are further features below that, like `vfp2d16fp` and
(following D60694) `fpregs`, which also need to be turned off to
disable hardware FP completely.

Added a tiny test which double-checks that compiling a simple FP
function doesn't access the FP registers.

Reviewers: SjoerdMeijer, dmgreen

Reviewed By: dmgreen

Subscribers: lebedev.ri, javed.absar, kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D62729

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362380 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/Arch/ARM.cpp
test/CodeGen/arm-mfpu-none.c [new file with mode: 0644]
test/Driver/arm-mfpu.c