Programs compiled with profiling (-pg) will crash on termination and not write any output profile data. This occurs when the environment variable PROFDIR is set. This bug appears to have been spotted and a patch provided some time ago, however the patch does not appear to be present in the 3.3 source tree. Here is a URL for the original patch which also contains a better description of the issue than I can manage: http://gcc.gnu.org/ml/gcc-patches/1999-03n/msg00038.html
The patch referenced in the original report has been tested and successfully resolves the issue.
Confirmed. Regression from egcs-1.1.1 according to Theodore.
Taking care of Theodore's patch.
The original patch doesn't work on SPARC64. The 'st' mnemonic should be replaced by the macro 'stn'.
Subject: Bug 12166 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2003-09-19 06:24:35 Modified files: gcc : ChangeLog gcc/config/sparc: sol2-c1.asm Log message: PR target/12166 * config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1094&r2=2.1095 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-c1.asm.diff?cvsroot=gcc&r1=1.3&r2=1.4
Subject: Bug 12166 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-09-19 06:27:33 Modified files: gcc : ChangeLog gcc/config/sparc: sol2-c1.asm Log message: PR target/12166 * config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1. 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.744&r2=1.16114.2.745 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-c1.asm.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3&r2=1.3.74.1
See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01206.html