Commit 277e2873 by Anatoly Sokolov Committed by Anatoly Sokolov

sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.

	* config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
	* config/sparc/sparc.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
	(sparc_mode_dependent_address_p): New function.

From-SVN: r159694
parent 0350c97e
2010-05-22 Anatoly Sokolov <aesok@post.ru>
* config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
* config/sparc/sparc.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
(sparc_mode_dependent_address_p): New function.
2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
* Makefile.in: Fix c-pch.o and ggc-common.o dependencies on timevars.
......
......@@ -412,6 +412,7 @@ static bool sparc_tls_referenced_p (rtx);
static rtx legitimize_tls_address (rtx);
static rtx legitimize_pic_address (rtx, rtx);
static rtx sparc_legitimize_address (rtx, rtx, enum machine_mode);
static bool sparc_mode_dependent_address_p (const_rtx);
static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool);
static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
......@@ -499,6 +500,8 @@ static bool fpu_option_set = false;
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS sparc_legitimize_address
#undef TARGET_MODE_DEPENDENT_ADDRESS_P
#define TARGET_MODE_DEPENDENT_ADDRESS_P sparc_mode_dependent_address_p
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sparc_expand_builtin
......@@ -3519,6 +3522,35 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return x;
}
/* Return true if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for.
In PIC mode,
(mem:HI [%l7+a])
is not equivalent to
(mem:QI [%l7+a]) (mem:QI [%l7+a+1])
because [%l7+a+1] is interpreted as the address of (a+1). */
static bool
sparc_mode_dependent_address_p (const_rtx addr)
{
if (flag_pic && GET_CODE (addr) == PLUS)
{
rtx op0 = XEXP (addr, 0);
rtx op1 = XEXP (addr, 1);
if (op0 == pic_offset_table_rtx
&& SYMBOLIC_CONST (op1))
return true;
}
return false;
}
#ifdef HAVE_GAS_HIDDEN
# define USE_HIDDEN_LINKONCE 1
#else
......
......@@ -1835,33 +1835,6 @@ do { \
#define RTX_OK_FOR_OLO10_P(X) \
(GET_CODE (X) == CONST_INT && INTVAL (X) >= -0x1000 && INTVAL (X) < 0xc00 - 8)
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for.
In PIC mode,
(mem:HI [%l7+a])
is not equivalent to
(mem:QI [%l7+a]) (mem:QI [%l7+a+1])
because [%l7+a+1] is interpreted as the address of (a+1). */
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
{ \
if (flag_pic == 1) \
{ \
if (GET_CODE (ADDR) == PLUS) \
{ \
rtx op0 = XEXP (ADDR, 0); \
rtx op1 = XEXP (ADDR, 1); \
if (op0 == pic_offset_table_rtx \
&& SYMBOLIC_CONST (op1)) \
goto LABEL; \
} \
} \
}
/* Try a machine-dependent way of reloading an illegitimate address
operand. If we find one, push the reload and jump to WIN. This
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment