[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)
Chris Copeland via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 23 04:20:14 PST 2024
================
@@ -16,7 +16,7 @@
// RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.call_thin.bc -DCALL_LIB
// RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.define_thin.bc -DDEFINE_LIB
-// RUN: llvm-lto2 run -o %t.lto_thin -save-temps %t.call_thin.bc %t.define_thin.bc \
+// RUN: llvm-lto2 run --mcpu=cortex-m33 --float-abi=hard -o %t.lto_thin -save-temps %t.call_thin.bc %t.define_thin.bc \
----------------
chrisnc wrote:
To test this theory, I had the error output the function name just like the nearby check for thumb does, and this is what I get when running this test unmodified:
`The hard-float ABI is enabled for function 'llvm.lifetime.start.p0', but the target lacks floating-point registers.`
This means that this function was being generated during LTO itself with an invalid target+ABI combination. Depending on what this functions parameters are, that could lead to incorrect behavior, so in general, it may not be safe to LTO without enough features enabled to support the ABI that the compiled inputs use, and it is good for LLVM to complain about this rather than potentially emit erroneous code.
https://github.com/llvm/llvm-project/pull/111334
More information about the llvm-commits
mailing list