This is the mail archive of the gcc-patches@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]

Increase attempts to make matching insn in purge_addressof_1


This was discussed on the GCC list last month and is due to some insns
on x86 not allowing certain hard registers for certain operands.
The test case is over 10K lines of proprietary Ada code.

Tested on i686-pc-linux-gnu.

Tue Mar 18 15:58:30 2003  Richard Kenner  <kenner at vlsi1 dot ultra dot nyu dot edu>

	* function.c (purge_addressof_1): For ADDRESSOF, see if SUB is a
	hard or virtual register and copy into pseudo if replacement fails.

*** gcc/function.c	11 Apr 2003 19:45:31 -0000	1.418
--- gcc/function.c	15 Apr 2003 21:11:26 -0000
*************** purge_addressof_1 (loc, insn, force, sto
*** 3053,3057 ****
  
        start_sequence ();
!       sub = force_operand (sub, NULL_RTX);
        if (! validate_change (insn, loc, sub, 0)
  	  && ! validate_replace_rtx (x, sub, insn))
--- 3053,3065 ----
  
        start_sequence ();
! 
!       /* If SUB is a or virtual register, try it as a pseudo-register. 
! 	 Otherwise, perhaps SUB is an expression, so generate code to compute
! 	 it.  */
!       if (GET_CODE (sub) == REG && REGNO (sub) <= LAST_VIRTUAL_REGISTER)
! 	sub = copy_to_reg (sub);
!       else
! 	sub = force_operand (sub, NULL_RTX);
! 
        if (! validate_change (insn, loc, sub, 0)
  	  && ! validate_replace_rtx (x, sub, insn))


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