On 7/12/21 12:11 PM, Michael Meissner wrote:
On Mon, Jul 12, 2021 at 10:49:26AM -0500, Bill Schmidt wrote:
Hi Mike,

On 7/7/21 3:00 PM, Michael Meissner wrote:
[PATCH] Fix vec-splati-runnable.c test.

I noticed that the vec-splati-runnable.c did not have an abort after one
of the tests.  If the test was run with optimization, the optimizer could
delete some of the tests and throw off the count.  However, due to the
fact that the value being loaded in that test is undefined, I did not
check what value was loaded, but I just stored it into a volatile global
variable.

2021-07-07  Michael Meissner  <meiss...@linux.ibm.com>

gcc/testsuite/
        * gcc.target/powerpc/vec-splati-runnable.c: Run test with -O2
        optimization.  Do not check what XXSPLTIDP generates if the value
        is undefined.
---
  .../gcc.target/powerpc/vec-splati-runnable.c  | 29 ++++++-------------
  1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c 
b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
index e84ce77a21d..a135279b1d7 100644
--- a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
@@ -1,7 +1,7 @@
  /* { dg-do run { target { power10_hw } } } */
  /* { dg-do link { target { ! power10_hw } } } */
  /* { dg-require-effective-target power10_ok } */
-/* { dg-options "-mdejagnu-cpu=power10 -save-temps" } */
+/* { dg-options "-mdejagnu-cpu=power10 -save-temps -O2" } */
Why did you restrict optimization here?  The tests should be run at
various opt levels if you don't specify this, right?

The test changes are otherwise okay, but I'd like to understand this first.
When doing tests with instruction counts, you always want to specify the
optimization level (with -O2 being the standard).  Otherwise, depending on the
other optimizations, the instruction counts might not line up.

In this particular case, because it didn't have an optimization flag, the
original code was compiled with -O0.  If you compile it with -O1, it deletes
the if statement with the empty then statement, and deletes the corresponding
XXSPLTIDP instruction.

Sorry, yes.  I thought this set of tests was run with all optimization flags, but it is not.  Objection withdrawn. :-)

I can't approve, but recommend approval as is.

Thanks,
Bill

Reply via email to