The tests amended here now have different code-gen with default options because, previously, the access were indirected per Darwin ABI for common accesses. The revised code-gen does not match the expected scan-asms because Darwin defaults to fPIC. For these tests, it seems that the best solution is to use '-mdynamic-no-pic' in the m32 case which makes the output similar to the ElF platform default.
tested on x86_64-dawin16, x86_64-linux-gnu applied to mainline thanks Iain gcc/testsuite/ChangeLog: 2019-11-22 Iain Sandoe <i...@sandoe.co.uk> * gcc.target/i386/pr27971.c: Use mdynamic-no-pic for m32 on Darwin. * gcc.target/i386/sse2-load-multi.c: Likewise. * gcc.target/i386/sse2-store-multi.c: Likewise. diff --git a/gcc/testsuite/gcc.target/i386/pr27971.c b/gcc/testsuite/gcc.target/i386/pr27971.c index 149bf2b..f80cb65 100644 --- a/gcc/testsuite/gcc.target/i386/pr27971.c +++ b/gcc/testsuite/gcc.target/i386/pr27971.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-tbm" } */ +/* { dg-additional-options "-mdynamic-no-pic" { target { *-*-darwin* && ia32 } } } */ unsigned array[4]; @@ -16,3 +17,4 @@ unsigned foo(TYPE x) /* { dg-final { scan-assembler-not "shr\[^\\n\]*2" } } */ /* { dg-final { scan-assembler "and\[^\\n\]*12" } } */ + \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/i386/sse2-load-multi.c b/gcc/testsuite/gcc.target/i386/sse2-load-multi.c index 9276054..3ee0ef8 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-load-multi.c +++ b/gcc/testsuite/gcc.target/i386/sse2-load-multi.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-march=corei7 -O2" } */ +/* { dg-additional-options "-mdynamic-no-pic" { target { *-*-darwin* && ia32 } } } */ #include <emmintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/sse2-store-multi.c b/gcc/testsuite/gcc.target/i386/sse2-store-multi.c index 203a00f..ca04934 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-store-multi.c +++ b/gcc/testsuite/gcc.target/i386/sse2-store-multi.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-march=corei7 -O2" } */ +/* { dg-additional-options "-mdynamic-no-pic" { target { *-*-darwin* && ia32 } } } */ #include <emmintrin.h>