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]

Re: Disappearing REG_LABEL notes


Jeffrey A Law writes:
 > Sort term, don't split such insns :-)  Or arrange for the backend to make sure
 > the label_ref is attached to one of the new instructions.

I think this is the proper fix (although the reconstitution of notes
in general could do with an overhaul).  Without it, many of the
routines in tinfo.cc generate incorrect code for the C4x.

Michael.


Tue May  4 22:18:41 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>

	* loop.c (add_label_notes): Remove static.
	* rtl.h (add_label_notes): Add prototype.
	* emit-rtl.c (try_split): Call add_label_notes if split insn
	has a REG_LABEL note.

Index: emit-rtl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/emit-rtl.c,v
retrieving revision 1.59
diff -c -3 -p -r1.59 emit-rtl.c
*** emit-rtl.c	1999/04/29 23:01:26	1.59
--- emit-rtl.c	1999/05/04 10:26:28
*************** try_split (pat, trial, last)
*** 2319,2324 ****
--- 2319,2338 ----
  		    LABEL_NUSES (JUMP_LABEL (trial))++;
  		}
  
+ 	  /* If we are splitting an insn with a REG_LABEL note,
+ 	     add the note to the new insns where appropriate.  */
+ 	  if (find_reg_note (trial, REG_LABEL, 0))
+ 	    {
+ 	      rtx insns;
+ 
+ 	      start_sequence ();
+ 	      emit_insn (seq);
+ 	      insns = get_insns ();
+ 	      end_sequence ();
+ 
+ 	      add_label_notes (pat, insns);
+ 	    }
+ 
  	  tem = emit_insn_after (seq, before);
  
  	  delete_insn (trial);
Index: loop.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
retrieving revision 1.155
diff -c -3 -p -r1.155 loop.c
*** loop.c	1999/04/08 18:21:29	1.155
--- loop.c	1999/05/04 10:33:56
*************** static void force_movables PROTO((struct
*** 309,315 ****
  static void combine_movables PROTO((struct movable *, int));
  static int regs_match_p PROTO((rtx, rtx, struct movable *));
  static int rtx_equal_for_loop_p PROTO((rtx, rtx, struct movable *));
- static void add_label_notes PROTO((rtx, rtx));
  static void move_movables PROTO((struct movable *, int, int, rtx, rtx, int));
  static int count_nonfixed_reads PROTO((rtx));
  static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, rtx, int, int));
--- 309,314 ----
*************** rtx_equal_for_loop_p (x, y, movables)
*** 1693,1699 ****
  /* If X contains any LABEL_REF's, add REG_LABEL notes for them to all
    insns in INSNS which use thet reference.  */
  
! static void
  add_label_notes (x, insns)
       rtx x;
       rtx insns;
--- 1692,1698 ----
  /* If X contains any LABEL_REF's, add REG_LABEL notes for them to all
    insns in INSNS which use thet reference.  */
  
! void
  add_label_notes (x, insns)
       rtx x;
       rtx insns;
Index: rtl.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.h,v
retrieving revision 1.105
diff -c -3 -p -r1.105 rtl.h
*** rtl.h	1999/04/27 17:08:34	1.105
--- rtl.h	1999/05/04 10:33:57
*************** extern void print_inline_rtx		PROTO ((FI
*** 1441,1446 ****
--- 1441,1448 ----
  /* In loop.c */
  extern void init_loop			PROTO ((void));
  extern rtx libcall_other_reg		PROTO ((rtx, rtx));
+ extern void add_label_notes		PROTO ((rtx, rtx));
+ 
  #ifdef BUFSIZ
  extern void loop_optimize		PROTO ((rtx, FILE *, int, int));
  #endif


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