mn10200 prologue fix

Jeff Law law@porcupine.slc.redhat.com
Wed Jul 10 12:04:00 GMT 2002


We can't tell if the static chain will actually be used or not at this
point during compilation.  So we just mark it as maybe dead.  This fixes
a slew of compile.exp failures on the mn102.

	* mn10200.c (expand_prologue): Create REG_MAYBE_DEAD notes
	as appropriate.

Index: mn10200.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10200/mn10200.c,v
retrieving revision 1.25
diff -c -3 -p -r1.25 mn10200.c
*** mn10200.c	10 Jul 2002 17:26:31 -0000	1.25
--- mn10200.c	10 Jul 2002 18:20:10 -0000
*************** expand_prologue ()
*** 690,702 ****
      }
  
    /* Now put the static chain back where the rest of the function
!      expects to find it.  */
    if (current_function_needs_context)
      {
!       emit_move_insn (gen_rtx_REG (PSImode, STATIC_CHAIN_REGNUM),
! 		      gen_rtx (MEM, PSImode,
! 			       gen_rtx_PLUS (PSImode, stack_pointer_rtx,
! 					     GEN_INT (size))));
      }
  }
  
--- 690,712 ----
      }
  
    /* Now put the static chain back where the rest of the function
!      expects to find it. 
! 
!      Note that we may eliminate all references to this later, so we
!      mark the static chain as maybe dead.  */
    if (current_function_needs_context)
      {
!       rtx insn;
! 
!       insn = emit_move_insn (gen_rtx_REG (PSImode, STATIC_CHAIN_REGNUM),
! 			     gen_rtx (MEM, PSImode,
! 				      gen_rtx_PLUS (PSImode,
! 						    stack_pointer_rtx,
! 						    GEN_INT (size))));
!       REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
!                                             const0_rtx,
!                                             REG_NOTES (insn));
!   
      }
  }
  







More information about the Gcc-patches mailing list