public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56113] New: out of memory when compiling a function with many goto labels (50k > )
@ 2013-01-25 20:37 aixer77 at gmail dot com
  2013-01-25 20:39 ` [Bug c/56113] " aixer77 at gmail dot com
                   ` (34 more replies)
  0 siblings, 35 replies; 36+ messages in thread
From: aixer77 at gmail dot com @ 2013-01-25 20:37 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56113
           Summary: out of memory when compiling a function with many goto
                    labels (50k > )
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: aixer77@gmail.com


Out of memory when compiling a function with many goto labels (50k > )

gcc 4.6.3 compiler(running on top of ubuntu 12.04 32-bit) failed to output an
object for a function when it comes with extremely large number of goto
labels.

Attached is a simple script that generates the test source file. Here's how to
reproduce a failure with the script.

~$./goto_gen.py 60000 t.c

~$ time cc -O1 -o t t.c

cc1: out of memory allocating 4064 bytes after a total of 2309808128 bytes

real    11m44.371s
user    11m42.592s
sys    0m1.876s

~$ time cc -O0 -o t t.c

real    22m5.106s
user    22m3.539s
sys    0m1.640s


As you can see from the above, -O1 option trigger the problem while -O0
doesn't.

Could you anyone tell me how to workaround this situation? Or which specific
optimization option causes the issue?

Thanks a lot for your help in advance.

Regards, Kangkook


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

end of thread, other threads:[~2023-05-04 10:54 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-25 20:37 [Bug c/56113] New: out of memory when compiling a function with many goto labels (50k > ) aixer77 at gmail dot com
2013-01-25 20:39 ` [Bug c/56113] " aixer77 at gmail dot com
2013-01-26 15:29 ` [Bug middle-end/56113] " rguenth at gcc dot gnu.org
2013-01-26 15:40 ` aixer77 at gmail dot com
2013-01-27  0:17 ` steven at gcc dot gnu.org
2013-01-27 11:24 ` steven at gcc dot gnu.org
2013-01-27 13:27 ` steven at gcc dot gnu.org
2013-01-28  9:45 ` rguenth at gcc dot gnu.org
2013-01-28 10:05 ` rguenth at gcc dot gnu.org
2013-01-28 23:35 ` steven at gcc dot gnu.org
2013-01-29  9:52 ` rguenther at suse dot de
2013-01-29 13:07 ` rguenth at gcc dot gnu.org
2013-01-29 14:23 ` rguenth at gcc dot gnu.org
2013-01-29 14:24 ` rguenth at gcc dot gnu.org
2013-01-29 15:38 ` rguenth at gcc dot gnu.org
2013-01-30 13:50 ` rguenth at gcc dot gnu.org
2013-01-30 14:38 ` rguenth at gcc dot gnu.org
2013-01-30 15:41 ` rguenth at gcc dot gnu.org
2013-01-31 10:13 ` rguenth at gcc dot gnu.org
2013-01-31 16:37 ` rguenth at gcc dot gnu.org
2013-01-31 16:53 ` rguenth at gcc dot gnu.org
2013-01-31 19:56 ` steven at gcc dot gnu.org
2013-01-31 20:16 ` steven at gcc dot gnu.org
2013-01-31 22:51 ` steven at gcc dot gnu.org
2013-01-31 23:23 ` steven at gcc dot gnu.org
2013-02-01  8:48 ` rguenther at suse dot de
2013-02-01 10:10 ` rguenth at gcc dot gnu.org
2013-02-01 12:39 ` rguenth at gcc dot gnu.org
2013-02-04  9:30 ` rguenth at gcc dot gnu.org
2013-03-06 10:54 ` [Bug c/56113] " steven at gcc dot gnu.org
2013-03-18  8:48 ` rguenth at gcc dot gnu.org
2013-03-18 10:02 ` rguenth at gcc dot gnu.org
2013-04-08  8:37 ` [Bug middle-end/56113] " rguenth at gcc dot gnu.org
2023-05-04  9:29 ` [Bug c/56113] " rguenth at gcc dot gnu.org
2023-05-04 10:02 ` rguenth at gcc dot gnu.org
2023-05-04 10:54 ` rguenth at gcc dot gnu.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).