public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Qing Zhao <QING.ZHAO@ORACLE.COM>
Cc: gcc@gcc.gnu.org
Subject: Re: Does gcc automatically lower optimization level for very large routines?
Date: Wed, 01 Jan 2020 05:25:00 -0000	[thread overview]
Message-ID: <8736czwxxu.fsf@linux.intel.com> (raw)
In-Reply-To: <9A7132EC-5B85-4AF1-A6B9-7DAB0FA11759@ORACLE.COM> (Qing Zhao's	message of "Thu, 19 Dec 2019 10:37:52 -0600")

Qing Zhao <QING.ZHAO@ORACLE.COM> writes:

> (gdb) where 
> #0  0x0000000000ddbcb3 in df_chain_create (src=0x631006480f08, 
>     dst=0x63100f306288) at ../../gcc-8.2.1-20180905/gcc/df-problems.c:2267 
> #1  0x0000000000dddd1a in df_chain_create_bb_process_use ( 
>     local_rd=0x7ffc109bfaf0, use=0x63100f306288, top_flag=0) 
>     at ../../gcc-8.2.1-20180905/gcc/df-problems.c:2441 
> #2  0x0000000000dde5a7 in df_chain_create_bb (bb_index=16413) 
>     at ../../gcc-8.2.1-20180905/gcc/df-problems.c:2490 
> #3  0x0000000000ddeaa9 in df_chain_finalize (all_blocks=0x63100097ac28) 
>     at ../../gcc-8.2.1-20180905/gcc/df-problems.c:2519 
> #4  0x0000000000dbe95e in df_analyze_problem (dflow=0x60600027f740, 
>     blocks_to_consider=0x63100097ac28, postorder=0x7f23761f1800, 
>     n_blocks=40768) at ../../gcc-8.2.1-20180905/gcc/df-core.c:1179 
> #5  0x0000000000dbedac in df_analyze_1 () 

AFAIK df_analyze is used even with O1 by various passes.  Probably tbe bulk of
the memory consumption is somewhere else, and it just happens to hit
there by chance.

Would be useful to figure out in more details where the memory
consumption goes in your test case.

Unfortunately gcc doesn't have a good general heap profiler,
but I usually do (if you're on Linux). Whoever causes most page
faults likely allocates most memory.

perf record --call-graph dwarf -e page-faults gcc ...
perf report --no-children --percent-limit 5 --stdio > file.txt

and post file.txt into a bug in bugzilla.

-Andi

  parent reply	other threads:[~2020-01-01  5:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 16:37 Qing Zhao
2019-12-19 22:51 ` Dmitry Mikushin
2019-12-19 23:07   ` Qing Zhao
2019-12-20  0:41     ` Jeff Law
2019-12-20  1:32       ` David Edelsohn
2019-12-20  1:58         ` Dmitry Mikushin
2019-12-20 22:52           ` Segher Boessenkool
2019-12-20 23:00             ` Dmitry Mikushin
2019-12-20 11:13       ` Richard Biener
2019-12-20 16:05         ` Qing Zhao
2019-12-20 16:22           ` Jonathan Wakely
2020-01-01  5:25 ` Andi Kleen [this message]
2020-01-01 15:20   ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736czwxxu.fsf@linux.intel.com \
    --to=ak@linux.intel.com \
    --cc=QING.ZHAO@ORACLE.COM \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).