https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106499
--- Comment #9 from Tomasz Kłoczko <kloczko.tomasz at gmail dot com> --- (In reply to Andrew Pinski from comment #8) [..] > Basically with the flatten attribute and lto, every function needs to there > and cloned and inlined causing a lot of memory and time really. > Functions become huge and all. Gcc memory usage for some things can be > improved but it won't be enough. Knowing size of the non-LTO optimised DSO I suppose that sill it maybe some design issue (higher level) which is causing that inline operations are causing such gigantic memory usage increase. And/or maybe it would be good to organise some internal metric with such operation counter to display at least some warning that some threshold of such operations has been reached? Maybe I'm mumbling but I'm trying to find at least sone generic solution to have some at least linker fart that thing are going in wrong direction because what is implemented in the code ..