From a990abffbfc5ee94b38f986f266cd5c365c0c045 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Tue, 18 Nov 2008 02:08:24 +0000 Subject: expmed.c (extract_bit_field_1): Also use a temporary and convert_extracted_bit_field when... * expmed.c (extract_bit_field_1): Also use a temporary and convert_extracted_bit_field when the conversion from ext_mode to the target mode requires explicit truncation. testsuite/ * gcc.c-torture/execute/20081117-1.c: New test. From-SVN: r141960 --- gcc/expmed.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/expmed.c') diff --git a/gcc/expmed.c b/gcc/expmed.c index 0c7e611e188..70a0d18bcb5 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1533,7 +1533,13 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, if (GET_MODE (xtarget) != ext_mode) { - if (REG_P (xtarget)) + /* Don't use LHS paradoxical subreg if explicit truncation is needed + between the mode of the extraction (word_mode) and the target + mode. Instead, create a temporary and use convert_move to set + the target. */ + if (REG_P (xtarget) + && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (xtarget)), + GET_MODE_BITSIZE (ext_mode))) { xtarget = gen_lowpart (ext_mode, xtarget); if (GET_MODE_SIZE (ext_mode) -- cgit v1.2.1