arm.c: add REG_MAYBE_DEAD notes for frame pointer initialisation.

Nick Clifton nickc@cambridge.redhat.com
Tue Jan 22 09:35:00 GMT 2002


Hi Richard,

> >   Under some circumstances propagate_one_insn() will complain about
> >   the apparently useless insns to initialise the frame pointer
> >   generated by the ARM prologue code.  The patch below adds a
> >   REG_MAYBE_DEAD note to these insns to prevent the problem from
> >   occurring.
> 
> This will simply remove the insn without complaining,
> which is surely not what you wanted wrt a frame pointer.

Doh!  Yes, sorry about that.  I should be adding a USE like this.

Cheers
        Nick

2002-01-22  Nick Clifton  <nickc@cambridge.redhat.com>

	* config/arm/arm.c (arm_expand_prologue): Replace REG_MAYBE_DEAD
	note with a USE.
	(thumb_expand_prologue): Replace REG_MAYBE_DEAD	note with a USE.

Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.187
diff -c -3 -p -w -r1.187 arm.c
*** arm.c	2002/01/16 16:54:21	1.187
--- arm.c	2002/01/22 17:08:10
*************** arm_expand_prologue ()
*** 8343,8353 ****
  	      insn = gen_rtx_MEM (SImode, insn);
  	    }
  
! 	  insn = gen_rtx_SET (SImode, ip_rtx, insn);
! 	  insn = emit_insn (insn);
! 	  /* Add a reg note to stop propogate_one_insn() from barfing.  */
! 	  REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, ip_rtx,
! 						REG_NOTES (insn));
  	}
      }
  
--- 8343,8351 ----
  	      insn = gen_rtx_MEM (SImode, insn);
  	    }
  
! 	  emit_insn (gen_rtx_SET (SImode, ip_rtx, insn));
! 	  /* Add a USE to stop propagate_one_insn() from barfing.  */
! 	  emit_insn (gen_rtx_USE (VOIDmode, ip_rtx));
  	}
      }
  
*************** thumb_expand_prologue ()
*** 10162,10171 ****
  	      reg = gen_rtx (REG, SImode, LAST_LO_REGNUM);
  
  	      /* Save it by copying it into a high, scratch register.  */
! 	      insn = emit_insn (gen_movsi (spare, reg));
! 	      /* Add a reg note to stop propogate_one_insn() from barfing.  */
! 	      REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, spare,
! 						    REG_NOTES (insn));
  
  	      /* Decrement the stack.  */
  	      emit_insn (gen_movsi (reg, GEN_INT (- amount)));
--- 10160,10168 ----
  	      reg = gen_rtx (REG, SImode, LAST_LO_REGNUM);
  
  	      /* Save it by copying it into a high, scratch register.  */
! 	      emit_insn (gen_movsi (spare, reg));
! 	      /* Add a USE to stop propagate_one_insn() from barfing.  */
! 	      emit_insn (gen_rtx_USE (VOIDmode, spare));
  
  	      /* Decrement the stack.  */
  	      emit_insn (gen_movsi (reg, GEN_INT (- amount)));




More information about the Gcc-patches mailing list