This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/79399] New: GCC fails to compile big source at -O0
- From: "babokin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Feb 2017 23:27:58 +0000
- Subject: [Bug middle-end/79399] New: GCC fails to compile big source at -O0
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79399
Bug ID: 79399
Summary: GCC fails to compile big source at -O0
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: babokin at gmail dot com
Target Milestone: ---
The bug report is not very typical, but it may help fixing the real issue,
which is hard to find and debug in other corricumstances. I don't mind if it's
closed as "will not be fixed", but still hope it could be useful.
The test case is huge auto generated C++ file - 260Mb of source code (1.7Mb
when compressed). The code is scalar. So I would expect that GCC compiles it
without issues at least at -O0. But it fails trying to allocate
18446744071569032860 bytes, which is... 1.8*10^19. Which is too much in any
case. This is unreasonable value. But if converted to hex format it's
0xffffffff806a469c. Probably someone tries to allocate more than 2^32 bytes in
64bit compiler and has an issue with passing 64 bit size (size_t actually) and
uses 32 bit value instead?
> /usr/bin/time --format="Max %M kb\nreal %E\nuser %U\nsys %S" g++ -std=c++11 -w -O0 -march=nehalem -o gcc_no_opt_func.o -c func.cpp
cc1plus: out of memory allocating 18446744071569032860 bytes after a total of
9836802048 bytes
Max 24979592 kb
real 22:27.38
user 1321.54
sys 24.45
The test case is, again, 1.7Mb when compressed, so I can't attach it to the bug
report. But it's available here:
https://drive.google.com/open?id=0Bxh4sVF04yhxWFNzazVxUWVnUDA
Compiler that I'm using is couple days old trunk:
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gcc/bin_svn/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc_svn/configure --with-arch=corei7 --with-cpu=corei7
--enable-clocale=gnu --with-system-zlib --enable-shared --with-demangler-in-ld
--enable-cloog-backend=isl --with-fpmath=sse --prefix=/gcc/bin_svn/
--enable-languages=c,c++,lto : (reconfigured) ../gcc_svn_intel/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse --prefix=/gcc/bin_svn/ --enable-languages=c,c++,lto
--no-create --no-recursion : (reconfigured) ../gcc_svn/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse --prefix=/gcc/bin_svn/ --enable-languages=c,c++,lto
--no-create --no-recursion : (reconfigured) ../gcc_svn/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse --prefix=/gcc/bin_svn/ --enable-languages=c,c++,lto
--no-create --no-recursion
Thread model: posix
gcc version 7.0.1 20170203 (experimental) (GCC)