"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? If that's correct either we should consider also TARGET_HAVE_MVE and TARGET_HAVE_MVE_FLOAT into arm_cpu_builtins when deciding for the __SOFTFP__ definition or account them for our internal TARGET_SOFT_FLOAT. I guess the first is less invasive. I'll come up with a patch unless I'm told that this is not a bug. Andrea