This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13716] New: segfaults for big functions with heaps of goto statements


hey :)

the following happened with 2.95.3, 2.95.4, 3.1 and 3.3

g++ segfaults when i try to compile attached file. it contains basically a
single function of around 11.000 something goto statements. after some hours and
consuming almost all the memory available, g++ throws the following at me:

  trace.cc: In function `bool invokeFunction(int, char*, RegisterFile&,
  float32_t**, float64_t**, float128_t**)':
  trace.cc:66531: internal compiler error: Segmentation Fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <URL:http://gcc.gnu.org/bugs.html> for instructions.
  3203.28u 10.18s 53:41.67 99.7%

i invoked g++ with the following command line

  g++ -shared -O3 -funroll-loops -mcpu=v9 -mtune=ultrasparc3 -ftracer -S -o
trace.s trace.cc

it might be worth to mention that it also fails under plain -O2 and -O1.
however, not so with -O0. here are some more invocations of g++ that might be
helpful

  g++ -shared -O0 -S -o trace.s
  g++ -shared -O0 -mcpu=v9 -mtune=ultrasparc3 -S -o trace.s trace.cc
  g++ -shared -O0 -mcpu=v9 -mtune=ultrasparc3 -ftracer -funroll-loops -S -o
trace.s trace.cc

all work.

  g++ -shared -O1 -S -o trace.s trace.cc

gives a

  cc1plus: out of memory allocating 3627007184 bytes after a total of 1583677440
bytes

the uname -a is

  SunOS ulla 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Fire-480R

hm. i can i attach the file? doesn't look like it... you can download it from

  http://savage.light-speed.de/trace.cc.bz2

hope you can fix that? (and yes, the function might look stupid, but it is
generated. don't blame me ;-))

cheers,
jens troeger

-- 
           Summary: segfaults for big functions with heaps of goto
                    statements
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: savage at light-speed dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]