This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix PR middle-end/19330
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Jan 2005 19:20:45 -0500 (EST)
- Subject: [patch] Fix PR middle-end/19330
The enclosed change fixes PR middle-end/19330. It also appears to fix
PR middle-end/19332.
The patch partially reverts Kenner's change of 2004-11-26 because
gen_lowpart generates an incorrect op0 rtx when imode is BLKmode
(i.e., int_mode_for_mode didn't find a suitable integer mode).
This occurs on hppa64 when the mode of op0 is TCmode. More details
can be found in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19330>.
Tested on hppa64-hp-hpux11.11, hppa2.0w-hp-hpux11.11, hppa-unknown-linux-gnu
and i686-pc-linux-gnu with no observed regressions.
Ok for main?
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2005-01-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR middle-end/19330
* expmed.c (extract_bit_field): Use adjust_address instead of
gen_lowpart when op0 is a MEM.
Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.214
diff -u -3 -p -r1.214 expmed.c
--- expmed.c 10 Dec 2004 15:06:52 -0000 1.214
+++ expmed.c 23 Jan 2005 20:51:51 -0000
@@ -1158,12 +1158,18 @@ extract_bit_field (rtx str_rtx, unsigned
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);
+ }
}
}