public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/102939] New: Ridiculously long compilation times on (admittedly ridiculous) pointer declaration
@ 2021-10-25 22:37 gabravier at gmail dot com
  2021-10-25 22:50 ` [Bug c/102939] Ridiculously long compilation times on (admittedly itself " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gabravier at gmail dot com @ 2021-10-25 22:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102939
           Summary: Ridiculously long compilation times on (admittedly
                    ridiculous) pointer declaration
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

#define PTR1 * * * * * * * * * *
#define PTR2 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1
#define PTR3 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2
#define PTR4 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3
#define PTR5 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4
#define PTR6 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5

int PTR4 q3_var = 0;

This takes an entire second to compile for GCC, and which is absolutely
ridiculous compared to, for example, tcc and ack, which both compile this code
in under .01 seconds.

I've investigated a bit into what's going on myself and it looks like while
parsing, there's some `variably_modified_type_p` algorithm that's going haywire
and taking forever on this declaration. Is it some kind of O(n²) recursive
algorithm or something ? It seems rather quite odd, to be honest...

For comparison, compiling this as C++ takes just .04 seconds.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-17 19:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 22:37 [Bug c/102939] New: Ridiculously long compilation times on (admittedly ridiculous) pointer declaration gabravier at gmail dot com
2021-10-25 22:50 ` [Bug c/102939] Ridiculously long compilation times on (admittedly itself " pinskia at gcc dot gnu.org
2021-10-26  7:16 ` rguenth at gcc dot gnu.org
2021-10-31 20:27 ` hp at gcc dot gnu.org
2021-11-01  8:41 ` gabravier at gmail dot com
2023-02-18 21:56 ` muecker at gwdg dot de
2023-12-17 19:49 ` uecker at gcc dot gnu.org

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).