Bug 1683776

Summary: gcc uses too much memory on parsing large initialized array
Product: Red Hat Enterprise Linux 8 Reporter: Frank Ch. Eigler <fche>
Component: gccAssignee: Marek Polacek <mpolacek>
gcc sub component: system-version QA Contact: qe-baseos-tools-bugs
Status: CLOSED UPSTREAM Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ahajkova, fweimer, jakub, law, mpetlan, ohudlick, sipoyare, vmukhame, wcohen
Version: 8.1Keywords: Regression, Triaged
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-12 14:26:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Ch. Eigler 2019-02-27 18:53:49 UTC
Relative to RHEL7, RHEL8's gcc 8.2.1 is subject to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12245 .  It consumes approximately a hundred bytes of cc1 memory per initialized array literal.  This affects e.g. systemtap, which can generate some large initialized arrays.

% stap -kvp4 --example fileline-profile.stp --all-modules --ldd
(check last child gcc cpu & memory consumption w/ top)
% cd $TMPDIR/stapXYZ
% gcc -c stap_*.i
(observe same ram/cpu intensive compilation)

It's not hard for gcc to consume multiple gigabytes of ram, which is a problem on small VMs.

Comment 8 Marek Polacek 2021-01-12 14:26:20 UTC
Tracking this upstream in PR12245.  In each release we fix a few compile-time-hog bugs, hopefully this will/was one of them.