X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-ASG-Debug-ID: 1165682042-62f600070000-WWcc5q X-Barracuda-URL: http://84.239.128.3:8000/cgi-bin/mark.cgi X-Barracuda-Connect: smtp.24online.fi[84.239.128.2] X-Barracuda-Start-Time: 1165682042 X-Virus-Scanned: by amavisd-new at 24online.fi Message-ID: <457AE57F.9000807@iki.fi> Date: Sat, 09 Dec 2006 18:34:07 +0200 From: Andris Pavenis User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Gordon DOT Schumacher AT seagate DOT com Cc: djgpp AT delorie DOT com X-ASG-Orig-Subj: Re: Profiling with -pg and arguments to main() - GCC 4.1.0 Subject: Re: Profiling with -pg and arguments to main() - GCC 4.1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Virus-Scanned: by 24 Online SPAM Filter at 24online.fi X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.28220 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Reply-To: djgpp AT delorie DOT com Gordon DOT Schumacher AT seagate DOT com kirjoitti: > I've discovered a strange bug in applications compiled with the -pg switch > (at least with the setup I have). The file test.c contains the following: > > #include > int main(int argc, char *argv[], char *envp[]) > { > printf("argc/argv/envp are at %p %p %p\n", &argc, &argv, &envp); > return 0; > } > > bash-2.05b $ gcc test.c -o test.exe && ./test.exe > argc/argv/envp are at 92c38 92c3c 92c40 > > bash-2.05b $ gcc test.c -o test.exe -pg && ./test.exe > argc/argv/envp are at 0 4 8 > > > The culprit appears to be my GCC version: I'm running with v4.1.0. If I > drop back to v4.0.1 it works fine. I've tried both DJGPP v2.04 and > v2.03; this makes no difference (I am generally using v2.04). Wanted to suggest trying my build of gcc-4.1.1: http://ap1.pp.fi/djgpp/gcc/4.1.1/gcc411.html Verified however (Linux, Fedora Core 6, Dosemu-1.3.3, ...), that this problem appears also with gcc-4.1.1. It does not however happen with Linux version of GCC-4.1.1 (FC6 version, not FSF one). Andris