From: Ulrich Weigand Date: Mon, 6 Oct 2003 15:56:07 +0000 (+0000) Subject: reload.c (find_reloads_subreg_address): Use correct offset for paradoxical MEM subreg... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6357135a0e6e8d95d05b370f15e6daff39d7dfee;p=gcc.git reload.c (find_reloads_subreg_address): Use correct offset for paradoxical MEM subregs on big-endian targets. * reload.c (find_reloads_subreg_address): Use correct offset for paradoxical MEM subregs on big-endian targets. From-SVN: r72153 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d36ae3aa8fa..b39d79c1b04 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-10-06 Ulrich Weigand + + * reload.c (find_reloads_subreg_address): Use correct offset for + paradoxical MEM subregs on big-endian targets. + 2003-10-06 Andrew Haley * tree.c (get_callee_fndecl): Call diff --git a/gcc/reload.c b/gcc/reload.c index dc088730e67..59852ba2b5e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -5806,9 +5806,16 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum, if (force_replace || ! rtx_equal_p (tem, reg_equiv_mem[regno])) { - int offset = SUBREG_BYTE (x); unsigned outer_size = GET_MODE_SIZE (GET_MODE (x)); unsigned inner_size = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))); + int offset; + + /* For big-endian paradoxical subregs, SUBREG_BYTE does not + hold the correct (negative) byte offset. */ + if (BYTES_BIG_ENDIAN && outer_size > inner_size) + offset = inner_size - outer_size; + else + offset = SUBREG_BYTE (x); XEXP (tem, 0) = plus_constant (XEXP (tem, 0), offset); PUT_MODE (tem, GET_MODE (x));