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]

Fix trunk crafty build failure


Hi,
the crafty brenchmark crashes now in mainline, since loop unroller gets
confused about dead jumptable - it sees code_label with count 0 that gets
amned, but forgets to remove the jumptable afterwards causing verify_flow_info
to crash once CFG is built.

The live jumptables (dead but still referenced) appears to be handled w/o crash
- they are duplicated and constructed dead elliminated later.

Before we make proper fix (killing jumptables), it seems to be easiest to just
cleanup jumptable.

Fre Mär  1 12:38:58 CET 2002  Jan Hubicka  <jh@suse.cz>
	* toplev.c (rest_of_compilation): Delete dead jumptables before
	loop.
	* flow.c (delete_dead_jumptables): Make global.
	* rtl.h (delete_dead_jumptables): Declare.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.576
diff -c -3 -p -r1.576 toplev.c
*** toplev.c	2002/02/28 10:10:59	1.576
--- toplev.c	2002/03/01 11:38:42
*************** rest_of_compilation (decl)
*** 2864,2869 ****
--- 2864,2870 ----
    if (optimize > 0)
      {
        timevar_push (TV_LOOP);
+       delete_dead_jumptables ();
        open_dump_file (DFI_loop, decl);
        /* CFG is no longer maintained up-to-date.  */
        free_bb_for_insn ();
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.506
diff -c -3 -p -r1.506 flow.c
*** flow.c	2002/02/28 10:10:58	1.506
--- flow.c	2002/03/01 11:38:43
*************** static void invalidate_mems_from_autoinc
*** 336,342 ****
  						  rtx));
  static void invalidate_mems_from_set	PARAMS ((struct propagate_block_info *,
  						 rtx));
- static void delete_dead_jumptables	PARAMS ((void));
  static void clear_log_links		PARAMS ((sbitmap));
  
  
--- 336,341 ----
*************** delete_noop_moves (f)
*** 844,850 ****
     time of removing tablejump insn as they are referenced by the preceding
     insns computing the destination, so we delay deleting and garbagecollect
     them once life information is computed.  */
! static void
  delete_dead_jumptables ()
  {
    rtx insn, next;
--- 843,849 ----
     time of removing tablejump insn as they are referenced by the preceding
     insns computing the destination, so we delay deleting and garbagecollect
     them once life information is computed.  */
! void
  delete_dead_jumptables ()
  {
    rtx insn, next;
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.331
diff -c -3 -p -r1.331 rtl.h
*** rtl.h	2002/02/20 23:19:19	1.331
--- rtl.h	2002/03/01 11:38:44
*************** extern void set_new_first_and_last_insn	
*** 1844,1849 ****
--- 1844,1850 ----
  extern void set_new_first_and_last_label_num	PARAMS ((int, int));
  extern void set_new_last_label_num		PARAMS ((int));
  extern void unshare_all_rtl_again		PARAMS ((rtx));
+ extern void set_first_insn			PARAMS ((rtx));
  extern void set_last_insn			PARAMS ((rtx));
  extern void link_cc0_insns			PARAMS ((rtx));
  extern void add_insn				PARAMS ((rtx));
*************** extern void move_by_pieces		PARAMS ((rtx
*** 1927,1932 ****
--- 1928,1934 ----
  /* In flow.c */
  extern void recompute_reg_usage			PARAMS ((rtx, int));
  extern int initialize_uninitialized_subregs	PARAMS ((void));
+ extern void delete_dead_jumptables		PARAMS ((void));
  #ifdef BUFSIZ
  extern void print_rtl_with_bb			PARAMS ((FILE *, rtx));
  extern void dump_flow_info			PARAMS ((FILE *));


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