]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not gather mem stats in run_exit_handles (PR
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Feb 2016 16:57:39 +0000 (16:57 +0000)
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Feb 2016 16:57:39 +0000 (16:57 +0000)
PR middle-end/69919
* alloc-pool.c (after_memory_report): New variable.
* alloc-pool.h (base_pool_allocator ::release): Do not use
the infrastructure if after_memory_report.
* toplev.c (toplev::main): Mark after memory report.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233722 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/alloc-pool.c
gcc/alloc-pool.h
gcc/toplev.c

index 3a13f5fa5649fcb1760d4877f01c7f5f931934c4..0414e0970130dbcc7e913e3485adac758b1a7b62 100644 (file)
@@ -1,3 +1,11 @@
+2016-02-25  Martin Liska  <mliska@suse.cz>
+
+       PR middle-end/69919
+       * alloc-pool.c (after_memory_report): New variable.
+       * alloc-pool.h (base_pool_allocator ::release): Do not use
+       the infrastructure if after_memory_report.
+       * toplev.c (toplev::main): Mark after memory report.
+
 2016-02-25  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/48795
index ae5e232d40d65ab976929a2920bda1e1f4aa13c8..43d06f62153f6033ca5048a96ad8ed5c7e5d73b7 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 
 ALLOC_POOL_ID_TYPE last_id;
 mem_alloc_description<pool_usage> pool_allocator_usage;
+bool after_memory_report = false;
 
 /* Output per-alloc_pool memory usage statistics.  */
 void
index 8ccf089d60c9ab2de2933352b05bc5a64ecf0e06..3ead1015d7122df7811dce53b7bc00c396c05279 100644 (file)
@@ -25,6 +25,9 @@ along with GCC; see the file COPYING3.  If not see
 
 extern void dump_alloc_pool_statistics (void);
 
+/* Flag indicates whether memory statistics are gathered any longer.  */
+extern bool after_memory_report;
+
 typedef unsigned long ALLOC_POOL_ID_TYPE;
 
 /* Last used ID.  */
@@ -306,7 +309,7 @@ base_pool_allocator <TBlockAllocator>::release ()
       TBlockAllocator::release (block);
     }
 
-  if (GATHER_STATISTICS)
+  if (GATHER_STATISTICS && !after_memory_report)
     {
       pool_allocator_usage.release_instance_overhead
        (this, (m_elts_allocated - m_elts_free) * m_elt_size);
index 28c115d71c4faa764609a9508f105f97820c825a..c480bfc8bd220f33e2bf56266e685950f310c252 100644 (file)
@@ -2107,6 +2107,9 @@ toplev::main (int argc, char **argv)
 
   finalize_plugins ();
   location_adhoc_data_fini (line_table);
+
+  after_memory_report = true;
+
   if (seen_error () || werrorcount)
     return (FATAL_EXIT_CODE);