Commit 509bb9b6 by Richard Sandiford Committed by Richard Sandiford

[AArch64] Reject (high (const (plus anchor offset)))

The aarch64_legitimate_constant_p tests for HIGH and CONST seem
to be the wrong way round: (high (const ...)) is valid rtl that
could be passed in, but (const (high ...)) isn't.  As it stands,
we disallow anchor+offset but allow (high anchor+offset).

2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
	order of HIGH and CONST checks.

From-SVN: r256384
parent 7ad429a4
2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
* config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
order of HIGH and CONST checks.
2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
if the destination isn't an SSA_NAME.
......
......@@ -10449,6 +10449,9 @@ aarch64_legitimate_constant_p (machine_mode mode, rtx x)
if (CONST_WIDE_INT_P (x))
return false;
if (GET_CODE (x) == HIGH)
x = XEXP (x, 0);
/* Do not allow const (plus (anchor_symbol, const_int)). */
if (GET_CODE (x) == CONST)
{
......@@ -10460,9 +10463,6 @@ aarch64_legitimate_constant_p (machine_mode mode, rtx x)
return false;
}
if (GET_CODE (x) == HIGH)
x = XEXP (x, 0);
/* Treat symbols as constants. Avoid TLS symbols as they are complex,
so spilling them is better than rematerialization. */
if (SYMBOL_REF_P (x) && !SYMBOL_REF_TLS_MODEL (x))
......
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