This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: New bootstrap failure on ARM
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Richard dot Earnshaw at arm dot com, gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Dec 2001 15:49:23 +0000
- Subject: Re: New bootstrap failure on ARM
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> >
> > cleanup_subreg_operands ends up calling alter_subreg twice, the first time
> > when walking the MULT (which matches the "shift_operator" operand) and the
> > second time when processing operand[4] directly: on the second call
> > operand[4] is no-longer a subreg and the compiler segfaults. This occurs
> > because although recog_data.operand_loc[4] has been fixed,
> > recog_data.operand[4] still contains a subreg (but we then call
> > alter_subreg with something that isn't a subreg).
> >
> > It's not immediately obvious to me what the best fix is. Three possible
> > approaches spring to mind (in rough order of my preference):
> Uhm, I see...
> >
> > 1) Test *recog_data.operand_loc[i] for being a subreg rather than
> > recog_data.operand[i]
> I guess this is the best hack for it.
Good. That was my thought too.
> I can bring the patch tomorrow.
>
No need, I'm currently testing the following (though I'll add a comment
before committing):
<date> Richard Earnshaw <rearnsha@arm.com>
* final.c (cleanup_subreg_operands): Use recog_data.operand_loc
in test for a subreg.
Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.229
diff -p -r1.229 final.c
*** final.c 2001/12/06 11:49:09 1.229
--- final.c 2001/12/07 15:45:38
*************** cleanup_subreg_operands (insn)
*** 2741,2747 ****
extract_insn_cached (insn);
for (i = 0; i < recog_data.n_operands; i++)
{
! if (GET_CODE (recog_data.operand[i]) == SUBREG)
recog_data.operand[i] = alter_subreg (recog_data.operand_loc[i]);
else if (GET_CODE (recog_data.operand[i]) == PLUS
|| GET_CODE (recog_data.operand[i]) == MULT
--- 2741,2747 ----
extract_insn_cached (insn);
for (i = 0; i < recog_data.n_operands; i++)
{
! if (GET_CODE (*recog_data.operand_loc[i]) == SUBREG)
recog_data.operand[i] = alter_subreg (recog_data.operand_loc[i]);
else if (GET_CODE (recog_data.operand[i]) == PLUS
|| GET_CODE (recog_data.operand[i]) == MULT