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: Patch: Bug in reload.c


Ulrich Weigand wrote

> Oops, sorry, I misread the code.  The change is not preserved either
> (and this in fact also causes problems with our experimental backend).

> So the two cases are both handled the same, but both ignore all changes
> find_reloads_address does to *memrefloc ...

> If this behaviour is indeed the intended one, I still don't understand
> it, however.  If the rest of the actions done by find_reloads_address
> (e.g. push_reload) are kept, why not this?

I change the patch to fix both cases.
The patch is bootstrapped / regtested for i386 and s390x.

+ 2002-02-14  Hartmut Penner  <hpenner@de.ibm.com>
+
+         * reload.c (find_reloads_address_part): Don't apply
+    changes on local variable.
+
Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.176
diff -c -p -r1.176 reload.c
*** reload.c   2002/01/23 01:56:22 1.176
--- reload.c   2002/02/15 07:48:19
*************** find_reloads_address_part (x, loc, class
*** 5678,5687 ****
        && (! LEGITIMATE_CONSTANT_P (x)
       || PREFERRED_RELOAD_CLASS (x, class) == NO_REGS))
      {
!       rtx tem;
!
!       tem = x = force_const_mem (mode, x);
!       find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
                   opnum, type, ind_levels, 0);
      }

--- 5678,5685 ----
        && (! LEGITIMATE_CONSTANT_P (x)
       || PREFERRED_RELOAD_CLASS (x, class) == NO_REGS))
      {
!       x = force_const_mem (mode, x);
!       find_reloads_address (mode, &x, XEXP (x, 0), &XEXP (x, 0),
                   opnum, type, ind_levels, 0);
      }

*************** find_reloads_address_part (x, loc, class
*** 5694,5700 ****

        tem = force_const_mem (GET_MODE (x), XEXP (x, 1));
        x = gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), tem);
!       find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
                   opnum, type, ind_levels, 0);
      }

--- 5692,5698 ----

        tem = force_const_mem (GET_MODE (x), XEXP (x, 1));
        x = gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), tem);
!       find_reloads_address (mode, &XEXP (x, 1), XEXP (tem, 0), &XEXP (tem, 0),
                   opnum, type, ind_levels, 0);
      }







Hartmut Penner



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