As reported in https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02388.html .
Changing the mode of a hard register can lead to problems, or at least
it can make worse code if the result will need reloads.
* combine.c (change_zero_ext): Only change the mode of a hard register
destination if can_change_dest_mode holds for that.
From-SVN: r242812
+2016-11-23 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * combine.c (change_zero_ext): Only change the mode of a hard register
+ destination if can_change_dest_mode holds for that.
+
2016-11-23 Jeff Law <law@redhat.com>
* varasm.c (assemble_name): Increase buffer size for name.
else if (GET_CODE (x) == ZERO_EXTEND
&& SCALAR_INT_MODE_P (mode)
&& REG_P (XEXP (x, 0))
- && HARD_REGISTER_P (XEXP (x, 0)))
+ && HARD_REGISTER_P (XEXP (x, 0))
+ && can_change_dest_mode (XEXP (x, 0), 0, mode))
{
size = GET_MODE_PRECISION (GET_MODE (XEXP (x, 0)));
x = gen_rtx_REG (mode, REGNO (XEXP (x, 0)));