public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs
@ 2003-08-12 22:34 gcc-bugzilla at gcc dot gnu dot org
  2003-08-12 23:40 ` [Bug optimization/11898] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-08-12 22:34 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
@ 2003-08-12 23:40 ` pinskia at gcc dot gnu dot org
  2003-08-12 23:41 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-12 23:40 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |optimization
           Keywords|                            |memory-hog
   Target Milestone|---                         |3.4


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-12 23:40 -------
Can you provide the source code as it looks like it did not get attached (looks again gccbug did not 
do its job)?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
  2003-08-12 23:40 ` [Bug optimization/11898] " pinskia at gcc dot gnu dot org
@ 2003-08-12 23:41 ` pinskia at gcc dot gnu dot org
  2003-08-13 12:30 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-12 23:41 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
  2003-08-12 23:40 ` [Bug optimization/11898] " pinskia at gcc dot gnu dot org
  2003-08-12 23:41 ` pinskia at gcc dot gnu dot org
@ 2003-08-13 12:30 ` pinskia at gcc dot gnu dot org
  2003-08-22 23:56 ` dhazeghi at yahoo dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-13 12:30 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-13 12:30:53
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-13 12:30 -------
I can confirm this on the mainline (20030811).  It is the schedular which causes this memory 
consumption using -fno-schedule-insns and -fno-schedule-insns2 will get rid of this memory 
consumption.
BackTrace (without extra options):
#0  0x4202bb8a in exit () from /lib/i686/libc.so.6
#1  0x083b621a in xexit (code=1) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/xexit.c:52
#2  0x083b602c in xmalloc_failed (size=1) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/
xmalloc.c:132
#3  0x083b607b in xmalloc (size=24767912) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/
xmalloc.c:145
#4  0x082d9aed in sbitmap_vector_alloc (n_vecs=14009, n_elms=14009) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/sbitmap.c:133
#5  0x083a7c69 in init_dependency_caches (luid=14009) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/sched-deps.c:1462
#6  0x0838feff in sched_init (dump_file=0x405b3b80) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/haifa-sched.c:2626
#7  0x083ac6aa in schedule_insns (dump_file=0x1) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/sched-rgn.c:2661
#8  0x082f9ca1 in rest_of_handle_sched2 (decl=0x40094870, insns=0x4004c3c0) at /home/
gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:2256
#9  0x082fc0c8 in rest_of_compilation (decl=0x40094870) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/toplev.c:3435
#10 0x0806d5d0 in c_expand_body_1 (fndecl=0x40094870, nested_p=0) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/c-decl.c:6329
#11 0x0806db49 in c_expand_body (fndecl=0x1) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
c-decl.c:6411
#12 0x0806d12a in finish_function (nested=0, can_defer_p=1) at /home/gates/pinskia/src/gnu/
gcc/src/gcc/c-decl.c:6199
#13 0x0804b409 in yyparse () at c-parse.y:385
#14 0x0805205b in c_parse_file () at c-parse.y:3015
#15 0x08099f1b in c_common_parse_file (set_yydebug=1) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/c-opts.c:1206
#16 0x082f8dea in compile_file () at /home/gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:1730
#17 0x082fd61a in do_compile () at /home/gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:4408
#18 0x082fd72d in toplev_main (argc=1, argv=0xbffec4e4) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/toplev.c:4448
#19 0x080ba49b in main (argc=1, argv=0x1) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
main.c:35
BackTrace(with -fno-schedule-insn2):
#0  0x4202bb8a in exit () from /lib/i686/libc.so.6
#1  0x083b621a in xexit (code=1) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/xexit.c:52
#2  0x083b602c in xmalloc_failed (size=1) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/
xmalloc.c:132
#3  0x083b607b in xmalloc (size=24767912) at /home/gates/pinskia/src/gnu/gcc/src/libiberty/
xmalloc.c:145
#4  0x082d9aed in sbitmap_vector_alloc (n_vecs=14009, n_elms=14009) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/sbitmap.c:133
#5  0x083a7c69 in init_dependency_caches (luid=14009) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/sched-deps.c:1462
#6  0x0838feff in sched_init (dump_file=0x405b3b80) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/haifa-sched.c:2626
#7  0x083ac6aa in schedule_insns (dump_file=0x1) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/sched-rgn.c:2661
#8  0x082f9ca1 in rest_of_handle_sched2 (decl=0x40094870, insns=0x4004c3c0) at /home/
gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:2256
#9  0x082fc0c8 in rest_of_compilation (decl=0x40094870) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/toplev.c:3435
#10 0x0806d5d0 in c_expand_body_1 (fndecl=0x40094870, nested_p=0) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/c-decl.c:6329
#11 0x0806db49 in c_expand_body (fndecl=0x1) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
c-decl.c:6411
#12 0x0806d12a in finish_function (nested=0, can_defer_p=1) at /home/gates/pinskia/src/gnu/
gcc/src/gcc/c-decl.c:6199
#13 0x0804b409 in yyparse () at c-parse.y:385
#14 0x0805205b in c_parse_file () at c-parse.y:3015
#15 0x08099f1b in c_common_parse_file (set_yydebug=1) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/c-opts.c:1206
#16 0x082f8dea in compile_file () at /home/gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:1730
#17 0x082fd61a in do_compile () at /home/gates/pinskia/src/gnu/gcc/src/gcc/toplev.c:4408
#18 0x082fd72d in toplev_main (argc=1, argv=0xbffec4d4) at /home/gates/pinskia/src/gnu/gcc/
src/gcc/toplev.c:4448
#19 0x080ba49b in main (argc=1, argv=0x1) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
main.c:35


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-08-13 12:30 ` pinskia at gcc dot gnu dot org
@ 2003-08-22 23:56 ` dhazeghi at yahoo dot com
  2004-01-19 12:48 ` [Bug optimization/11898] [scheduler] " pinskia at gcc dot gnu dot org
  2004-01-19 13:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-22 23:56 UTC (permalink / raw)
  To: gcc-bugs

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


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] [scheduler] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-08-22 23:56 ` dhazeghi at yahoo dot com
@ 2004-01-19 12:48 ` pinskia at gcc dot gnu dot org
  2004-01-19 13:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-19 12:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-19 12:48 -------
Fixed for 3.4.0 by work done by Jan.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug optimization/11898] [scheduler] huge memory consumption when compiling simple repetitive programs
  2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-01-19 12:48 ` [Bug optimization/11898] [scheduler] " pinskia at gcc dot gnu dot org
@ 2004-01-19 13:01 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-19 13:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-19 13:01 -------
Just to tell you, it only uses 21M.

-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-01-19 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-12 22:34 [Bug c/11898] New: huge memory consumption when compiling simple repetitive programs gcc-bugzilla at gcc dot gnu dot org
2003-08-12 23:40 ` [Bug optimization/11898] " pinskia at gcc dot gnu dot org
2003-08-12 23:41 ` pinskia at gcc dot gnu dot org
2003-08-13 12:30 ` pinskia at gcc dot gnu dot org
2003-08-22 23:56 ` dhazeghi at yahoo dot com
2004-01-19 12:48 ` [Bug optimization/11898] [scheduler] " pinskia at gcc dot gnu dot org
2004-01-19 13:01 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).