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]
Other format: [Raw text]

Re: [Bug middle-end/11545] [3.4 regression] Segmentation fault whem marking cgraph_node in unit-at-a-time mode


> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11545
> 
> 
> 
> ------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-17 15:07 -------
> I found a 3 lines testcase which fails (c also, again compile with
> --param ggc-min-expand=0 --param ggc-min-heapsize=0 -funit-at-a-time):
> static __inline__ void gen_tstsfgt_gpr() {}
> static __inline__ void gen_cmpsflt_gpr() {}
> void mul_double () {}
Thanks.
It is the garbage collector being confused by reachable cgraph nodes
already removed from the list.  This happens because I forgot to remove
the node from hashtable when killing it.
I am commiting the attached patch as obvious.
Fri Jul 18 17:03:20 CEST 2003  Jan Hubicka  <jh@suse.cz>
	* cgraph.c (cgraph_remove_node): Clear the hash table slot.

Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.20
diff -c -3 -p -r1.20 cgraph.c
*** cgraph.c	12 Jul 2003 11:29:18 -0000	1.20
--- cgraph.c	18 Jul 2003 15:02:41 -0000
*************** cgraph_remove_edge (struct cgraph_node *
*** 204,209 ****
--- 204,210 ----
  void
  cgraph_remove_node (struct cgraph_node *node)
  {
+   void **slot;
    while (node->callers)
      cgraph_remove_edge (node->callers->caller, node);
    while (node->callees)
*************** cgraph_remove_node (struct cgraph_node *
*** 225,230 ****
--- 226,236 ----
    if (node->next)
      node->next->previous = node->previous;
    DECL_SAVED_TREE (node->decl) = NULL;
+   slot = 
+     htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (node->decl),
+ 			      IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
+ 						     (node->decl)), 1);
+   htab_clear_slot (cgraph_hash, slot);
    /* Do not free the structure itself so the walk over chain can continue.  */
  }
  
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.30
diff -c -3 -p -r1.30 opts.c
*** opts.c	17 Jul 2003 05:33:09 -0000	1.30
--- opts.c	18 Jul 2003 15:02:41 -0000
*************** decode_options (unsigned int argc, const
*** 517,522 ****
--- 517,523 ----
        flag_delete_null_pointer_checks = 1;
        flag_reorder_blocks = 1;
        flag_reorder_functions = 1;
+       flag_unit_at_a_time = 1;
      }
  
    if (optimize >= 3)
*************** decode_options (unsigned int argc, const
*** 524,530 ****
        flag_inline_functions = 1;
        flag_rename_registers = 1;
        flag_unswitch_loops = 1;
-       flag_unit_at_a_time = 1;
      }
  
    if (optimize < 2 || optimize_size)
--- 525,530 ----


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