From: MITSUNARI Shigeo <[email protected]>
Thanks for the report.
The check-function-bodies pattern in this test expects the
instruction order produced with generic tuning. With
-march=cascadelake the scheduler reorders the movl and movabsq
instructions, so the (order-sensitive) body match fails; the
generated instructions themselves are unchanged.
The same applies to gcc.target/i386/mulq-highpart.c from r17-2334,
so the patch below fixes both tests by pinning -mtune=generic, as
many other i386 tests do.
Tested on x86_64-linux with both the default target board and
unix{-m64 -march=cascadelake}: both tests pass with the patch and
the reported FAIL is reproducible without it.
I don't have write access, so could someone push this for me?
-- >8 --
Subject: i386: Add -mtune=generic to highpart multiplication tests
The check-function-bodies patterns in bmi2-mulx-highpart-1.c and
mulq-highpart.c expect the instruction order produced with generic
tuning. With -march=cascadelake the scheduler swaps the movl and
movabsq instructions, so pin -mtune=generic.
gcc/testsuite/ChangeLog:
* gcc.target/i386/bmi2-mulx-highpart-1.c: Add -mtune=generic
to dg-options.
* gcc.target/i386/mulq-highpart.c: Likewise.
Signed-off-by: MITSUNARI Shigeo <[email protected]>
---
diff --git a/gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-1.c
b/gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-1.c
index 8b3b6725d1b..ccb9875f828 100644
--- a/gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-1.c
+++ b/gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mbmi2" } */
+/* { dg-options "-O2 -mbmi2 -mtune=generic" } */
/* { dg-final { check-function-bodies "**" "" "" { target *-*-linux* *-*-gnu*
} } } */
/* %edx is fixed by the ISA (implicit mulx source) and %edi by the ABI
diff --git a/gcc/testsuite/gcc.target/i386/mulq-highpart.c
b/gcc/testsuite/gcc.target/i386/mulq-highpart.c
index 56728cd5b7c..fff0eac239a 100644
--- a/gcc/testsuite/gcc.target/i386/mulq-highpart.c
+++ b/gcc/testsuite/gcc.target/i386/mulq-highpart.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mno-bmi2" } */
+/* { dg-options "-O2 -mno-bmi2 -mtune=generic" } */
/* { dg-final { check-function-bodies "**" "" "" { target *-*-linux* *-*-gnu*
} } } */
/* %rax, %rdx and %edi are fixed by the ISA (mulq) and the ABI (first