public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/14362] New: Memory leak during optimisation?
@ 2004-03-01 12:06 schnetter at aei dot mpg dot de
  2004-03-01 12:07 ` [Bug fortran/14362] " schnetter at aei dot mpg dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-03-01 12:06 UTC (permalink / raw)
  To: gcc-bugs

When compiling the enclosed Fortran file with optimisation, the compiler 
suddenly starts to quickly allocate more and more memory; after about 1.5 GB 
it aborts because I do not have more swap space.  Without optimisation 
everything is fine.  I assume that the Fortran code is correct.  The compiler 
version is 
 
$ ~/gcc-3.5-tree-ssa/bin/gfortran --version 
GNU Fortran 95 (GCC 3.5-tree-ssa 20040229 (merged 20040211)) 
 
and the options are 
 
current_wd=`pwd` ; 
cd /home/eschnett/Calpha/Cactus/configs/einstein-gfortran/scratch ; /home/eschnett/gcc-3.5-tree-ssa/bin/gfortran 
-march=pentium3 -malign-double -m128bit-long-double -g3 -gdwarf-2 -O3 
-funroll-loops -Wall -c -o $current_wd/ih_interpolate.F90.o 
$current_wd/ih_interpolate.f90

-- 
           Summary: Memory leak during optimisation?
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schnetter at aei dot mpg dot de
                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


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


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

* [Bug fortran/14362] Memory leak during optimisation?
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
@ 2004-03-01 12:07 ` schnetter at aei dot mpg dot de
  2004-03-01 15:29 ` [Bug optimization/14362] [tree-ssa] [gfortran] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schnetter at aei dot mpg dot de @ 2004-03-01 12:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schnetter at aei dot mpg dot de  2004-03-01 12:07 -------
Created an attachment (id=5828)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5828&action=view)
Failing Fortran 90 source code


-- 


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Memory leak during optimisation?
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
  2004-03-01 12:07 ` [Bug fortran/14362] " schnetter at aei dot mpg dot de
@ 2004-03-01 15:29 ` pinskia at gcc dot gnu dot org
  2004-03-01 15:38 ` dnovillo at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-01 15:29 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |optimization
           Keywords|                            |ice-on-valid-code
            Summary|Memory leak during          |[tree-ssa] [gfortran] Memory
                   |optimisation?               |leak during optimisation?
   Target Milestone|---                         |tree-ssa


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Memory leak during optimisation?
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
  2004-03-01 12:07 ` [Bug fortran/14362] " schnetter at aei dot mpg dot de
  2004-03-01 15:29 ` [Bug optimization/14362] [tree-ssa] [gfortran] " pinskia at gcc dot gnu dot org
@ 2004-03-01 15:38 ` dnovillo at gcc dot gnu dot org
  2004-03-01 16:15 ` dnovillo at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-03-01 15:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-03-01 15:38 -------

Confirmed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-01 15:38:02
               date|                            |


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Memory leak during optimisation?
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
                   ` (2 preceding siblings ...)
  2004-03-01 15:38 ` dnovillo at gcc dot gnu dot org
@ 2004-03-01 16:15 ` dnovillo at gcc dot gnu dot org
  2004-03-01 17:07 ` [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-03-01 16:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-03-01 16:15 -------

It seems to be variable tracking.  Memory usage stabilizes at about 113Mb, and
then when rest_of_compilation calls rest_of_handle_variable_tracking, memory
utilization jumps to 267Mb, 589Mb, 949Mb, ... until the machine crashes.

I stopped compilation inside gdb at this spot:

(gdb) bt
#0  0xb74e7a15 in _int_malloc () from /lib/tls/libc.so.6
#1  0xb74e6b0d in malloc () from /lib/tls/libc.so.6
#2  0x084c61c2 in xmalloc (size=3076173400)
    at /home/cygnus/dnovillo/tree-ssa-00/src/libiberty/xmalloc.c:143
#3  0x0843053f in pool_alloc (pool=0x86d91e8)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/alloc-pool.c:249
#4  0x08381bb0 in vars_copy_1 (slot=0x2de9a808, data=0xd0f5e08)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:748
#5  0x084c54e8 in htab_traverse_noresize (htab=0x2debb6c0,
    callback=0x8381b73 <vars_copy_1>, info=0x1)
    at /home/cygnus/dnovillo/tree-ssa-00/src/libiberty/hashtab.c:626
#6  0x08381d40 in vars_copy (dst=0xd0f5e08, src=0xd0f5da8)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:792
#7  0x08382160 in dataflow_set_copy (dst=0xce23910, src=0xce23834)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:925
#8  0x08383478 in compute_bb_dataflow (bb=0xb5aa9074)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:1522
#9  0x083839a0 in vt_find_locations ()
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:1642
#10 0x08385c15 in variable_tracking_main ()
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/var-tracking.c:2627
#11 0x083fbd01 in rest_of_handle_variable_tracking (decl=0xb7199bc8,
    insns=0xb6fa5a00)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/toplev.c:2224
#12 0x083fdeb2 in rest_of_compilation (decl=0xb7199bc8)
    at /home/cygnus/dnovillo/tree-ssa-00/src/gcc/toplev.c:3479

If the test is compiled without -g3 -gdwarf-2, it compiles just fine.  The tree
optimizers take a grand total of 5% of compile time.  most of the work is done
by loop analysisi (19%), web (10%) and global alloc (24%).

Assigning it to Josef as he's the one cvs ann shows in var-tracking.c 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |zlomek at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
                   ` (3 preceding siblings ...)
  2004-03-01 16:15 ` dnovillo at gcc dot gnu dot org
@ 2004-03-01 17:07 ` reichelt at gcc dot gnu dot org
  2004-03-02 10:44 ` zlomek at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-01 17:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-01 17:07 -------
Well, the program just uses way too much memory.
I'll attach a simple testcase that just declares 100 arrays and uses
something between 600 - 650 MB memory when compiled with "-O -g".
That's roughly 6 MB per array, arggh.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |memory-hog
            Summary|[tree-ssa] [gfortran] Memory|[tree-ssa] [gfortran]
                   |leak during optimisation?   |Inordinate memory
                   |                            |consumption with -O -g


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
                   ` (4 preceding siblings ...)
  2004-03-01 17:07 ` [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g reichelt at gcc dot gnu dot org
@ 2004-03-02 10:44 ` zlomek at gcc dot gnu dot org
  2004-03-04  4:14 ` giovannibajo at libero dot it
  2004-03-04 10:47 ` zlomek at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-03-02 10:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-03-02 10:44 -------
Proposed patch:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00139.html

-- 


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
                   ` (5 preceding siblings ...)
  2004-03-02 10:44 ` zlomek at gcc dot gnu dot org
@ 2004-03-04  4:14 ` giovannibajo at libero dot it
  2004-03-04 10:47 ` zlomek at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-04  4:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-04 04:14 -------
Josef, remember to specify the PR in the ChangeLog while committing your patch. 
Your proposed patch seems to miss it. Thanks.

-- 


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


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

* [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g
  2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
                   ` (6 preceding siblings ...)
  2004-03-04  4:14 ` giovannibajo at libero dot it
@ 2004-03-04 10:47 ` zlomek at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-03-04 10:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-03-04 10:47 -------
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00405.html
has been commited to mainline and tree-ssa.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-03-04 10:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-01 12:06 [Bug fortran/14362] New: Memory leak during optimisation? schnetter at aei dot mpg dot de
2004-03-01 12:07 ` [Bug fortran/14362] " schnetter at aei dot mpg dot de
2004-03-01 15:29 ` [Bug optimization/14362] [tree-ssa] [gfortran] " pinskia at gcc dot gnu dot org
2004-03-01 15:38 ` dnovillo at gcc dot gnu dot org
2004-03-01 16:15 ` dnovillo at gcc dot gnu dot org
2004-03-01 17:07 ` [Bug optimization/14362] [tree-ssa] [gfortran] Inordinate memory consumption with -O -g reichelt at gcc dot gnu dot org
2004-03-02 10:44 ` zlomek at gcc dot gnu dot org
2004-03-04  4:14 ` giovannibajo at libero dot it
2004-03-04 10:47 ` zlomek 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).