[Bug middle-end/56113] out of memory when compiling a function with many goto labels (50k > )

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 29 13:07:00 GMT 2013


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-29 13:06:48 UTC ---
Created attachment 29300
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29300
patch

n=100    0.97user   83232maxresident
n=1000   9.76user  260800maxresident
n=2000  23.14user  468096maxresident
n=4000  62.08user  890768maxresident
n=8000 189.13user 1722624maxresident

looks reasonably linear (double-checking now with mem-stats, not sure if
that will show reduced memory usage - maybe for the obstack peak use).

release checking with mem-stats numbers, and not -O0 compiler:

unpatched: n=10000 127.82user 7755408maxresident (top shows 1.8GB memory usage
very quickly)
patched:   n=10000 126.42user 3400032maxresident (top shows max. 340MB memory
usage for a very long time, later peaks at ~800MB)

unpatched:
tree-ssa-structalias.c:2105 (label_visit)   150024      2554542888     
2554542888      2554542888
patched:
tree-ssa-structalias.c:2114 (label_visit)   150024      2554542888        
1475192         1440608          0          0

The patch is of course lame - it only reduces the amount of memory used
if there are a lot of pointer equivalences.  But at least it's very cheap
to do so.



More information about the Gcc-bugs mailing list