Hi!

When BMI2 is on, such as for -march=haswell defaulting gcc or when
make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=haswell\}'
etc., these testcases emit sarx which is something the testcases didn't mean
to test, they want to test what kind of insn is emitted to load the shift
count into the cl register for normal shift.

This patch fixes it by adding -mno-bmi2.  Regtested on x86_64-linux and
i686-linux, committed as obvious to trunk.

2017-09-28  Jakub Jelinek  <ja...@redhat.com>

        PR target/82342
        * gcc.target/i386/pr82260-1.c: Add -mno-bmi2 to dg-options.
        * gcc.target/i386/pr82260-2.c: Likewise.

--- gcc/testsuite/gcc.target/i386/pr82260-1.c.jj        2017-09-21 
09:26:42.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/pr82260-1.c   2017-09-27 16:56:13.000000000 
+0200
@@ -1,6 +1,6 @@
 /* PR target/82260 */
 /* { dg-do compile { target lp64 } } */
-/* { dg-options "-Os -mtune=generic -masm=att" } */
+/* { dg-options "-Os -mtune=generic -masm=att -mno-bmi2" } */
 /* movl %esi, %ecx is shorter than movb %sil, %cl.  While
    movl %edx, %ecx is the same size as movb %dl, %cl and
    movl %r8d, %ecx is the same size as movb %r8b, %cl, movl
--- gcc/testsuite/gcc.target/i386/pr82260-2.c.jj        2017-09-21 
09:26:42.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/pr82260-2.c   2017-09-27 16:56:27.000000000 
+0200
@@ -1,6 +1,6 @@
 /* PR target/82260 */
 /* { dg-do compile { target lp64 } } */
-/* { dg-options "-Os -mtune=generic -masm=att 
-mtune-ctrl=^partial_reg_dependency" } */
+/* { dg-options "-Os -mtune=generic -masm=att 
-mtune-ctrl=^partial_reg_dependency -mno-bmi2" } */
 /* { dg-final { scan-assembler-not {\mmovb\t%sil, %cl} } } */
 /* { dg-final { scan-assembler {\mmovl\t%esi, %ecx} } } */
 /* { dg-final { scan-assembler {\mmovb\t%dl, %cl} } } */

        Jakub

Reply via email to