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: [patches] Cleanup CFG aware insn chain handling.


> Hi,
> Bootstrapped i686, bootstrapping sparc/mips/PPC in meantime.

Hi,
to bootstrap sparc, I had to fix two places - haifa sched avoids the
end of insn stream (where it crashes) by emitting dummy NOTE_INSN_DELETED.
If the note appears after jump insn, the BB boundary is updated resulting
in verify_flow_info complaining.

Second place is emit_return_into_block where I've incorrectly updated
the code.  (this part replaces hunk in previous patch).

Bootstrapping of MIPS/SPARC and PPC works now.

OK to install (together with previous patches)?

Honza

Wed Sep 12 17:33:09 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* haifa-sched.c (sched_insn): Emit the note after the BB boundary.
	(emit_return_into_block): Fix code to emit line number info.

Index: haifa-sched.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/haifa-sched.c,v
retrieving revision 1.186
diff -c -3 -p -r1.186 haifa-sched.c
*** haifa-sched.c	2001/08/30 20:44:49	1.186
--- haifa-sched.c	2001/09/12 15:30:46
*************** sched_init (dump_file)
*** 1971,1977 ****
  	  && GET_CODE (insn) != CODE_LABEL
  	  /* Don't emit a NOTE if it would end up before a BARRIER.  */
  	  && GET_CODE (NEXT_INSN (insn)) != BARRIER))
!     emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks - 1));
  
    /* Compute INSN_REG_WEIGHT for all blocks.  We must do this before
       removing death notes.  */
--- 1971,1981 ----
  	  && GET_CODE (insn) != CODE_LABEL
  	  /* Don't emit a NOTE if it would end up before a BARRIER.  */
  	  && GET_CODE (NEXT_INSN (insn)) != BARRIER))
!     {
!       emit_note_after (NOTE_INSN_DELETED, BLOCK_END (n_basic_blocks - 1));
!       /* Make insn to appear outside BB.  */
!       BLOCK_END (n_basic_blocks - 1) = PREV_INSN (BLOCK_END (n_basic_blocks - 1));
!     }
  
    /* Compute INSN_REG_WEIGHT for all blocks.  We must do this before
       removing death notes.  */
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.305
diff -c -3 -p -r1.305 function.c
*** function.c	2001/09/05 17:48:26	1.305
--- function.c	2001/09/12 15:31:58
*************** emit_return_into_block (bb, line_note)
*** 7118,7133 ****
    end = emit_jump_insn_after (gen_return (), bb->end);
    if (line_note)
      emit_line_note_after (NOTE_SOURCE_FILE (line_note),
! 			  NOTE_LINE_NUMBER (line_note), bb->end);
! 
!   while (1)
!     {
!       set_block_for_insn (p, bb);
!       if (p == bb->end)
! 	break;
!       p = PREV_INSN (p);
!     }
!   bb->end = end;
  }
  #endif /* HAVE_return */
  
--- 7118,7124 ----
    end = emit_jump_insn_after (gen_return (), bb->end);
    if (line_note)
      emit_line_note_after (NOTE_SOURCE_FILE (line_note),
! 			  NOTE_LINE_NUMBER (line_note), PREV_INSN (bb->end));
  }
  #endif /* HAVE_return */
  


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