This is the mail archive of the gcc-bugs@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: New bootstrap failure on ARM


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

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