public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "curiousdannii at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/100393] New: Very slow compilation of switch statement with thousands of cases Date: Mon, 03 May 2021 11:46:51 +0000 [thread overview] Message-ID: <bug-100393-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100393 Bug ID: 100393 Summary: Very slow compilation of switch statement with thousands of cases Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: curiousdannii at gmail dot com Target Milestone: --- I have a switch statement with almost 11,000 cases (produced by a decompiler), which is taking almost 5 minutes to compile with GCC 10.2. Helpful people on Stack Overflow suggested that it was a regression, that it only took 3 seconds to compile with GCC 8.4, and for comparison, only 1.3 seconds in Clang. I haven't been able to confirm those results yet, but I'll look into doing so. SO discussion: https://stackoverflow.com/q/67363813/2854284 Preprocessed source: https://gist.githubusercontent.com/curiousdannii/9476375ff3ae22c403ce2a8132e6a5dc/raw/568f519f2f1b599e98c514f3609a4968d4153eed/functions_unsafe.i The `-ftime-report -ftime-report-details` results (full results in the SO page) show that the slow part is in "tree switch lowering". I also tried compiling it with `-fno-jump-tables`, which, rather than helping, made it much worse, taking over 33 minutes to compile.
next reply other threads:[~2021-05-03 11:46 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-03 11:46 curiousdannii at gmail dot com [this message] 2021-05-03 12:04 ` [Bug c/100393] " curiousdannii at gmail dot com 2021-05-03 13:37 ` [Bug tree-optimization/100393] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org 2021-05-03 13:48 ` rguenth at gcc dot gnu.org 2021-05-03 13:58 ` rguenth at gcc dot gnu.org 2021-05-10 12:22 ` marxin at gcc dot gnu.org 2021-06-01 8:20 ` rguenth at gcc dot gnu.org 2021-08-13 15:25 ` marxin at gcc dot gnu.org 2021-08-13 15:26 ` marxin at gcc dot gnu.org 2021-08-16 11:38 ` cvs-commit at gcc dot gnu.org 2021-08-16 11:38 ` [Bug tree-optimization/100393] [9/10/11 " marxin at gcc dot gnu.org 2021-11-05 16:09 ` cvs-commit at gcc dot gnu.org 2021-11-05 16:10 ` marxin 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-100393-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: 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).