diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-03-11 13:07:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-03-11 13:07:01 +0100 |
commit | 686d390a8fc1c0f72122910844e86d4a412c4e34 (patch) | |
tree | 5a071c96fbe5aca86382143c24af8284299b350e /gcc/expmed.c | |
parent | 02d472a2cb30a5692a57b2fc021b2fa043c84213 (diff) | |
download | gcc-686d390a8fc1c0f72122910844e86d4a412c4e34.zip gcc-686d390a8fc1c0f72122910844e86d4a412c4e34.tar.gz gcc-686d390a8fc1c0f72122910844e86d4a412c4e34.tar.bz2 |
re PR rtl-optimization/70174 (ICE at -O1 and above on x86_64-linux-gnu in gen_lowpart_general, at rtlhooks.c:63)
PR rtl-optimization/70174
* expmed.c (store_bit_field_using_insv): Use gen_lowpart_if_possible
followed by gen_lowpart on force_reg instead of just gen_lowpart.
* gcc.dg/pr70174.c: New test.
From-SVN: r234137
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 829b967..31d905b 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -658,24 +658,28 @@ store_bit_field_using_insv (const extraction_insn *insv, rtx op0, { if (GET_MODE_BITSIZE (GET_MODE (value)) >= bitsize) { + rtx tmp; /* Optimization: Don't bother really extending VALUE if it has all the bits we will actually use. However, if we must narrow it, be sure we do it correctly. */ if (GET_MODE_SIZE (GET_MODE (value)) < GET_MODE_SIZE (op_mode)) { - rtx tmp; - tmp = simplify_subreg (op_mode, value1, GET_MODE (value), 0); if (! tmp) tmp = simplify_gen_subreg (op_mode, force_reg (GET_MODE (value), value1), GET_MODE (value), 0); - value1 = tmp; } else - value1 = gen_lowpart (op_mode, value1); + { + tmp = gen_lowpart_if_possible (op_mode, value1); + if (! tmp) + tmp = gen_lowpart (op_mode, force_reg (GET_MODE (value), + value1)); + } + value1 = tmp; } else if (CONST_INT_P (value)) value1 = gen_int_mode (INTVAL (value), op_mode); |