Bug 58321 - FAIL: gcc.target/i386/memcpy-strategy-3.c scan-assembler-times memcpy 2 on x86_64-apple-darwin*
Summary: FAIL: gcc.target/i386/memcpy-strategy-3.c scan-assembler-times memcpy 2 on x...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 7.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-05 10:48 UTC by Dominique d'Humieres
Modified: 2019-09-08 12:33 UTC (History)
5 users (show)

See Also:
Host: x86_64-apple-darwin*
Target: x86_64-apple-darwin*
Build: x86_64-apple-darwin*
Known to work:
Known to fail:
Last reconfirmed: 2014-03-10 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique d'Humieres 2013-09-05 10:48:43 UTC
The tests gcc.target/i386/memcpy-strategy-3.c and memset-strategy-1.c on x86_64-apple-darwin*

FAIL: gcc.target/i386/memcpy-strategy-3.c scan-assembler-times memcpy 2
FAIL: gcc.target/i386/memset-strategy-1.c scan-assembler-times memset 2

Running the test manually I get

[macbook] f90/bug% grep memset memset-strategy-1.s
	jmp	_memset
[macbook] f90/bug% grep memcpy memcpy-strategy-3.s
	call	_memcpy
Comment 1 Dominique d'Humieres 2014-03-10 22:28:08 UTC
Still present at r208448 (see http://gcc.gnu.org/ml/gcc-testresults/2014-03/msg00667.html).
Comment 2 Dominique d'Humieres 2014-09-27 13:18:31 UTC
Would the following patch be acceptable?

--- ../_clean/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c	2014-05-10 23:13:06.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c	2014-09-27 15:15:50.000000000 +0200
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -march=atom -mmemcpy-strategy=vector_loop:2000:align,libcall:-1:align" } */
-/* { dg-final { scan-assembler-times "memcpy" 2  } } */
+/* { dg-final { scan-assembler-times "memcpy" 2 { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-times "memcpy" 1 { target i?86-*-darwin* x86_64-*-darwin* } } } */
 
 char a[2048];
 char b[2048];
--- ../_clean/gcc/testsuite/gcc.target/i386/memset-strategy-1.c	2014-05-10 23:13:02.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/memset-strategy-1.c	2014-09-27 15:14:08.000000000 +0200
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -march=atom -mmemset-strategy=libcall:-1:align" } */
-/* { dg-final { scan-assembler-times "memset" 2  } } */
+/* { dg-final { scan-assembler-times "memset" 2 { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-times "memset" 1 { target i?86-*-darwin* x86_64-*-darwin* } } } */
 
 char a[2048];
 void t (void)
Comment 3 Dominique d'Humieres 2015-01-31 13:44:03 UTC
Still present at r220301 (see https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg03581.html). Does the patch in comment 2 makes sense or is there a better fix?
Comment 4 Jack Howarth 2015-04-13 13:55:55 UTC
ping
Comment 5 Eric Gallager 2018-02-19 04:28:23 UTC
(In reply to Dominique d'Humieres from comment #3)
> Still present at r220301 (see
> https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg03581.html). Does the
> patch in comment 2 makes sense or is there a better fix?

Try sending it to gcc-patches for review
Comment 6 Eric Gallager 2019-05-20 11:44:21 UTC
(In reply to Dominique d'Humieres from comment #3)
> Still present at r220301 (see
> https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg03581.html). Does the
> patch in comment 2 makes sense or is there a better fix?

cc-ing FX from that
Comment 7 Iain Sandoe 2019-05-20 11:52:37 UTC
(In reply to Eric Gallager from comment #6)
> (In reply to Dominique d'Humieres from comment #3)
> > Still present at r220301 (see
> > https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg03581.html). Does the
> > patch in comment 2 makes sense or is there a better fix?
> 
> cc-ing FX from that

I have a local patch for this too, which I'm intending to apply as time permits.  The main difference is explaining the reason that Darwin is different - and simplifying the condition.

 /* { dg-do compile } */
 /* { dg-options "-O2 -march=atom -mmemcpy-strategy=vector_loop:2000:align,libcall:-1:align" } */
-/* { dg-final { scan-assembler-times "memcpy" 2  } } */
+/* one hit comes from the .file directive.  */
+/* { dg-final { scan-assembler-times "memcpy" 2 { target { ! *-*-darwin* } } } } */
+/* but not on Darwin.  */
+/* { dg-final { scan-assembler-times "_memcpy" 1  { target *-*-darwin* } } } */
 
 char a[2048];
 char b[2048];
Comment 8 Iain Sandoe 2019-05-20 12:28:49 UTC
Author: iains
Date: Mon May 20 12:28:18 2019
New Revision: 271415

URL: https://gcc.gnu.org/viewcvs?rev=271415&root=gcc&view=rev
Log:
darwin, testsuite - fix PR58321

Darwin doesn't emit a .file directive by default
and one of the scan-asm hits for ELF targets comes from
this directive. Adjust for Darwin and explain.

2019-05-20  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c
    trunk/gcc/testsuite/gcc.target/i386/memset-strategy-1.c
Comment 9 Iain Sandoe 2019-08-04 09:54:08 UTC
Author: iains
Date: Sun Aug  4 09:53:37 2019
New Revision: 274058

URL: https://gcc.gnu.org/viewcvs?rev=274058&root=gcc&view=rev
Log:
Darwin, X86, backport fix for PR58321.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-20  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.


Modified:
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c
    branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/memset-strategy-1.c
Comment 10 Iain Sandoe 2019-08-04 09:54:46 UTC
fixed for trunk and 9.2
Comment 11 Iain Sandoe 2019-08-28 19:27:38 UTC
Author: iains
Date: Wed Aug 28 19:27:06 2019
New Revision: 275002

URL: https://gcc.gnu.org/viewcvs?rev=275002&root=gcc&view=rev
Log:
[Darwin, testsuite ] Backport fix for PR58321.

gcc/testsuite/

2019-08-28  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-20  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.


Modified:
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c
    branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/memset-strategy-1.c
Comment 12 Iain Sandoe 2019-08-28 19:43:09 UTC
fixed for 8.4
Comment 13 Iain Sandoe 2019-09-06 15:51:32 UTC
Author: iains
Date: Fri Sep  6 15:51:01 2019
New Revision: 275466

URL: https://gcc.gnu.org/viewcvs?rev=275466&root=gcc&view=rev
Log:
[Darwin, testsuite ] Fix for PR58321.

Darwin doesn't emit a .file directive by default
and one of the scan-asm hits for ELF targets comes from
this directive. Adjust for Darwin and explain.

2019-09-06  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-20  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.


Modified:
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c
    branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/memset-strategy-1.c
Comment 14 Dominique d'Humieres 2019-09-08 12:33:05 UTC
Fixed in all open branches, closing.