Bug 10900 - [darwin] trampolines crash
Summary: [darwin] trampolines crash
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: 3.3.1
Assignee: Stan Shebs
URL:
Keywords: build, wrong-code
Depends on:
Blocks:
 
Reported: 2003-05-21 10:16 UTC by Adriaan van Os
Modified: 2003-10-14 22:22 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-apple-darwin
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adriaan van Os 2003-05-21 10:16:01 UTC
trampolines crash on apple-powerpc-darwin (known for a long time, but still not fixed in gcc-3.3)

Release:
gcc-3.3

Environment:
apple-powerpc-darwin 6.4
ppc7400
Comment 1 Adriaan van Os 2003-05-21 10:16:01 UTC
Fix:
# bug fix for trampolines (Andrew Reynolds)

*** gcc/config/rs6000/darwin-tramp.asm.orig	Sat Dec 29 09:07:56 2001
--- gcc/config/rs6000/darwin-tramp.asm	Mon Feb 10 01:55:39 2003
***************
*** 60,75 ****

  	.globl ___trampoline_setup
  ___trampoline_setup:
! 	mflr	r0		/* save return address */
!         bcl 20,31,LCF0		/* load up __trampoline_initial into r7 */
! LCF0:
!         mflr	r11
!         addi	r7,r11,ha16(LTRAMP-LCF0)
! 	lwz	r7,lo16(LTRAMP-LCF0)(r7)
! 	subi	r7,r7,4
! 	li	r8,trampoline_size	/* verify trampoline big enough */
! 	cmpw	cr1,r8,r4
! 	srwi	r4,r4,2		/* # words to move */
  	addi	r9,r3,-4	/* adjust pointer for lwzu */
  	mtctr	r4
  	blt	cr1,Labort
--- 60,74 ----

  	.globl ___trampoline_setup
  ___trampoline_setup:
!  		mflr	r0		/* save return address */
!           bcl 20,31,LCF0		/* load up __trampoline_initial into r7 */
!  LCF0:
!  Ltrampoline_address = Ltrampoline_initial-4-.
!          mflr	r11
!          addi	r7,r11,Ltrampoline_address
!  	li	r8,trampoline_size	/* verify trampoline big enough */
!  	cmpw	cr1,r8,r4
!  	srwi	r4,r4,2		/* # words to move */
  	addi	r9,r3,-4	/* adjust pointer for lwzu */
  	mtctr	r4
  	blt	cr1,Labort
***************
*** 124,131 ****
  #else
  	bl	_abort
  #endif
- .data
- 	.align 2
- LTRAMP:
- 	.long Ltrampoline_initial

--- 123,126 ----
Comment 2 Wolfgang Bangerth 2003-05-21 14:07:57 UTC
Responsible-Changed-From-To: unassigned->shebs
Responsible-Changed-Why: Stan, can you take a look? There's even a patch in this PR.
    Thanks
      W.
Comment 3 Dara Hazeghi 2003-07-05 20:01:58 UTC
Confirmed still present on mainline sources (20030705). Sent a mail to the list, so hopefully 
somebody will review this soon.
Comment 4 Andrew Pinski 2003-07-06 02:14:08 UTC
This patch is needed for Ada support.
Comment 5 Adriaan van Os 2003-07-06 08:58:11 UTC
Subject: Re:  [mac os x] trampolines crash

pinskia at physics dot uc dot edu wrote:

> This patch is needed for Ada support.

It is also needed for Pascal support.

Regards,

Adriaan van Os

Comment 6 Andrew Pinski 2003-07-06 16:57:17 UTC
This should be fixed for 3.3.2 because it blocks Ada building and Pascal building (hopefully Pascal 
gets included for 3.5).
Comment 7 Joseph S. Myers 2003-07-06 17:00:11 UTC
Subject: Re:  [mac os x] trampolines crash

On Sun, 6 Jul 2003, gcc at microbizz dot nl wrote:

> It is also needed for Pascal support.

Are there any plans to merge Pascal into the GCC distribution?  Stage 1
for GCC 3.4 has now ended, so it's probably too late for 3.4, but maybe
for 3.5?

Comment 8 Adriaan van Os 2003-07-07 15:22:06 UTC
Subject: Re:  [darwin] trampolines crash

jsm at polyomino dot org dot uk wrote:

>> It is also needed for Pascal support.
>
> Are there any plans to merge Pascal into the GCC distribution?  Stage 1
> for GCC 3.4 has now ended, so it's probably too late for 3.4, but maybe
> for 3.5?

There are no immediate plans to merge Pascal into the GCC distribution, 
but for most platforms GCC releases are followed closely. The GNU 
Pascal for Mac OS X compiler (www.microbizz.nl/gpc.html) is in need of 
two important fixes in the GCC back-end, PR 10900 and 10901.

Regards,

Adriaan van Os

Comment 9 CVS Commits 2003-07-07 17:27:58 UTC
Subject: Bug 10900

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dalej@gcc.gnu.org	2003-07-07 17:27:53

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: darwin-tramp.asm 

Log message:
	Fix PR 10900.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.377&r2=2.378
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/darwin-tramp.asm.diff?cvsroot=gcc&r1=1.2&r2=1.3

Comment 10 CVS Commits 2003-07-07 17:31:51 UTC
Subject: Bug 10900

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	dalej@gcc.gnu.org	2003-07-07 17:31:46

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: darwin-tramp.asm 

Log message:
	Fix PR 10900.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.638&r2=1.16114.2.639
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/darwin-tramp.asm.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2&r2=1.2.42.1

Comment 11 Andrew Pinski 2003-07-07 17:37:28 UTC
Fixed for 3.3.1 and 3.4. Thanks Dale.
Comment 12 Adriaan van Os 2003-07-08 07:19:37 UTC
Subject: Re:  [darwin] trampolines crash

I can confirm that the patch works for Pascal.

Thanks,

Adriaan van Os

Comment 13 Andrew Pinski 2003-10-14 22:22:14 UTC
This was really fixed for 3.3.1.