Hi All,
Previously I allowed 0s unconditionally through aarch64_can_const_movi_rtx_p
because we should always be able to use movi with 0 regardless of the mode.
However this was causing issues when a vector contained a 0 element and
another value which was too complex for a movi. In theory this should have
worked but it's failing an integrity check because of the type of the 0 element
being a none floating type.
Moving the exception to only allow floating point 0s restores the previous
behavior of the compiler.
Ok for trunk?
Bootstrapped and regtested on aach64-none-linux-gnu and no issues.
Thanks,
Tamar
gcc/
2017-08-01 Tamar Christina <[email protected]>
* config/aarch64/aarch64.c
(aarch64_can_const_movi_rtx_p): Move 0 check.
--
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 055ebafb8305412e192c77e4177d08c914d5ccee..5a2ad7e9156a6f0389c09470cf1414bff45d8099 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4787,10 +4787,6 @@ aarch64_can_const_movi_rtx_p (rtx x, machine_mode mode)
if (!TARGET_SIMD)
return false;
- /* We make a general exception for 0. */
- if (aarch64_float_const_zero_rtx_p (x))
- return true;
-
machine_mode vmode, imode;
unsigned HOST_WIDE_INT ival;
@@ -4800,6 +4796,10 @@ aarch64_can_const_movi_rtx_p (rtx x, machine_mode mode)
if (!aarch64_reinterpret_float_as_int (x, &ival))
return false;
+ /* We make a general exception for 0. */
+ if (aarch64_float_const_zero_rtx_p (x))
+ return true;
+
imode = int_mode_for_mode (mode);
}
else if (GET_CODE (x) == CONST_INT