From: Uros Bizjak Date: Wed, 31 Jan 2018 21:37:54 +0000 (+0100) Subject: re PR rtl-optimization/84123 (internal compiler error: in gen_rtx_SUBREG, at emit... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c677f80adb4a075f3549a2aedde4ae9fdcb847c0;p=gcc.git re PR rtl-optimization/84123 (internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:908, alpha linux.) PR rtl-optimization/84123 * combine.c (change_zero_ext): Check if hard register satisfies can_change_dest_mode before calling gen_lowpart_SUBREG. From-SVN: r257270 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c03ceea32b..88df7ab9c19 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-31 Uros Bizjak + + PR rtl-optimization/84123 + * combine.c (change_zero_ext): Check if hard register satisfies + can_change_dest_mode before calling gen_lowpart_SUBREG. + 2018-01-31 Vladimir Makarov PR target/82444 diff --git a/gcc/combine.c b/gcc/combine.c index b14b248800e..970dd26778e 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11480,8 +11480,15 @@ change_zero_ext (rtx pat) gen_int_shift_amount (inner_mode, start)); else x = XEXP (x, 0); + if (mode != inner_mode) - x = gen_lowpart_SUBREG (mode, x); + { + if (HARD_REGISTER_P (x) + && !can_change_dest_mode (x, 0, mode)) + continue; + + x = gen_lowpart_SUBREG (mode, x); + } } else if (GET_CODE (x) == ZERO_EXTEND && GET_CODE (XEXP (x, 0)) == SUBREG @@ -11493,7 +11500,13 @@ change_zero_ext (rtx pat) size = GET_MODE_PRECISION (inner_mode); x = SUBREG_REG (XEXP (x, 0)); if (GET_MODE (x) != mode) - x = gen_lowpart_SUBREG (mode, x); + { + if (HARD_REGISTER_P (x) + && !can_change_dest_mode (x, 0, mode)) + continue; + + x = gen_lowpart_SUBREG (mode, x); + } } else if (GET_CODE (x) == ZERO_EXTEND && REG_P (XEXP (x, 0))