gcc failed to bootstrap on Linux/mipsel

Richard Henderson rth@redhat.com
Wed Jan 30 10:09:00 GMT 2002


On Wed, Jan 30, 2002 at 09:05:55AM -0800, H . J . Lu wrote:
> The o32 assmebler has to turn
> 
> 	la      $25,getenv
> 	jal     $31,$25
> 
> into
> 	la      $25,getenv
> 	jal     $31,$25
> 	lw      gp,16(frame_register)
> 
> That is why it failed at
> 
> 0x479f34 <init_standard_includes+108>:  lw      gp,16(s8)
> 
> since you moved the initialization of s8/fp after "jal".

If you knew what the problem was, why didn't you say so rather
than make me guess?

Fixed.


r~


	* sched-deps.c (sched_analyze): Make a call read the frame pointer.

Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.32
diff -c -p -d -r1.32 sched-deps.c
*** sched-deps.c	2002/01/29 22:11:08	1.32
--- sched-deps.c	2002/01/30 18:03:14
*************** sched_analyze (deps, head, tail)
*** 1267,1286 ****
  	    }
  	  else
  	    {
- 	      /* A call may read and modify global register variables.
- 		 Other call-clobbered hard regs may be clobbered.  We
- 		 don't know what set of fixed registers might be used
- 		 by the function.  It is certain that the stack pointer
- 		 is among them, but be conservative.  */
  	      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
  		if (global_regs[i])
  		  {
  		    SET_REGNO_REG_SET (reg_pending_sets, i);
  		    SET_REGNO_REG_SET (reg_pending_uses, i);
  		  }
  		else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
  		  SET_REGNO_REG_SET (reg_pending_clobbers, i);
  		else if (fixed_regs[i])
  		  SET_REGNO_REG_SET (reg_pending_uses, i);
  	    }
  
--- 1267,1295 ----
  	    }
  	  else
  	    {
  	      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ 		/* A call may read and modify global register variables.  */
  		if (global_regs[i])
  		  {
  		    SET_REGNO_REG_SET (reg_pending_sets, i);
  		    SET_REGNO_REG_SET (reg_pending_uses, i);
  		  }
+ 		/* Other call-clobbered hard regs may be clobbered.  */
  		else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
  		  SET_REGNO_REG_SET (reg_pending_clobbers, i);
+ 		/* We don't know what set of fixed registers might be used
+ 		   by the function, but it is certain that the stack pointer
+ 		   is among them, but be conservative.  */
  		else if (fixed_regs[i])
+ 		  SET_REGNO_REG_SET (reg_pending_uses, i);
+ 		/* The frame pointer is normally not used by the function
+ 		   itself, but by the debugger.  */
+ 		/* ??? MIPS o32 is an exception.  It uses the frame pointer
+ 		   in the macro expansion of jal but does not represent this
+ 		   fact in the call_insn rtl.  */
+ 		else if (i == FRAME_POINTER_REGNUM
+ 			 || (i == HARD_FRAME_POINTER_REGNUM
+ 			     && (! reload_completed || frame_pointer_needed)))
  		  SET_REGNO_REG_SET (reg_pending_uses, i);
  	    }
  



More information about the Gcc-patches mailing list