This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR target/12166 (SPARC)
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Sep 2003 14:33:07 +0200
- Subject: [PATCH] Fix PR target/12166 (SPARC)
Hi,
Programs compiled with -pg crash on exit if the variable PROFDIR is set. This
is a pretty old problem, a regression from egcs-1.1.1:
http://gcc.gnu.org/ml/gcc-patches/1999-03n/msg00038.html
The patch in the message doesn't work on SPARC64, so I've attached a slightly
modified version. Manually tested on
sparc64-sun-solaris2.9
sparc-sun-solaris2.8
sparc-sun-solaris2.7
sparc-sun-solaris2.6
sparc-sun-solaris2.5.1
Ok for 3.3 branch and mainline?
2003-09-18 T. Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/12166
* config/sparc/sol2-c1.asm (start): Set __Argv.
--
Eric Botcazou
Index: config/sparc/sol2-c1.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-c1.asm,v
retrieving revision 1.3
diff -u -r1.3 sol2-c1.asm
--- config/sparc/sol2-c1.asm 16 Dec 1998 21:13:21 -0000 1.3
+++ config/sparc/sol2-c1.asm 18 Sep 2003 12:15:35 -0000
@@ -92,6 +92,10 @@
! access those data anyway. Instead, go straight to main:
mov %l0, %o0 ! argc
mov %l1, %o1 ! argv
+#ifdef GCRT1
+ setn(___Argv, %o4, %o3)
+ stn %o1, [%o3] ! *___Argv
+#endif
! Skip argc words past argv, to env:
sll %l0, CPTRSHIFT, %o2
add %o2, CPTRSIZE, %o2