This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11898] New: huge memory consumption when compiling simple repetitive programs
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2003 22:34:14 -0000
- Subject: [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11898
Summary: huge memory consumption when compiling simple repetitive
programs
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bjg at network-theory dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
C programs which consist of simple repeated function calls cause
gcc to consume huge amounts of memory with -O2. For example,
a single program containing 2000 calls to another function
requires a peak 90 megabytes of memory to compile (attached
below). A similar 4000 line program requires over 350
megabytes. These types of program are common in
auto-generated test suites. This was encountered in the test
suite for GSL (GNU Scientific Library).
Environment:
System: Linux debian 2.4.19 #16 Wed May 21 09:48:43 BST 2003 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/bjg/ftp/gcc-3.3.1/configure --enable-languages=c : (reconfigured) /home/bjg/ftp/gcc-3.3.1/configure --enable-languages=c --prefix=/opt/gcc-3.3.1
How-To-Repeat:
No headers are needed to demonstrate this problem, and linking is not
required, so a plain .c file has been supplied.
bjg|debian> ulimit -v 65536 # set a limit of 64MB on the process
# for demonstration, or use your
# preferred means of monitoring
# the process size
bjg|debian> /opt/gcc-3.3.1/bin/gcc -v -O2 -c fn.c
Reading specs from /opt/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: /home/bjg/ftp/gcc-3.3.1/configure --enable-languages=c : (recon
figured) /home/bjg/ftp/gcc-3.3.1/configure --enable-languages=c --prefix=/opt/gc
c-3.3.1
Thread model: posix
gcc version 3.3.1
/opt/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/cc1 -quiet -v -D__GNUC__=3 -
D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 fn.c -quiet -dumpbase fn.c -auxbase fn
-O2 -version -o /tmp/cc0KwLAc.s
GNU C version 3.3.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.3.1.
GGC heuristics: --param ggc-min-expand=34 --param ggc-min-heapsize=8192
ignoring nonexistent directory "/opt/gcc-3.3.1/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/opt/gcc-3.3.1/include
/opt/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include
/usr/include
End of search list.
cc1: out of memory allocating 24767912 bytes after a total of 6661440 bytes