From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F7973858C2F; Tue, 27 Sep 2022 19:20:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F7973858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664306410; bh=ICVtFdl/NBP9nETL0fhk2XpuT8SZvQ5rIVeuwdRSnng=; h=From:To:Subject:Date:From; b=bc3R+aMPIO6UPH2Hm51DGo7L3L2pUM3R7a6N8qQtPGdDP7PAd7NGQS3l99R61LChP 9lC3C3xbnww9rR4Utsj14G7oPNywHF3xdIvGG/5IC054QH48A9AkWESu+KPrTRHTc5 /5LTwoIOVCFJVQzJjLnTfuM0DElxWu+gdSkkdJEU= From: "eggert at cs dot ucla.edu" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at cs dot ucla.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107060 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=3D53634&action=3Dedit 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 w= as 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, whi= ch 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, whic= h 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.=