* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
@ 2013-03-27 9:50 ` rguenth at gcc dot gnu.org
2013-03-27 11:04 ` mathias at gaunard dot com
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-27 9:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Known to work| |4.7.2
Keywords| |memory-hog
Last reconfirmed| |2013-03-27
Ever Confirmed|0 |1
Summary|4.8 regression: increased |[4.8 regression] increased
|memory usage when compiling |memory usage when compiling
|C++ |C++
Target Milestone|--- |4.8.1
Known to fail| |4.8.0
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-27 09:50:41 UTC ---
Please provide preprocessed source of the file that shows this change in
behavior.
Also provide the options you used for compiling.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
2013-03-27 9:50 ` [Bug c++/56746] [4.8 regression] " rguenth at gcc dot gnu.org
@ 2013-03-27 11:04 ` mathias at gaunard dot com
2013-03-27 11:09 ` paolo.carlini at oracle dot com
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mathias at gaunard dot com @ 2013-03-27 11:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #2 from Mathias Gaunard <mathias at gaunard dot com> 2013-03-27 11:04:08 UTC ---
The preprocessed file is 7 megabytes, which exceeds what I can attach here.
I do not think it is practical to reduce it with automatic tools.
Would it be ok to provide it as-is?
The flags used are -fno-strict-aliasing -Wall -Wno-unused
-Wno-delete-non-virtual-dtor -mxop -fabi-version=4 -O2.-O2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
2013-03-27 9:50 ` [Bug c++/56746] [4.8 regression] " rguenth at gcc dot gnu.org
2013-03-27 11:04 ` mathias at gaunard dot com
@ 2013-03-27 11:09 ` paolo.carlini at oracle dot com
2013-03-27 11:12 ` redi at gcc dot gnu.org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-27 11:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-27 11:09:28 UTC ---
You can reduce it at least somewhat and then compress it with bzip2.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (2 preceding siblings ...)
2013-03-27 11:09 ` paolo.carlini at oracle dot com
@ 2013-03-27 11:12 ` redi at gcc dot gnu.org
2013-03-27 16:41 ` mathias at gaunard dot com
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-27 11:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-27 11:12:45 UTC ---
You should be able to attach it if you compress it.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (3 preceding siblings ...)
2013-03-27 11:12 ` redi at gcc dot gnu.org
@ 2013-03-27 16:41 ` mathias at gaunard dot com
2013-03-28 9:51 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mathias at gaunard dot com @ 2013-03-27 16:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #5 from Mathias Gaunard <mathias at gaunard dot com> 2013-03-27 16:41:16 UTC ---
While trying to isolate the problem, I have observed that the problem does not
occur if -save-temps is used.
While using -save-temps does not change anything with GCC 4.7, using it does
reduce memory usage significantly with GCC 4.8.
Did something change with regards to the way temporary files are handled?
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (4 preceding siblings ...)
2013-03-27 16:41 ` mathias at gaunard dot com
@ 2013-03-28 9:51 ` rguenth at gcc dot gnu.org
2013-03-28 10:39 ` mathias at gaunard dot com
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-28 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dodji at gcc dot gnu.org
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-28 09:51:35 UTC ---
(In reply to comment #5)
> While trying to isolate the problem, I have observed that the problem does not
> occur if -save-temps is used.
> While using -save-temps does not change anything with GCC 4.7, using it does
> reduce memory usage significantly with GCC 4.8.
>
> Did something change with regards to the way temporary files are handled?
No, but using pre-processed source results in less pressure on line-tables
as no macro recording is taking place. You could try -ftrack-macro-expansion=0
(which is undocumented - bah - Dodji, please fix that, invoke.texi).
Unreduced preprocessed source is ok, you can also upload it somewhere
accessible
if it's rejected here as attachment (compress it before attaching).
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (5 preceding siblings ...)
2013-03-28 9:51 ` rguenth at gcc dot gnu.org
@ 2013-03-28 10:39 ` mathias at gaunard dot com
2013-03-29 18:44 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mathias at gaunard dot com @ 2013-03-28 10:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #7 from Mathias Gaunard <mathias at gaunard dot com> 2013-03-28 10:39:53 UTC ---
Using either -save-temps or -ftrack-macro-expansion=0-ftrack-macro-expansion=0
removes the memory hog.
Compiling the preprocessed source does not cause increased memory usage.
So it seems the macro expansion tracking is what's causing a lot of extra
memory usage here.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (6 preceding siblings ...)
2013-03-28 10:39 ` mathias at gaunard dot com
@ 2013-03-29 18:44 ` jason at gcc dot gnu.org
2013-04-26 18:10 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-29 18:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-29 18:43:55 UTC ---
(In reply to comment #7)
> So it seems the macro expansion tracking is what's causing a lot of extra
> memory usage here.
OK, that makes sense, as the compiler is keeping more information around in
order to give better diagnostic context with macros.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (7 preceding siblings ...)
2013-03-29 18:44 ` jason at gcc dot gnu.org
@ 2013-04-26 18:10 ` jakub at gcc dot gnu.org
2013-05-31 11:00 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-26 18:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-26 18:09:58 UTC ---
So, NOTABUG?
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (8 preceding siblings ...)
2013-04-26 18:10 ` jakub at gcc dot gnu.org
@ 2013-05-31 11:00 ` jakub at gcc dot gnu.org
2013-06-13 15:49 ` mathias at gaunard dot com
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 11:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.1 |4.8.2
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (9 preceding siblings ...)
2013-05-31 11:00 ` jakub at gcc dot gnu.org
@ 2013-06-13 15:49 ` mathias at gaunard dot com
2013-06-13 15:54 ` mathias at gaunard dot com
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mathias at gaunard dot com @ 2013-06-13 15:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #11 from Mathias Gaunard <mathias at gaunard dot com> ---
4.8.1 is still affected by this.
I wouldn't say it's NOTABUG if a new diagnostic feature enabled by default
increases memory consumption by 50%, even when no diagnostic is emitted.
I cannot easily give a test case; the problem being preprocessor-related, the
issues disappear once preprocessed.
The code incriminated includes hundreds of files (if not more), split in about
20 different include directories. Those files contain templates instantiated
hundreds of times each, and their body is generated by macros which may end up
creating lines that are thousands of characters long.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (10 preceding siblings ...)
2013-06-13 15:49 ` mathias at gaunard dot com
@ 2013-06-13 15:54 ` mathias at gaunard dot com
2013-10-05 9:29 ` ofv at wanadoo dot es
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mathias at gaunard dot com @ 2013-06-13 15:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
--- Comment #12 from Mathias Gaunard <mathias at gaunard dot com> ---
This may be considered a duplicate of #53525, though that bug is more focused
on performance than memory usage.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (11 preceding siblings ...)
2013-06-13 15:54 ` mathias at gaunard dot com
@ 2013-10-05 9:29 ` ofv at wanadoo dot es
2013-10-16 9:51 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: ofv at wanadoo dot es @ 2013-10-05 9:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
ofv at wanadoo dot es changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ofv at wanadoo dot es
--- Comment #13 from ofv at wanadoo dot es ---
My case is similar to the one described by Mathias Gaunard, but with a
difference of 3x memory usage when -ftrack-macro-expansion=0 is not added to
the command line.
I use Boost Preprocessor plus a number of macros to define and instantiate lots
of templates. That's the case that requires 3x more memory (low estimate) with
some TUs requiring way more than 1GB to compile (on a 32 bit machine, which
means that parallel builds usually ends with massive swapping and the compile
jobs killed due to memory starvation.)
I have a version of the same code base that uses variadic templates instead of
Boost Preprocessor, although the macros for instantiating the templates are
still there. That requires about 1.5x more memory.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (12 preceding siblings ...)
2013-10-05 9:29 ` ofv at wanadoo dot es
@ 2013-10-16 9:51 ` jakub at gcc dot gnu.org
2014-05-22 9:07 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.2 |4.8.3
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (13 preceding siblings ...)
2013-10-16 9:51 ` jakub at gcc dot gnu.org
@ 2014-05-22 9:07 ` rguenth at gcc dot gnu.org
2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-06-23 8:41 ` rguenth at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-22 9:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.3 |4.8.4
--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 4.8.3 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (14 preceding siblings ...)
2014-05-22 9:07 ` rguenth at gcc dot gnu.org
@ 2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-06-23 8:41 ` rguenth at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.4 |4.8.5
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++
2013-03-26 18:07 [Bug c++/56746] New: 4.8 regression: increased memory usage when compiling C++ mathias at gaunard dot com
` (15 preceding siblings ...)
2014-12-19 13:34 ` jakub at gcc dot gnu.org
@ 2015-06-23 8:41 ` rguenth at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23 8:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |FIXED
Target Milestone|4.8.5 |4.9.0
--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
Assuming fixed in 4.9.0 (no testcase).
^ permalink raw reply [flat|nested] 18+ messages in thread