more on ICE in current mainline (x86) (msg00269.html)

Richard Henderson rth@cygnus.com
Mon Aug 14 18:02:00 GMT 2000


On Mon, Aug 14, 2000 at 04:25:26PM -0700, Ulrich Drepper wrote:
> I've verified that it is still a problem with today's mainline gcc.
> The debugger shows that an unspec slipped through to gen_lowpart which
> is obviously wrong.


        * config/i386/i386.c (legitimize_pic_address): Use Pmode
        for all CONSTs.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.169
diff -c -p -d -r1.169 i386.c
*** i386.c	2000/08/04 04:14:52	1.169
--- i386.c	2000/08/15 00:59:58
*************** legitimize_pic_address (orig, reg)
*** 2589,2596 ****
  	 base address (@GOTOFF).  */
  
        current_function_uses_pic_offset_table = 1;
!       new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, addr), 7);
!       new = gen_rtx_CONST (VOIDmode, new);
        new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
  
        if (reg != 0)
--- 2589,2596 ----
  	 base address (@GOTOFF).  */
  
        current_function_uses_pic_offset_table = 1;
!       new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 7);
!       new = gen_rtx_CONST (Pmode, new);
        new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
  
        if (reg != 0)
*************** legitimize_pic_address (orig, reg)
*** 2605,2612 ****
  	 Global Offset Table (@GOT). */
  
        current_function_uses_pic_offset_table = 1;
!       new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, addr), 6);
!       new = gen_rtx_CONST (VOIDmode, new);
        new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
        new = gen_rtx_MEM (Pmode, new);
        RTX_UNCHANGING_P (new) = 1;
--- 2605,2612 ----
  	 Global Offset Table (@GOT). */
  
        current_function_uses_pic_offset_table = 1;
!       new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 6);
!       new = gen_rtx_CONST (Pmode, new);
        new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
        new = gen_rtx_MEM (Pmode, new);
        RTX_UNCHANGING_P (new) = 1;
*************** legitimize_pic_address (orig, reg)
*** 2641,2649 ****
  	      && GET_CODE (op1) == CONST_INT)
  	    {
  	      current_function_uses_pic_offset_table = 1;
! 	      new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, op0), 7);
! 	      new = gen_rtx_PLUS (VOIDmode, new, op1);
! 	      new = gen_rtx_CONST (VOIDmode, new);
  	      new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
  
  	      if (reg != 0)
--- 2641,2649 ----
  	      && GET_CODE (op1) == CONST_INT)
  	    {
  	      current_function_uses_pic_offset_table = 1;
! 	      new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op0), 7);
! 	      new = gen_rtx_PLUS (Pmode, new, op1);
! 	      new = gen_rtx_CONST (Pmode, new);
  	      new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
  
  	      if (reg != 0)


More information about the Gcc-patches mailing list