File s390-literalpool-qrst of Package gcc43

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_legitimate_address_without_index_p
*** 2081,2087 ****
  
  /* Return true if ADDR is of kind symbol_ref or symbol_ref + const_int
     and return these parts in SYMREF and ADDEND.  You can pass NULL in
!    SYMREF and/or ADDEND if you are not interested in these values.  */
  
  static bool
  s390_symref_operand_p (rtx addr, rtx *symref, HOST_WIDE_INT *addend)
--- 2081,2088 ----
  
  /* Return true if ADDR is of kind symbol_ref or symbol_ref + const_int
     and return these parts in SYMREF and ADDEND.  You can pass NULL in
!    SYMREF and/or ADDEND if you are not interested in these values.
!    Literal pool references are *not* considered symbol references.  */
  
  static bool
  s390_symref_operand_p (rtx addr, rtx *symref, HOST_WIDE_INT *addend)
*************** s390_symref_operand_p (rtx addr, rtx *sy
*** 2094,2099 ****
--- 2095,2101 ----
    if (GET_CODE (addr) == PLUS)
      {
        if (GET_CODE (XEXP (addr, 0)) == SYMBOL_REF
+ 	  && !CONSTANT_POOL_ADDRESS_P (XEXP (addr, 0))
  	  && CONST_INT_P (XEXP (addr, 1)))
  	{
  	  tmpaddend = INTVAL (XEXP (addr, 1));
*************** s390_symref_operand_p (rtx addr, rtx *sy
*** 2103,2109 ****
  	return false;
      }
    else
!     if (GET_CODE (addr) != SYMBOL_REF)
  	return false;
  
    if (symref)
--- 2105,2111 ----
  	return false;
      }
    else
!     if (GET_CODE (addr) != SYMBOL_REF || CONSTANT_POOL_ADDRESS_P (addr))
  	return false;
  
    if (symref)
*************** s390_check_qrst_address (char c, rtx op,
*** 2129,2140 ****
    /* This check makes sure that no symbolic address (except literal
       pool references) are accepted by the R or T constraints.  */
    if (s390_symref_operand_p (op, NULL, NULL))
      {
-       if (!lit_pool_ok)
- 	return 0;
        if (!s390_decompose_address (op, &addr))
  	return 0;
!       if (!addr.literal_pool)
  	return 0;
        decomposed = true;
      }
--- 2131,2144 ----
    /* This check makes sure that no symbolic address (except literal
       pool references) are accepted by the R or T constraints.  */
    if (s390_symref_operand_p (op, NULL, NULL))
+     return 0;
+ 
+   /* Ensure literal pool references are only accepted if LIT_POOL_OK.  */
+   if (!lit_pool_ok)
      {
        if (!s390_decompose_address (op, &addr))
  	return 0;
!       if (addr.literal_pool)
  	return 0;
        decomposed = true;
      }
openSUSE Build Service is sponsored by