Delete dead code after reload

Jeffrey A Law law@cygnus.com
Fri Oct 23 20:37:00 GMT 1998


Experiments have shown that dead code does exist after reload has completed,
either because of reload limitations or dead code exposed by register
allocation, particularly for uses of (subreg:M (reg: N)) where the width
of M is less than N.

This change allows flow to delete such dead code.

        * flow.c (life_analysis_1): Enable "rescan" code after reload.
        (propagate_block): Delete dead code after reload.


Index: flow.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/flow.c,v
retrieving revision 1.144
diff -c -3 -p -r1.144 flow.c
*** flow.c	1998/10/23 21:32:32	1.144
--- flow.c	1998/10/24 03:31:50
*************** life_analysis_1 (f, nregs)
*** 1434,1441 ****
  		 basic_block_live_at_end[i], 0, j,
  		 {
  		   consider = 1;
! 		   if (!reload_completed
! 		       && REGNO_REG_SET_P (basic_block_significant[i], j))
  		     {
  		       must_rescan = 1;
  		       goto done;
--- 1434,1440 ----
  		 basic_block_live_at_end[i], 0, j,
  		 {
  		   consider = 1;
! 		   if (REGNO_REG_SET_P (basic_block_significant[i], j))
  		     {
  		       must_rescan = 1;
  		       goto done;
*************** propagate_block (old, first, last, final
*** 1779,1785 ****
  	     "delete" it by turning it into a NOTE of type NOTE_INSN_DELETED.
  	     We could really delete it with delete_insn, but that
  	     can cause trouble for first or last insn in a basic block.  */
! 	  if (!reload_completed && final && insn_is_dead)
  	    {
  	      PUT_CODE (insn, NOTE);
  	      NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
--- 1778,1784 ----
  	     "delete" it by turning it into a NOTE of type NOTE_INSN_DELETED.
  	     We could really delete it with delete_insn, but that
  	     can cause trouble for first or last insn in a basic block.  */
! 	  if (final && insn_is_dead)
  	    {
  	      PUT_CODE (insn, NOTE);
  	      NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;



More information about the Gcc-patches mailing list