Bernd Schmidt wrote:

> I have created a new branch, "reload-branch", on which I'm going to 
> check in these changes.

Thanks!

With three changes described below, I'm able to bootstrap and test the
reload-branch on s390-ibm-linux and s390x-ibm-linux without regressions
against head (except two additional ACATS failures on s390 which may
simply be caused by a slightly different Ada front end code base).

The changes are:

- As mentioned in http://gcc.gnu.org/ml/gcc/2005-01/msg00911.html
  there is a code path in find_reloads that sets rld[].inc to a
  nonzero value even for a platform that doesn't actually *have*
  pre-/post-increment insns, leading to an ICE later on.

  The patch below simply avoids setting .inc unless it was already
  set to a nonzero value (by find_inc_amount).

- As mentioned in http://gcc.gnu.org/ml/gcc/2005-01/msg01112.html
  there are problems with reload ordering when optional reloads
  are disabled, leading to address reload insns being emitted after
  the main insn.

  The patch below is the same I suggested in that mail; it considers
  such address reloads to feed into both the optional reload and 
  the main insn in scan_rtx.

- Finally, there is still a (new) problem in the latest version of
  usable_for_inheritance: if an inherited register is chosen as
  override-in because it is not suitable as reload register due
  to HARD_REGNO_MODE_OK, it isn't even checked against the 
  *usable_regs array.

  The patch below adds back that check (using inmode, not mode).

Bye,
Ulrich


Index: gcc/reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.268.6.1
diff -c -p -r1.268.6.1 reload.c
*** gcc/reload.c        18 Mar 2005 18:40:32 -0000      1.268.6.1
--- gcc/reload.c        18 Mar 2005 21:43:47 -0000
*************** find_reloads (struct insn_chain *chain, 
*** 3215,3222 ****
                             MODE_BASE_REG_CLASS (VOIDmode),
                             GET_MODE (XEXP (recog_data.operand[i], 0)),
                             VOIDmode, 0, 0, i, RELOAD_FOR_NONE);
!           rld[operand_reloadnum[i]].inc
!             = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
          }
        else if (goal_alternative_matched[i] == -1)
          {
--- 3215,3224 ----
                             MODE_BASE_REG_CLASS (VOIDmode),
                             GET_MODE (XEXP (recog_data.operand[i], 0)),
                             VOIDmode, 0, 0, i, RELOAD_FOR_NONE);
! 
!           if (rld[operand_reloadnum[i]].inc)
!             rld[operand_reloadnum[i]].inc
!               = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
          }
        else if (goal_alternative_matched[i] == -1)
          {
Index: gcc/reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.463.2.1
diff -c -p -r1.463.2.1 reload1.c
*** gcc/reload1.c       18 Mar 2005 18:40:33 -0000      1.463.2.1
--- gcc/reload1.c       18 Mar 2005 21:43:48 -0000
*************** scan_rtx (struct insn_chain *chain, rtx 
*** 1527,1533 ****
          if (! just_mark)
            rl->scanned_input = 1;
          if (rl->optional)
!           scan_rtx (chain, &contents, 0, reload_in_insn, 0, 0, 1);
          else
            scan_rtx (chain, &rl->in, 0, reload_in_insn, 0, 0, 1);
        }
--- 1527,1536 ----
          if (! just_mark)
            rl->scanned_input = 1;
          if (rl->optional)
!           {
!             scan_rtx (chain, &contents, 0, reload_in_insn, 0, 0, 1);
!             scan_rtx (chain, &contents, 0, rli, 0, 0, 1);
!           }
          else
            scan_rtx (chain, &rl->in, 0, reload_in_insn, 0, 0, 1);
        }
*************** scan_rtx (struct insn_chain *chain, rtx 
*** 1540,1546 ****
          if (! just_mark)
            rl->scanned_output = 1;
          if (rl->optional)
!           scan_rtx (chain, &contents, is_output, reload_out_insn, 0, 0, 1);
          else
            scan_rtx (chain, &rl->out, is_output, reload_out_insn, 0, 0, 1);
  
--- 1543,1552 ----
          if (! just_mark)
            rl->scanned_output = 1;
          if (rl->optional)
!           {
!             scan_rtx (chain, &contents, is_output, reload_out_insn, 0, 0, 1);
!             scan_rtx (chain, &contents, is_output, rli, 0, 0, 1);
!           }
          else
            scan_rtx (chain, &rl->out, is_output, reload_out_insn, 0, 0, 1);
  
*************** usable_for_inheritance (rtx head_rtx, st
*** 3289,3295 ****
       it must be valid in MODE, not just INMODE.  */
  
    if (mode != inmode && ! HARD_REGNO_MODE_OK (offsetted_regno, mode))
!     can_use_inheritance_reg = 0;
    else
      {
        nregs = HARD_REGNO_NREGS (offsetted_regno, mode);
--- 3295,3309 ----
       it must be valid in MODE, not just INMODE.  */
  
    if (mode != inmode && ! HARD_REGNO_MODE_OK (offsetted_regno, mode))
!     {
!       nregs = HARD_REGNO_NREGS (offsetted_regno, inmode);
! 
!       for (k = 0; k < nregs; k++)
!       if (! TEST_HARD_REG_BIT (*usable_regs, offsetted_regno + k))
!         return IT_NONE;
! 
!       can_use_inheritance_reg = 0;
!     }
    else
      {
        nregs = HARD_REGNO_NREGS (offsetted_regno, mode);


-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  [EMAIL PROTECTED]

Reply via email to