This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA:] Fix PR target/18701, address adjustment error withparadoxical mem subregs. (Disallow them, I say!)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]