| delorie.com/archives/browse.cgi | search |
| From: | "Alex Vinokur" <alexvn AT bigfoot DOT com> |
| 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: | <b568o6$258tun$1@ID-79865.news.dfncis.de> |
| References: | <b54db9$252aq3$1 AT ID-79865 DOT news DOT dfncis DOT de> <Oejda.183$Zf2 DOT 42 AT read3 DOT inet DOT fi> |
| 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" <tauno DOT voipio AT iki DOT fi DOT SPAMBAIT_REMOVE DOT invalid> wrote in message news:Oejda.183$Zf2 DOT 42 AT read3 DOT inet DOT fi...
>
> "Alex Vinokur" <alexvn AT bigfoot DOT com> 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
=================================
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |