This is the mail archive of the gcc@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: reload-branch created


Ulrich Weigand wrote:

- 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.

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)
{

This is wrong. inc is unconditionally cleared in push_reload, so it can't be nonzero here.


I did a bit of research into how autoinc is currently dealt with by reload. The obscure "out && ! out_reg" test is used at the last stage, but this condition is set up a bit earlier in choose_reload_regs with a much more sensible test for PRE_DEC codes etc.

I guess the best solution is to change the place you modified, but to use a test that checks for autoinc codes. I'll come up with something.


Bernd



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