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]

Re: [RFC,PATCH] Still problems with move loop invariant and eh regs (#24762)


Hello,

> The general idea looks OK to me, but:
> * use an accessor macro in rtl.h
> * document it in doc/rtl.texi
Ok. Done with the attached patch.

Bye,

-Andreas-

Index: gcc/df-scan.c
===================================================================
*** gcc/df-scan.c.orig	2006-07-21 15:59:41.000000000 +0200
--- gcc/df-scan.c	2006-07-21 16:01:29.000000000 +0200
*************** df_bb_refs_record (struct dataflow *dflo
*** 1643,1650 ****
    FOR_BB_INSNS (bb, insn)
      {
        df_insn_create_insn_record (dflow, insn);
!       if (INSN_P (insn))
! 	{
  	  /* Record defs within INSN.  */
  	  DF_INSN_LUID (df, insn) = luid++;
  	  df_insn_refs_record (dflow, bb, insn);
--- 1643,1655 ----
    FOR_BB_INSNS (bb, insn)
      {
        df_insn_create_insn_record (dflow, insn);
! 
!       /* dw2_build_landing_pad marks clobbers introduced for eh regs with the
! 	 call flag.  */
!       if (INSN_P (insn) 
! 	  && !(GET_CODE (PATTERN (insn)) == CLOBBER 
! 	       && CLOBBER_EH_REG_P (PATTERN (insn))))
! 	{  
  	  /* Record defs within INSN.  */
  	  DF_INSN_LUID (df, insn) = luid++;
  	  df_insn_refs_record (dflow, bb, insn);
Index: gcc/except.c
===================================================================
*** gcc/except.c.orig	2006-07-21 16:00:22.000000000 +0200
--- gcc/except.c	2006-07-21 16:01:29.000000000 +0200
*************** dw2_build_landing_pads (void)
*** 1648,1654 ****
  	    break;
  	  if (! call_used_regs[r])
  	    {
! 	      emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
  	      clobbers_hard_regs = true;
  	    }
  	}
--- 1648,1658 ----
  	    break;
  	  if (! call_used_regs[r])
  	    {
! 	      rtx insn = emit_insn (gen_rtx_CLOBBER (VOIDmode, 
! 						     gen_rtx_REG (Pmode, r)));
! 
! 	      /* Abuse the call flag in the insn to tell df to ignore it.  */
! 	      CLOBBER_EH_REG_P (PATTERN (insn)) = 1;
  	      clobbers_hard_regs = true;
  	    }
  	}
Index: gcc/rtl.h
===================================================================
*** gcc/rtl.h.orig	2006-07-21 15:59:41.000000000 +0200
--- gcc/rtl.h	2006-07-21 16:01:29.000000000 +0200
*************** extern void rtl_check_failed_flag (const
*** 765,770 ****
--- 765,774 ----
  #define SIBLING_CALL_P(RTX)						\
    (RTL_FLAG_CHECK1("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
  
+ /* 1 if RTX is a clobber emitted for an exception handling register.  */
+ #define CLOBBER_EH_REG_P(RTX)                                         \
+   (RTL_FLAG_CHECK1("CLOBBER_EH_REG_P", (RTX), CLOBBER)->call)
+ 
  /* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch.  */
  #define INSN_ANNULLED_BRANCH_P(RTX)					\
    (RTL_FLAG_CHECK3("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN, CALL_INSN, INSN)->unchanging)
Index: gcc/doc/rtl.texi
===================================================================
*** gcc/doc/rtl.texi.orig	2006-07-21 15:59:41.000000000 +0200
--- gcc/doc/rtl.texi	2006-07-21 16:01:29.000000000 +0200
*************** Stored in the @code{volatil} field and p
*** 873,878 ****
--- 873,886 ----
  Most uses of @code{SYMBOL_REF_FLAG} are historic and may be subsumed
  by @code{SYMBOL_REF_FLAGS}.  Certainly use of @code{SYMBOL_REF_FLAGS}
  is mandatory if the target requires more than one bit of storage.
+ 
+ @findex CLOBBER_EH_REG_P
+ @cindex @code{clobber} and @samp{/c}
+ @cindex @code{call}, in @code{clobber}
+ @item CLOBBER_EH_REG_P (@var{x})
+ Nonzero if the insn is a clobber emitted for an exception handling
+ register. Stored in the @code{call} field and printed as @samp{/c}.
+ 
  @end table
  
  These are the fields to which the above macros refer:


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