From: John David Anglin Date: Tue, 25 Jan 2005 02:05:39 +0000 (+0000) Subject: re PR middle-end/19330 (FAIL: gcc.c-torture/execute/20010605-2.c execution, -O1) X-Git-Tag: releases/gcc-4.0.0~1304 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6d2976a97625bea66e80fb63384a68ab79983ae;p=thirdparty%2Fgcc.git re PR middle-end/19330 (FAIL: gcc.c-torture/execute/20010605-2.c execution, -O1) PR middle-end/19330 * expmed.c (extract_bit_field): Use adjust_address instead of gen_lowpart when op0 is a MEM. From-SVN: r94198 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baf96ff73b7e..702f8ccb17f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-24 John David Anglin + + PR middle-end/19330 + * expmed.c (extract_bit_field): Use adjust_address instead of + gen_lowpart when op0 is a MEM. + 2005-01-24 Steven Bosscher * cfgexpand.c (expand_gimple_tailcall): Fix typo. diff --git a/gcc/expmed.c b/gcc/expmed.c index dcd77ac16ad0..47b3d0db311e 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); + } } }