Bug 12166 - Profiled programs crash if PROFDIR is set
Summary: Profiled programs crash if PROFDIR is set
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P1 normal
Target Milestone: 3.3.2
Assignee: Eric Botcazou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-04 14:01 UTC by Sean Johnston
Modified: 2003-09-19 06:29 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed: 2003-09-18 11:49:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Johnston 2003-09-04 14:01:44 UTC
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
Comment 1 Sean Johnston 2003-09-18 11:08:37 UTC
The patch referenced in the original report has been tested and successfully 
resolves the issue.
Comment 2 Eric Botcazou 2003-09-18 11:49:51 UTC
Confirmed. Regression from egcs-1.1.1 according to Theodore.
Comment 3 Eric Botcazou 2003-09-18 11:51:00 UTC
Taking care of Theodore's patch.
Comment 4 Eric Botcazou 2003-09-18 12:19:27 UTC
The original patch doesn't work on SPARC64. The 'st' mnemonic should be replaced
by the macro 'stn'.
Comment 5 GCC Commits 2003-09-19 06:24:39 UTC
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

Comment 6 GCC Commits 2003-09-19 06:27:44 UTC
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

Comment 7 Eric Botcazou 2003-09-19 06:29:15 UTC
See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01206.html