[PATCH] Fix PR47820

H.J. Lu hjl.tools@gmail.com
Mon Feb 21 20:00:00 GMT 2011


On Mon, Feb 21, 2011 at 5:36 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> This fixes the memory-usage issue reported in PR47820.  The C frontend
> sets DECL_INITIAL of the TRANSLATION_UNIT_DECL to the file-scope BLOCK
> tree it builds.  This causes us to stream in all entities referenced
> by it, including a load of unused types and decls.  In the end this
> results in WPA memory usage to grow from 500MB to 2.5GB when LTOing cc1.
>
> The following patch simply avoids to stream DECL_INITIAL of
> TRANSLATION_UNIT_DECL which isn't used by the middle-end (it's only
> used by the C frontends write-global-decls langhook).
>
> Profile-bootstrapp-ltoed and tested on x86_64-unknown-linux-gnu, applied.
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47841


-- 
H.J.



More information about the Gcc-patches mailing list