Andrea Corallo via Gcc-patches <gcc-patches@gcc.gnu.org> writes: > "Richard Earnshaw (lists)" <richard.earns...@arm.com> writes: > >> On 26/11/2020 13:53, Andrea Corallo via Gcc-patches wrote: >>> Hi all, >>> >>> I'd like to submit the following simple patch to clean some Low Loop >>> Overhead test failing on hard float configurations. >>> >>> lob2.c and lob5.c are failing with: "'-mfloat-abi=hard': selected >>> processor lacks an FPU". >>> >>> lob3.c and lob5.c got "-mfloat-abi=soft and -mfloat-abi=hard may not >>> be used together". >>> >>> Okay for trunk? >>> >>> Thanks >>> Andrea >>> >>> >> >> I think it would be better to try to do this with suitable >> require-effective-target rules (or something similar). Forcing options >> should generally be a last resort and in particular using -mfpu should >> really be avoided as we're trying to move away from that. >> >> diff --git a/gcc/testsuite/gcc.target/arm/lob4.c >> b/gcc/testsuite/gcc.target/arm/lob4.c >> ... >> -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { >> "-marm" "-mcpu=*" } } */ >> +/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { >> "-marm" "-mcpu=*" "-mfloat-abi=hard" } } */ >> /* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps >> -mfloat-abi=soft" } */ >> /* { dg-require-effective-target arm_softfloat } */ >> >> Why is the effective target arm_softfloat not solving this particular >> conflict? > > Good point, > > I see is because we are defining __SOFTFP__ when compiling with > '-march=armv8.1-m.main+mve -mfloat-abi=hard'. > > This sounds like a bug to me, correct?
Hi Richard, diving into it further I've been explained by a knowledgeable colleague that '__SOFTFP__' indicates the use of emulated FP operations but says nothing about the ABI, indeed this last is what we want to check here to avoid the conflict. OTOH our selector 'arm_softfloat' IIUC is claimed to select the ABI [1] "ARM target uses the soft-float ABI with no floating-point instructions used whatsoever (as selected with -mfloat-abi=soft). " but is looking at '__SOFTFP__'. What should be the right fix then? Should we leave the skip "-mfloat-abi=hard" into the patch and update the doc of the selector? Thanks Andrea [1] https://gcc.gnu.org/onlinedocs/gccint/Effective-Target-Keywords.html