[patch, testsuite, ARM] don't try to execute advsimd-intrinsics tests on hardware without NEON

James Greenhalgh james.greenhalgh@arm.com
Wed Jun 3 18:10:00 GMT 2015


On Thu, May 21, 2015 at 06:33:37AM +0100, Sandra Loosemore wrote:
> ARM testing shares the AArch64 advsimd-intrinsics execution tests.  On 
> ARM, though, the NEON support being tested is optional -- some arches 
> are compatible with the NEON compilation options but hardware available 
> for testing might or might not be able to execute those instructions. 
> In arm-none-eabi testing of a long list of multilibs, I found that this 
> problem caused some of the multilibs to get stuck for days because every 
> one of these execution tests was wandering off into the weeds and timing 
> out.
> 
> The vect.exp tests already handle this by setting dg-do-what-default to 
> either "run" or "compile", depending on whether we have target hardware 
> execution support (arm_neon_hw) for NEON, or only compilation support 
> (arm_neon_ok).  So, I've adapted that logic for advsimd-intrinsics.exp 
> too.
> 
> It also appeared that the main loop over the test cases was running them 
> all twice with the torture options -- once using c-torture-execute and 
> once using gcc-dg-runtest.  I deleted the former since it appears to 
> ignore dg-do-what-default and always try to execute no matter what.  My 
> dejagnu-fu isn't the strongest and this is pretty confusing to me.... 
> am I missing something here?  Otherwise, OK to commit?

Hi Sandra,

This has caused some issues for my multilib testing. Summarised below,
with some help from Alan Lawrence.

Basically the problem occurs when a target which is not OK for Neon
runs before another target. The dg-do-what-default is not restored
when ![check_effective_target_arm_neon_ok]. More details inline...

> Index: gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp
> ===================================================================
> --- gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp	(revision 223468)
> +++ gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp	(working copy)
> @@ -32,9 +32,20 @@ load_lib torture-options.exp
>  
>  dg-init
>  
> -if {[istarget arm*-*-*]
> -    && ![check_effective_target_arm_neon_ok]} then {
> -  return
> +# The default action for a test is 'run'.  Save current default.
> +global dg-do-what-default
> +set save-dg-do-what-default ${dg-do-what-default}
> +set dg-do-what-default run

This overrides the dg-do-what-default

> +
> +# For ARM, make sure that we have a target compatible with NEON, and do
> +# not attempt to run execution tests if the hardware doesn't support it.
> +if {[istarget arm*-*-*]} then {
> +    if {![check_effective_target_arm_neon_ok]} then {
> +      return

And this return path does not restore it.

Adding:

> +set dg-do-what-default ${save-dg-do-what-default}

before the return would seem like the right way to fix the issue.

I'll spin a patch tomorrow if someone else doesn't beat me to it.

Thanks,
James



More information about the Gcc-patches mailing list