-/* If ORIG_X is a constant pool reference, return its known value,
- otherwise ORIG_X. */
-
-static rtx
-rs6000_delegitimize_address (rtx x)
-{
- rtx orig_x = delegitimize_mem_from_attrs (x);
-
- x = orig_x;
-
- if (!MEM_P (x))
- return orig_x;
-
- x = XEXP (x, 0);
-
- if (legitimate_constant_pool_address_p (x)
- && GET_CODE (XEXP (x, 1)) == CONST
- && GET_CODE (XEXP (XEXP (x, 1), 0)) == MINUS
- && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 0)) == SYMBOL_REF
- && constant_pool_expr_p (XEXP (XEXP (XEXP (x, 1), 0), 0))
- && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 1)) == SYMBOL_REF
- && toc_relative_expr_p (XEXP (XEXP (XEXP (x, 1), 0), 1)))
- return get_pool_constant (XEXP (XEXP (XEXP (x, 1), 0), 0));
-
- return orig_x;
-}
-