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]

RFA: Fix PR rtl-optimization/20756


bootstrapped & regtested on i686-pc-linux-gnu.
2005-04-08  J"orn Rennecke <joern.rennecke@st.com>

	PR rtl-optimization/20756:
	* basic-block.h (PROP_DEAD_INSN): Define.
	* flow.c (propagate_one_insn): Set during mark_set_regs call
	for a dead insn.

Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.246
diff -p -r1.246 basic-block.h
*** basic-block.h	18 Mar 2005 20:15:04 -0000	1.246
--- basic-block.h	8 Apr 2005 18:17:12 -0000
*************** enum update_life_extent
*** 740,745 ****
--- 740,747 ----
  #define PROP_SCAN_DEAD_STORES	256	/* Scan for dead code.  */
  #define PROP_ASM_SCAN		512	/* Internal flag used within flow.c
  					   to flag analysis of asms.  */
+ #define PROP_DEAD_INSN		1024	/* Internal flag used within flow.c
+ 					   to flag analysis of dead insn.  */
  #define PROP_FINAL		(PROP_DEATH_NOTES | PROP_LOG_LINKS  \
  				 | PROP_REG_INFO | PROP_KILL_DEAD_CODE  \
  				 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.623
diff -p -r1.623 flow.c
*** flow.c	1 Apr 2005 03:42:39 -0000	1.623
--- flow.c	8 Apr 2005 18:17:12 -0000
*************** propagate_one_insn (struct propagate_blo
*** 1689,1696 ****
  	fatal_insn ("Attempt to delete prologue/epilogue insn:", insn);
  
        /* Record sets.  Do this even for dead instructions, since they
! 	 would have killed the values if they hadn't been deleted.  */
        mark_set_regs (pbi, PATTERN (insn), insn);
  
        /* CC0 is now known to be dead.  Either this insn used it,
  	 in which case it doesn't anymore, or clobbered it,
--- 1689,1700 ----
  	fatal_insn ("Attempt to delete prologue/epilogue insn:", insn);
  
        /* Record sets.  Do this even for dead instructions, since they
! 	 would have killed the values if they hadn't been deleted.  To
! 	 be consistent, we also have to emit a clobber when we delete
! 	 an insn that clobbers a live register.  */
!       pbi->flags |= PROP_DEAD_INSN;
        mark_set_regs (pbi, PATTERN (insn), insn);
+       pbi->flags &= ~PROP_DEAD_INSN;
  
        /* CC0 is now known to be dead.  Either this insn used it,
  	 in which case it doesn't anymore, or clobbered it,
*************** mark_set_1 (struct propagate_block_info 
*** 2955,2960 ****
--- 2959,2966 ----
  		  }
  		CLEAR_REGNO_REG_SET (pbi->reg_live, i);
  	      }
+ 	  if (flags & PROP_DEAD_INSN)
+ 	    emit_insn_after (gen_rtx_CLOBBER (VOIDmode, reg), insn);
  	}
      }
    else if (REG_P (reg))

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