Bug 44651 - gcc.target/x86_64/abi/callabi/leaf-[1,2].c fail on darwin
Summary: gcc.target/x86_64/abi/callabi/leaf-[1,2].c fail on darwin
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 00:57 UTC by Jack Howarth
Modified: 2010-09-08 01:06 UTC (History)
4 users (show)

See Also:
Host: x86_64-apple-darwin10
Target: x86_64-apple-darwin10
Build: x86_64-apple-darwin10
Known to work:
Known to fail:
Last reconfirmed: 2010-07-01 17:45:08


Attachments
leaf-1.s from x86_64-apple-darwin10 (389 bytes, text/plain)
2010-06-24 00:59 UTC, Jack Howarth
Details
leaf-2.s from x86_64-apple-darwin10 (664 bytes, text/plain)
2010-06-24 00:59 UTC, Jack Howarth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2010-06-24 00:57:08 UTC
The new testcases...

r161063 | ktietz | 2010-06-21 03:27:19 -0400 (Mon, 21 Jun 2010) | 6 lines

2010-06-21  Kai Tietz  <kai.tietz@onevision.com>

        * gcc.target/x86_64/abi/callabi/leaf-1.c: New.
        * gcc.target/x86_64/abi/callabi/leaf-2.c: New.

fail on x86_64-apple-darwin10 as follows...

FAIL: gcc.target/x86_64/abi/callabi/leaf-1.c scan-assembler-not %rsp
FAIL: gcc.target/x86_64/abi/callabi/leaf-2.c scan-assembler-not %rsp
Comment 1 Jack Howarth 2010-06-24 00:59:09 UTC
Created attachment 20989 [details]
leaf-1.s from x86_64-apple-darwin10
Comment 2 Jack Howarth 2010-06-24 00:59:31 UTC
Created attachment 20990 [details]
leaf-2.s from x86_64-apple-darwin10
Comment 3 Jack Howarth 2010-06-24 01:00:23 UTC
Attached the assembly files generated with...

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ /sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100623/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-1.c -O2 -mabi=sysv -S -o leaf-1.s

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/ /sw/src/fink.build/gcc46-4.6.0-1000/gcc-4.6-20100623/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c   -O2 -mabi=sysv -S  -o leaf-2.s 
Comment 4 Iain Sandoe 2010-07-01 17:45:08 UTC
confirmed,
also on i686-apple-darwin9 @ m64
Comment 5 Jack Howarth 2010-09-04 20:28:08 UTC
My proposed patch to fix PR36502...

http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00237.html

also fixes this regression as can be since from the diff of leaf.s generated with gcc trunk before and after applying my patch...


--- leaf-1.s	2010-09-04 16:26:13.000000000 -0400
+++ leaf-1.s.patched_trunk	2010-09-04 16:24:35.000000000 -0400
@@ -3,11 +3,7 @@
 	.globl _foo
 _foo:
 LFB0:
-	subq	$8, %rsp
-LCFI0:
 	xorl	%eax, %eax
-	addq	$8, %rsp
-LCFI1:
 	ret
 LFE0:
 	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
@@ -39,16 +35,6 @@
 	.set L$set$2,LFE0-LFB0
 	.quad L$set$2
 	.byte	0
-	.byte	0x4
-	.set L$set$3,LCFI0-LFB0
-	.long L$set$3
-	.byte	0xe
-	.byte	0x10
-	.byte	0x4
-	.set L$set$4,LCFI1-LCFI0
-	.long L$set$4
-	.byte	0xe
-	.byte	0x8
 	.align 3
 LEFDE1:
 	.subsections_via_symbols
Comment 6 Jack Howarth 2010-09-04 21:20:58 UTC
Updated patch to reflect the wider coverage of PRs fixed...
http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00365.html
Comment 7 hjl@gcc.gnu.org 2010-09-07 21:19:19 UTC
Subject: Bug 44651

Author: hjl
Date: Tue Sep  7 21:18:55 2010
New Revision: 163971

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163971
Log:
Redefine STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY for Darwin/x86.

gcc/

2010-09-07  H.J. Lu  <hjl.tools@gmail.com>
	    Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	PR target/42313
	PR target/44651
	* gcc/config/i386/darwin.h (STACK_BOUNDARY): Redefine as 128 for
	profiling or 64-bit MS_ABI and as BITS_PER_WORD otherwise.
	(PREFERRED_STACK_BOUNDARY): Replace STACK_BOUNDARY with 128 in
	MAX macro.

gcc/testsuite/

2010-09-07  Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	* gcc.target/i386/pr36502.c: New test.

	PR target/42313
	PR target/44651
	* gcc.target/i386/builtin-unreachable.c: Don't skip on darwin.
	* gcc/testsuite/gcc.dg/stack-usage-1.c: Use default on i386/Darwin.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr36502.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/darwin.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/stack-usage-1.c
    trunk/gcc/testsuite/gcc.target/i386/builtin-unreachable.c

Comment 8 Jack Howarth 2010-09-08 01:06:21 UTC
Fixed on trunk at r163971.
Comment 9 hjl@gcc.gnu.org 2010-09-10 16:13:10 UTC
Subject: Bug 44651

Author: hjl
Date: Fri Sep 10 16:12:46 2010
New Revision: 164197

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164197
Log:
Redefine STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY for Darwin/x86.

gcc/

2010-09-10  Jack Howarth <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-09-07  H.J. Lu  <hjl.tools@gmail.com>
		    Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	PR target/42313
	PR target/44651
	* config/i386/darwin.h (STACK_BOUNDARY): Redefine as 128 for
	profiling or 64-bit MS_ABI and as BITS_PER_WORD otherwise.
	(PREFERRED_STACK_BOUNDARY): Replace STACK_BOUNDARY with 128 in
	MAX macro.

gcc/testsuite/

2010-09-10  Jack Howarth <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-09-07  Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	* gcc.target/i386/pr36502.c: New test.

	PR target/42313
	PR target/44651
	* gcc.target/i386/builtin-unreachable.c: Don't skip on darwin.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr36502.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/i386/darwin.h
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/builtin-unreachable.c