public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: -Os in conjunction with -fno-inline
@ 2005-09-30  5:41 Ryan Mansfield
  2005-09-30  5:51 ` Ilja Golshtein
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Mansfield @ 2005-09-30  5:41 UTC (permalink / raw)
  To: 'ilejn@yandex.ru', gcc-help


The idea of inlining is to remove function prologues and epilogues. When you
set -fno-inline, the functions do not get inlined and the prologues and
epilogues account for the slight increase in size.

Inlining can result in some code bloat when procedure cloning is done.

Regards,

Ryan Mansfield

 

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Ilja Golshtein
Sent: Friday, September 30, 2005 1:26 AM
To: gcc-help@gcc.gnu.org
Subject: -Os in conjunction with -fno-inline

Hello!

I've came across with a strange thing.
After adding "-fno-inline" to g++ command line just after "-Os" size of
binary was slightly increased.

Two question. Why any difference exists? Why size increased not reduced? The
code   optimized indeed.

I use gcc 3.2.2 from RH 9.0 distribution.
No optimization related options besides mentioned above.

Thanks.

--
Best regards
Ilja Golshtein

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: -Os in conjunction with -fno-inline
  2005-09-30  5:41 -Os in conjunction with -fno-inline Ryan Mansfield
@ 2005-09-30  5:51 ` Ilja Golshtein
  0 siblings, 0 replies; 3+ messages in thread
From: Ilja Golshtein @ 2005-09-30  5:51 UTC (permalink / raw)
  To: RMansfield; +Cc: gcc-help

>The idea of inlining is to remove function prologues and epilogues. When you
>set -fno-inline, the functions do not get inlined and the prologues and
>epilogues account for the slight increase in size.

In other words -Os use good threshold size (better then  just 0) to make decision if function should be inlined. 

My mistake I was (don't know why) convinced -Os implies -fno-inline.

Thanks.

-- 
Best regards
Ilja Golshtein

^ permalink raw reply	[flat|nested] 3+ messages in thread

* -Os in conjunction with -fno-inline
@ 2005-09-30  5:25 Ilja Golshtein
  0 siblings, 0 replies; 3+ messages in thread
From: Ilja Golshtein @ 2005-09-30  5:25 UTC (permalink / raw)
  To: gcc-help

Hello!

I've came across with a strange thing.
After adding "-fno-inline" to g++ command
line just after "-Os" size of binary
was slightly increased.

Two question. Why any difference exists? Why size increased not reduced? The code   optimized indeed.

I use gcc 3.2.2 from RH 9.0 distribution.
No optimization related options besides mentioned above.

Thanks.

-- 
Best regards
Ilja Golshtein

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-30  5:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30  5:41 -Os in conjunction with -fno-inline Ryan Mansfield
2005-09-30  5:51 ` Ilja Golshtein
  -- strict thread matches above, loose matches on Subject: below --
2005-09-30  5:25 Ilja Golshtein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).