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]

varasm fix for


This fix is prerequisit for adding the s390 backend to gcc-3.0.  General, the 
add of s390 backend into gcc-3.0 is approved by Mark Mitchell. Also the fix 
down below was approved with editoral changes to be done. 
Please tell me, if it is ok to commit.  

2000-07-30  Hartmut Penner <hpenner@de.ibm.com>
	* varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in constant
	pool to be identical by string address and index. 	

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.161.2.14
diff -c -p -r1.161.2.14 varasm.c
*** varasm.c	2001/07/26 01:36:31	1.161.2.14
--- varasm.c	2001/07/27 11:11:07
*************** free_varasm_status (f)
*** 3370,3376 ****
    f->varasm = NULL;
  }
  
! enum kind { RTX_DOUBLE, RTX_INT };
  
  /* Express an rtx for a constant integer (perhaps symbolic)
     as the sum of a symbol or label plus an explicit integer.
--- 3370,3376 ----
    f->varasm = NULL;
  }
  
! enum kind { RTX_DOUBLE, RTX_INT, RTX_UNSPEC };
  
  /* Express an rtx for a constant integer (perhaps symbolic)
     as the sum of a symbol or label plus an explicit integer.
*************** decode_rtx_const (mode, x, value)
*** 3438,3444 ****
        abort ();
      }
  
!   if (value->kind == RTX_INT && value->un.addr.base != 0)
      switch (GET_CODE (value->un.addr.base))
        {
        case SYMBOL_REF:
--- 3438,3461 ----
        abort ();
      }
  
!   if (value->kind == RTX_INT && value->un.addr.base != 0
!       && GET_CODE (value->un.addr.base) == UNSPEC)
!     {      
!       /* For a simple UNSPEC, the base is set to the
! 	 operand, the kind field is set to the index of
! 	 the unspec expression. 
! 	 Together with the code below, in case that
! 	 the operand is a SYMBOL_REF or LABEL_REF, 
! 	 the address of the string or the code_label 
! 	 is taken as base.  */
!       if (XVECLEN (value->un.addr.base, 0) == 1)
!         {
! 	  value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1);
! 	  value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0);
! 	}
!     }
! 
!   if (value->kind != RTX_DOUBLE && value->un.addr.base != 0)
      switch (GET_CODE (value->un.addr.base))
        {
        case SYMBOL_REF:
*************** simplify_subtraction (x)
*** 3468,3474 ****
    decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
    decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  
!   if (val0.un.addr.base == val1.un.addr.base)
      return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
    return x;
  }
--- 3485,3492 ----
    decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
    decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  
!   if (val0.kind != RTX_DOUBLE && val0.kind == val1.kind
!       && val0.un.addr.base == val1.un.addr.base)
      return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
    return x;
  }


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