public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "eggert at cs dot ucla.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/107060] New: -fanalyzer unbearably slow when compiling GNU Emacs
Date: Tue, 27 Sep 2022 19:20:09 +0000	[thread overview]
Message-ID: <bug-107060-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107060
           Summary: -fanalyzer unbearably slow when compiling GNU Emacs
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

Created attachment 53634
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53634&action=edit
compressed source file that gcc -S -fanalyzer -O2 compiles verrrry slowly

For a while, gcc -fanalyzer has been so unbearably slow when compiling GNU
Emacs that we Emacs developers disable -fanalyzer unless the builder
specifically asks for it, which almost nobody does because it's sooo slow. I
haven't bothered to file a bug report because I assumed the analyzer code was
still being worked on and tuned, but I just now tried -fanalyzer again on a new
machine and it was still so slow that I am finally filing a bug report.

The biggest pole in the tent is when gcc compiles Emacs's xdisp.c file, which
is large for Emacs (38 Klines) but not that large. I am attaching the
preprocessed output as the file u.i.gz. Compile it with:

gzip -d u.i
gcc -S -fanalyzer -O2 u.i

On my older Fedora 36 desktop (AMD Phenom II X4 910e) with gcc (GCC) 12.2.1
20220819 (Red Hat 12.2.1-2) GCC takes 12 minutes 3 seconds, which is
ridiculous. On my newer Ubuntu 22.04 desktop (Intel Xeon W-1350) with gcc-12
(Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0, GCC takes 3 minutes 43 seconds, which is
still way too long.

Could you please take a look at this test case and see what's slowing down
-fanalyzer? If you can't improve GCC, is there some easy way we Emacs
developers can rewrite the source to avoid the performance issue, whatever it
is? Thanks.

             reply	other threads:[~2022-09-27 19:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 19:20 eggert at cs dot ucla.edu [this message]
2022-09-27 20:55 ` [Bug analyzer/107060] " dmalcolm at gcc dot gnu.org
2022-09-27 21:31 ` dmalcolm at gcc dot gnu.org
2022-09-27 22:22 ` dmalcolm at gcc dot gnu.org
2022-09-28 13:57 ` dmalcolm at gcc dot gnu.org
2022-09-28 15:01 ` dmalcolm at gcc dot gnu.org
2022-09-29  8:10 ` rguenth at gcc dot gnu.org
2022-10-05 17:54 ` cvs-commit at gcc dot gnu.org
2022-10-05 18:20 ` dmalcolm at gcc dot gnu.org
2023-03-02 18:26 ` 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-107060-4@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: 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).