diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-25 02:05:39 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-25 02:05:39 +0000 |
commit | 8061fd406c80d6b0e410a4fc7183b8e40d1b34c3 (patch) | |
tree | b576041624d3bad6fd68a1738327a69f924f2bd7 /gcc/expmed.c | |
parent | ed2e28f9ec6161127b8fb99eef4d9d29e561841b (diff) | |
download | gcc-8061fd406c80d6b0e410a4fc7183b8e40d1b34c3.tar.gz |
PR middle-end/19330
* expmed.c (extract_bit_field): Use adjust_address instead of
gen_lowpart when op0 is a MEM.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94198 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index dcd77ac16ad..47b3d0db311 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1158,12 +1158,18 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, enum machine_mode imode = int_mode_for_mode (GET_MODE (op0)); if (imode != GET_MODE (op0)) { - op0 = gen_lowpart (imode, op0); + if (MEM_P (op0)) + op0 = adjust_address (op0, imode, 0); + else + { + gcc_assert (imode != BLKmode); + op0 = gen_lowpart (imode, op0); - /* If we got a SUBREG, force it into a register since we aren't going - to be able to do another SUBREG on it. */ - if (GET_CODE (op0) == SUBREG) - op0 = force_reg (imode, op0); + /* If we got a SUBREG, force it into a register since we + aren't going to be able to do another SUBREG on it. */ + if (GET_CODE (op0) == SUBREG) + op0 = force_reg (imode, op0); + } } } |