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

Andreas Krebbel krebbel1@de.ibm.com
Thu Jul 20 14:51:00 GMT 2006


Hello,

> Your proposed patch is troubling in a different way: it assumes that
> any CLOBBER that it sees is the one introduced in
> dw2_build_landing_pads.  I don't see how to be sure of that, and
> ignoring a different CLOBBER is going to lead to different problems.
I thought that nobody else emits standalone CLOBBERs in a catch
block for eh regs but I have no proof for that so I agree that this 
might cause problems.

> Perhaps we could use a bit in the insn to indicate that it should be
> ignored by DF, e.g., the call bit.  That will also give us a
> convenient hook to remove this code later.
I've attached a patch for this. Bootstrapped on s390 and s390x. The only
fail was "FAIL: PR27908 execution - source compiled test" on s390x but I've seen
this also on a clean builds several times so I don't think it is related to
that patch.

The patch fixes the c++ testcases as well.

Bye,

-Andreas-


Index: gcc/df-scan.c
===================================================================
*** gcc/df-scan.c.orig	2006-07-19 15:15:30.000000000 +0200
--- gcc/df-scan.c	2006-07-19 15:24:01.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,1654 ----
    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 && insn->call))
! 	{  
  	  /* 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-19 15:15:30.000000000 +0200
--- gcc/except.c	2006-07-19 15:22:17.000000000 +0200
*************** dw2_build_landing_pads (void)
*** 1647,1653 ****
  	    break;
  	  if (! call_used_regs[r])
  	    {
! 	      emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
  	      clobbers_hard_regs = true;
  	    }
  	}
--- 1647,1657 ----
  	    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.  */
! 	      gcc_assert (!insn->call);
! 	      insn->call = 1;
  	      clobbers_hard_regs = true;
  	    }
  	}



More information about the Gcc-patches mailing list