public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/110112] [11/12/13 Regression] gcc -fanalyzer takes an excessive amount of time Date: Thu, 09 May 2024 17:10:54 +0000 [thread overview] Message-ID: <bug-110112-4-2OOw2iWLqq@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-110112-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110112 --- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>: https://gcc.gnu.org/g:89feb3557a018893cfe50c2e07f91559bd3cde2b commit r13-8741-g89feb3557a018893cfe50c2e07f91559bd3cde2b Author: David Malcolm <dmalcolm@redhat.com> Date: Thu May 9 13:09:26 2024 -0400 analyzer: add caching to globals with initializers [PR110112] PR analyzer/110112 notes that -fanalyzer is extremely slow on a source file with large read-only static arrays, repeatedly building the same compound_svalue representing the full initializer, and repeatedly building svalues representing parts of the the full initialiazer. This patch adds caches for both of these; together they reduce the time taken by -fanalyzer -O2 on the testcase in the bug for an optimized build: 91.2s : no caches (status quo) 32.4s : cache in decl_region::get_svalue_for_constructor 3.7s : cache in region::get_initial_value_at_main 3.1s : both caches (this patch) gcc/analyzer/ChangeLog: PR analyzer/110112 * region-model.cc (region_model::get_initial_value_for_global): Move code to region::calc_initial_value_at_main. * region.cc (region::get_initial_value_at_main): New function. (region::calc_initial_value_at_main): New function, based on code in region_model::get_initial_value_for_global. (region::region): Initialize m_cached_init_sval_at_main. (decl_region::get_svalue_for_constructor): Add a cache, splitting out body to... (decl_region::calc_svalue_for_constructor): ...this new function. * region.h (region::get_initial_value_at_main): New decl. (region::calc_initial_value_at_main): New decl. (region::m_cached_init_sval_at_main): New field. (decl_region::decl_region): Initialize m_ctor_svalue. (decl_region::calc_svalue_for_constructor): New decl. (decl_region::m_ctor_svalue): New field. (cherry picked from commit r14-1664-gfe9771b59f576f) Signed-off-by: David Malcolm <dmalcolm@redhat.com>
next prev parent reply other threads:[~2024-05-09 17:10 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-04 11:24 [Bug analyzer/110112] New: " bruno at clisp dot org 2023-06-04 11:30 ` [Bug analyzer/110112] " bruno at clisp dot org 2023-06-04 13:06 ` tlange at gcc dot gnu.org 2023-06-05 6:49 ` rguenth at gcc dot gnu.org 2023-06-08 23:06 ` dmalcolm at gcc dot gnu.org 2023-06-09 22:05 ` cvs-commit at gcc dot gnu.org 2023-06-10 0:54 ` dmalcolm at gcc dot gnu.org 2024-05-09 17:10 ` cvs-commit at gcc dot gnu.org [this message] 2024-05-09 17:54 ` [Bug analyzer/110112] [11/12 " dmalcolm at gcc dot gnu.org
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=bug-110112-4-2OOw2iWLqq@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).