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]

fix ia64 wrt cprop-registers


The cprop-forward pass can optimize the epilogue to use either the
frame pointer, or one of the iterators from the prologue.  Definitely
not something you'd have expected to be able to do within the epilogue
generation code.  So mark the iterator initialization possibly dead.


r~


        * config/ia64/ia64.c (spill_restore_mem): Mark iterator 
        initialization as possibly dead.

Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.131
diff -c -p -d -r1.131 ia64.c
*** ia64.c	2001/12/11 23:03:22	1.131
--- ia64.c	2001/12/15 02:27:26
*************** spill_restore_mem (reg, cfa_off)
*** 1771,1777 ****
      }
    else
      {
!       rtx seq;
  
        if (disp == 0)
  	seq = gen_movdi (spill_fill_data.iter_reg[iter],
--- 1771,1777 ----
      }
    else
      {
!       rtx seq, insn;
  
        if (disp == 0)
  	seq = gen_movdi (spill_fill_data.iter_reg[iter],
*************** spill_restore_mem (reg, cfa_off)
*** 1797,1813 ****
  
        /* Careful for being the first insn in a sequence.  */
        if (spill_fill_data.init_after)
! 	spill_fill_data.init_after
! 	  = emit_insn_after (seq, spill_fill_data.init_after);
        else
  	{
  	  rtx first = get_insns ();
  	  if (first)
! 	    spill_fill_data.init_after
! 	      = emit_insn_before (seq, first);
  	  else
! 	    spill_fill_data.init_after = emit_insn (seq);
  	}
      }
  
    mem = gen_rtx_MEM (GET_MODE (reg), spill_fill_data.iter_reg[iter]);
--- 1797,1822 ----
  
        /* Careful for being the first insn in a sequence.  */
        if (spill_fill_data.init_after)
! 	insn = emit_insn_after (seq, spill_fill_data.init_after);
        else
  	{
  	  rtx first = get_insns ();
  	  if (first)
! 	    insn = emit_insn_before (seq, first);
  	  else
! 	    insn = emit_insn (seq);
  	}
+       spill_fill_data.init_after = insn;
+ 
+       /* If DISP is 0, we may or may not have a further adjustment
+ 	 afterward.  If we do, then the load/store insn may be modified
+ 	 to be a post-modify.  If we don't, then this copy may be
+ 	 eliminated by copyprop_hardreg_forward, which makes this
+ 	 insn garbage, which runs afoul of the sanity check in
+ 	 propagate_one_insn.  So mark this insn as legal to delete.  */
+       if (disp == 0)
+ 	REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx,
+ 					     REG_NOTES (insn));
      }
  
    mem = gen_rtx_MEM (GET_MODE (reg), spill_fill_data.iter_reg[iter]);


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