[LLVMbugs] [Bug 2132] New: x86_64: Compiling gcc.c-torture/compile/20050622-1. c exhausts physical memory

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Mar 9 08:37:05 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2132

           Summary: x86_64: Compiling gcc.c-torture/compile/20050622-1.c
                    exhausts physical memory
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


I tried to run the gcc testsuite on llvm-gcc (SVN r48109, both llvm-gcc and
llvm).

When it tried to compile gcc.c-torture/compile/20050622-1.c it began using huge
amounts of memory (1.7g+), that causes excessive swapout, and I had to kill the
test. 
FWIW clang can compile it.

This only occurs on x86-64, compiling the same on x86 works fine.
$ uname -a
Linux lightspeed2 2.6.25-rc3-00347-gcad226b #2 Mon Mar 3 23:19:49 EET 2008
x86_64 GNU/Linux

To reproduce:
$ llvm-gcc gcc/testsuite/gcc.c-torture/compile/20050622-1.c -S -O0

Or even:
$ llvm-gcc gcc.c-torture/compile/20050622-1.c -fsyntax-only

Memory usage starts to climb fast, and compilation doesn't finish even after
minutes of running (on a system with 2 Gb physical RAM).

My system's gcc can compile these fine:

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--disable-libmudflap --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.3 (Debian 4.2.3-2)

$ time gcc gcc.c-torture/compile/20050622-1.c -S

real    0m0.414s
user    0m0.317s
sys     0m0.080s

$ time gcc gcc.c-torture/compile/20050622-1.c -S

real    0m0.414s
user    0m0.317s
sys     0m0.080s

I can't get bitcode, so here is the preprocessed source:
llvm-gcc -E gcc.c-torture/compile/20050622-1.c
# 1 "gcc.c-torture/compile/20050622-1.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "gcc.c-torture/compile/20050622-1.c"

struct S { char buf[72*1024*1024]; };




extern void bar (struct S);

struct S s;

int
foo (void)
{
  bar (s);
  return 0;
}


There are lots of test suite failures on "test for warning, test for excess
errors". Do you want a bugreport opened for that?


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list