Bad code from egcs-1.1b

Jason Merrill jason@cygnus.com
Mon Oct 26 02:08:00 GMT 1998


>>>>> Jeffrey A Law <law@cygnus.com> writes:

 > I'm thinking the easiest solution is either a nop copy or NOTE_INSN_DELETED
 > right after the BLOCK_BEGIN note and setting f->before_jump to point to the
 > nop copy/NOTE_INSN_DELETED.

I think using NOTE_INSN_DELETED is the way to go.  This seems to fix it:

Sun Oct 25 23:36:52 1998  Jason Merrill  <jason@yorick.cygnus.com>

	* stmt.c (expand_fixup): Set fixup->before_jump to a
	NOTE_INSN_DELETED instead of a NOTE_INSN_BLOCK_BEG.

Index: stmt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stmt.c,v
retrieving revision 1.50
diff -c -p -r1.50 stmt.c
*** stmt.c	1998/10/13 15:25:18	1.50
--- stmt.c	1998/10/26 07:40:32
*************** expand_fixup (tree_label, rtl_label, las
*** 886,904 ****
  	 code which we might later insert at this point in the insn
  	 stream.  Also, the BLOCK node will be the parent (i.e. the
  	 `SUPERBLOCK') of any other BLOCK nodes which we might create
! 	 later on when we are expanding the fixup code.  */
  
        {
          register rtx original_before_jump
            = last_insn ? last_insn : get_last_insn ();
  
          start_sequence ();
          pushlevel (0);
!         fixup->before_jump = emit_note (NULL_PTR, NOTE_INSN_BLOCK_BEG);
          last_block_end_note = emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
          fixup->context = poplevel (1, 0, 0);  /* Create the BLOCK node now! */
          end_sequence ();
!         emit_insns_after (fixup->before_jump, original_before_jump);
        }
  
        fixup->block_start_count = block_start_count;
--- 886,910 ----
  	 code which we might later insert at this point in the insn
  	 stream.  Also, the BLOCK node will be the parent (i.e. the
  	 `SUPERBLOCK') of any other BLOCK nodes which we might create
! 	 later on when we are expanding the fixup code.
  
+ 	 Note that optimization passes (including expand_end_loop)
+ 	 might move the *_BLOCK notes away, so we use a NOTE_INSN_DELETED
+ 	 as a placeholder.  */
+ 
        {
          register rtx original_before_jump
            = last_insn ? last_insn : get_last_insn ();
+ 	rtx start;
  
          start_sequence ();
          pushlevel (0);
!         start = emit_note (NULL_PTR, NOTE_INSN_BLOCK_BEG);
! 	fixup->before_jump = emit_note (NULL_PTR, NOTE_INSN_DELETED);
          last_block_end_note = emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
          fixup->context = poplevel (1, 0, 0);  /* Create the BLOCK node now! */
          end_sequence ();
!         emit_insns_after (start, original_before_jump);
        }
  
        fixup->block_start_count = block_start_count;



More information about the Gcc-bugs mailing list