Enabling some tree dumps causes a tramp3d-v4 compile to run into swap,
requiring
about 50% more ram than a non-dumped compile.

Pinskia suggests

Index: gcc/cgraph.c
===================================================================
--- gcc/cgraph.c        (revision 115684)
+++ gcc/cgraph.c        (working copy)
@@ -509,7 +509,7 @@ cgraph_remove_node (struct cgraph_node *
        kill_body = true;
     }

-  if (kill_body && !dump_enabled_p (TDI_tree_all) && flag_unit_at_a_time)
+  if (kill_body && flag_unit_at_a_time)
     {
       DECL_SAVED_TREE (node->decl) = NULL;
       DECL_STRUCT_FUNCTION (node->decl) = NULL;
Index: gcc/cgraphunit.c
===================================================================
--- gcc/cgraphunit.c    (revision 115684)
+++ gcc/cgraphunit.c    (working copy)
@@ -1466,7 +1466,6 @@ cgraph_optimize (void)
   /* Double check that all inline clones are gone and that all
      function bodies have been released from memory.  */
   if (flag_unit_at_a_time
-      && !dump_enabled_p (TDI_tree_all)
       && !(sorrycount || errorcount))
     {
       struct cgraph_node *node;


but there may be non-GCable cost of dumping itself.


-- 
           Summary: Using -fdump-tree-optimized causes a huge compile time
                    memory regression
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Keywords: memory-hog
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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

Reply via email to