Hi, PR70957 reports that the two subject tests fail on an older P7 machine. These tests rely on built-ins that exploit POWER9 vector support. It turns out that the failure occurs because the configured assembler is downlevel, and does not support even POWER8 instructions. This causes TARGET_P8_VECTOR to be set to false, which in turn causes TARGET_P9_VECTOR to be set to false, so the built-ins in question are not linked into the overloaded built-in table.
The only way I know to make the test predictable is to use a run-time test to check whether P9 vector instructions will execute. Thus this solution. I’ve verified we no longer have test failures on machines with a downlevel assembler, and the tests run correctly on machines with an up-to-date assembler. Is this ok for trunk and 6.2? Thanks, Bill [2016-06-02] Bill Schmidt <wschm...@linux.vnet.ibm.com> PR target/70957 * gcc.target/powerpc/vsx-elemrev-2.c: Require p9vector hardware support. * gcc.target/powerpc/vsx-elemrev-4.c: Likewise. Index: gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c (revision 237044) +++ gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c (working copy) @@ -1,6 +1,7 @@ /* { dg-do compile { target { powerpc64le*-*-* } } } */ /* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ /* { dg-options "-mcpu=power9 -O0" } */ +/* { dg-require-effective-target p9vector_hw } */ /* { dg-final { scan-assembler-times "lxvd2x" 6 } } */ /* { dg-final { scan-assembler-times "lxvw4x" 6 } } */ /* { dg-final { scan-assembler-times "lxvh8x" 4 } } */ Index: gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c (revision 237044) +++ gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c (working copy) @@ -1,6 +1,7 @@ /* { dg-do compile { target { powerpc64-*-* } } } */ /* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ /* { dg-options "-mcpu=power9 -O0" } */ +/* { dg-require-effective-target p9vector_hw } */ /* { dg-final { scan-assembler-times "lxvx" 40 } } */ /* { dg-final { scan-assembler-times "stxvx" 40 } } */