This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix bug 2875


Hi,
I've installed this on the branch to fix bug 2875. This was a gc bug
where we never gc'd a cache of lists. Needless to say, this is a bomb
waiting to go off ...

rth fixed it a similar way on the mainline a while back, but I only
discovered that when trying to patch the mainline!

built & tested on i686-pc-linux-gnu.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-05-27  Nathan Sidwell  <nathan@codesourcery.com>

	* lists.c (init_EXPR_INSN_LIST_cache): Only called once.
	* toplev.c (rest_of_compilation): Don't call it here.
	(compile_file): Call it here.

Index: lists.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/lists.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 lists.c
*** lists.c	2000/10/13 06:26:27	1.7
--- lists.c	2001/05/27 16:01:49
*************** zap_lists (dummy)
*** 118,132 ****
    unused_insn_list = NULL;
  }
  
  void 
  init_EXPR_INSN_LIST_cache ()
  {
!   static int initialized;
!   if (!initialized)
!     {
!       initialized = 1;
!       ggc_add_root (&unused_expr_list, 1, 1, zap_lists);
!     }
  }
  
  /* This function will free up an entire list of EXPR_LIST nodes.  */
--- 118,129 ----
    unused_insn_list = NULL;
  }
  
+ /* Register a ggc root which clears the unused lists at GC time. */
+ 
  void 
  init_EXPR_INSN_LIST_cache ()
  {
!   ggc_add_root (&unused_expr_list, 1, 1, zap_lists);
  }
  
  /* This function will free up an entire list of EXPR_LIST nodes.  */
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.420.2.23
diff -c -3 -p -r1.420.2.23 toplev.c
*** toplev.c	2001/05/26 05:45:47	1.420.2.23
--- toplev.c	2001/05/27 16:01:52
*************** compile_file (name)
*** 2223,2228 ****
--- 2223,2229 ----
    init_function_once ();
    init_stor_layout_once ();
    init_varasm_once ();
+   init_EXPR_INSN_LIST_cache ();
  
    /* The following initialization functions need to generate rtl, so
       provide a dummy function context for them.  */
*************** rest_of_compilation (decl)
*** 2901,2908 ****
        if (DECL_EXTERNAL (decl))
  	goto exit_rest_of_compilation;
      }
- 
-   init_EXPR_INSN_LIST_cache ();
  
    ggc_collect ();
  
--- 2902,2907 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]