This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA:] Fix PR target/18701, address adjustment error withparadoxical mem subregs. (Disallow them, I say!)
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 Dec 2004 11:30:17 -0500 (EST)
- Subject: Re: [RFA:] Fix PR target/18701, address adjustment error withparadoxical mem subregs. (Disallow them, I say!)
- References: <Pine.LNX.4.44.0412300729360.19913-100000@www.eyesopen.com>
On Thu, 30 Dec 2004, Roger Sayle wrote:
> This is also OK for mainline, but with one minor tweak. Could you
> move your change to correctly update imode and isize from the MEM_P
> clause you propose, into the "GET_CODE (x) === SUBREG" clause before
> the call to gen_lowpart_common? Conceptually, its when we change
> the value of "x" that we need to update it's mode (imode) and it's
> size (isize).
> If the above revisions successfully bootstrap and regression test for
> you and continue to resolve PR target/18701, consider it preapproved.
So committed as follows, tested cross and native as before.
(The other patch is committed too, being independent, fixing another bug.)
PR target/18701
* combine.c (gen_lowpart_for_combine): When stripping SUBREG of
MEM, adjust imode and isize.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.463
diff -p -c -r1.463 combine.c
*** combine.c 15 Dec 2004 01:02:55 -0000 1.463
--- combine.c 31 Dec 2004 16:13:44 -0000
*************** gen_lowpart_for_combine (enum machine_mo
*** 9355,9362 ****
if (GET_CODE (x) == SUBREG && MEM_P (SUBREG_REG (x)))
{
x = SUBREG_REG (x);
! if (GET_MODE (x) == omode)
return x;
}
result = gen_lowpart_common (omode, x);
--- 9355,9370 ----
if (GET_CODE (x) == SUBREG && MEM_P (SUBREG_REG (x)))
{
x = SUBREG_REG (x);
!
! /* For use in case we fall down into the address adjustments
! further below, we need to adjust the known mode and size of
! x; imode and isize, since we just adjusted x. */
! imode = GET_MODE (x);
!
! if (imode == omode)
return x;
+
+ isize = GET_MODE_SIZE (imode);
}
result = gen_lowpart_common (omode, x);
brgds, H-P