From: "Alex Vinokur" Newsgroups: comp.os.msdos.djgpp,gnu.gcc.help,gnu.utils.help Subject: Re: gcc -O3 & gprof Date: Tue, 18 Mar 2003 06:52:29 +0200 Lines: 54 Message-ID: References: NNTP-Posting-Host: pop09-2ras2-p89.barak.net.il (212.150.105.89) X-Trace: fu-berlin.de 1047963208 72644567 212.150.105.89 (16 [79865]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Tauno Voipio" wrote in message news:Oejda.183$Zf2 DOT 42 AT read3 DOT inet DOT fi... > > "Alex Vinokur" wrote in message [snip] > > > > ========= C code : BEGIN ========= > > /* File main.c */ > > > > int foo1 (int argc) { return argc; } > > int foo2 (int argc) { return argc; } > > The optimisation -O3 inlines simple functions (like yours here). There are > no calls to trace. [snip] How can we see that ? For instance, nm doesn't distinguish -O0, -O1, -O2, -O3. ==================== Windows 2000 DJGPP 2.03 GNU gcc/g++ version 3.2.1 GNU nm 2.13 ==================== gcc -o a0.exe main.c -g -pg nm a0.exe | grep foo 000016d0 T _foo1 000016e2 T _foo2 gcc -O1 -o a1.exe main.c -g -pg nm a1.exe | grep foo 000016d0 T _foo1 000016e2 T _foo2 gcc -O2 -o a2.exe main.c -g -pg nm a2.exe | grep foo 000016d0 T _foo1 000016f0 T _foo2 gcc -O3 -o a3.exe main.c -g -pg nm a3.exe | grep foo 000016f0 T _foo1 00001710 T _foo2 ================================= Alex Vinokur mailto:alexvn AT connect DOT to http://www.simtel.net/pub/oth/19088.html =================================