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;