public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/96352] New: inflated text section with ipa inline
@ 2020-07-28  8:14 rjiejie at me dot com
  2020-07-28  8:29 ` [Bug ipa/96352] " rguenth at gcc dot gnu.org
  2020-07-30  1:48 ` rjiejie at me dot com
  0 siblings, 2 replies; 3+ messages in thread
From: rjiejie at me dot com @ 2020-07-28  8:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96352

            Bug ID: 96352
           Summary: inflated text section with ipa inline
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rjiejie at me dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48942
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48942&action=edit
inflated text section with ipa inline

My case is compare size of object between two versions.

>From v8.3, the text section size is 3232,
but from v8.4, the text section size is 5692.

My test command line: 

cc1 bitstream.i  -march=rv64gc -mabi=lp64  -O3 -o a.s
as --traditional-format -march=rv64gc -mabi=lp64 -o a.o a.s
size a.o

I found this issue from gcc version v8.4 and
it is present at gcc version 10.2.1 also :(

I have researched gcc sources and found the issue comes from
edge_badness@ipa-inline.c at commit be917808aa3310d46f586e6586ef08d302837f1e :

diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 73da38c..8e34400 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1173,7 +1173,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
            overall_growth += 256 * 256 - 256;
          denominator *= overall_growth;
         }
-      denominator *= inlined_time;
+      denominator *= ipa_fn_summaries->get (caller)->self_size + growth;

       badness = - numerator / denominator;

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

* [Bug ipa/96352] inflated text section with ipa inline
  2020-07-28  8:14 [Bug ipa/96352] New: inflated text section with ipa inline rjiejie at me dot com
@ 2020-07-28  8:29 ` rguenth at gcc dot gnu.org
  2020-07-30  1:48 ` rjiejie at me dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-28  8:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96352

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It was a bugfix.  If you want to have small binaries use -Os.  You can also
tune the inliner with various knobs, the most important maybe
--param inline-unit-growth which defaults to 40 (40% growth).

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

* [Bug ipa/96352] inflated text section with ipa inline
  2020-07-28  8:14 [Bug ipa/96352] New: inflated text section with ipa inline rjiejie at me dot com
  2020-07-28  8:29 ` [Bug ipa/96352] " rguenth at gcc dot gnu.org
@ 2020-07-30  1:48 ` rjiejie at me dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rjiejie at me dot com @ 2020-07-30  1:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96352

--- Comment #2 from jojo <rjiejie at me dot com> ---
(In reply to Richard Biener from comment #1)
> It was a bugfix.  If you want to have small binaries use -Os.  You can also
> tune the inliner with various knobs, the most important maybe
> --param inline-unit-growth which defaults to 40 (40% growth).

Ok and thank you :)

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

end of thread, other threads:[~2020-07-30  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  8:14 [Bug ipa/96352] New: inflated text section with ipa inline rjiejie at me dot com
2020-07-28  8:29 ` [Bug ipa/96352] " rguenth at gcc dot gnu.org
2020-07-30  1:48 ` rjiejie at me dot com

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).