https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93278
Bug ID: 93278 Summary: huge almost empty array takes huge time to compile and produces huge object file Product: gcc Version: 7.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: doug at cs dot dartmouth.edu Target Milestone: --- Example, with HUGE varying from a million to a billion. char a[HUGE] = "x"; Object file size varies accordingly. Compile time varies by a factor of a hundred on my 4GB desktop. ELF allows sections to be incompletely initialized. Can't gcc exploit that? I suspect this is not a new complaint, but the search terms I tried didn't find it. And I was amused to find that replacing "x" with "\0" causes the inefficiency to be optimized away.