summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-22 14:29:28 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-22 14:29:28 +0000
commit7aee3c57c1829894884f0232772dab762012f116 (patch)
treee276a9a3f88aafec442b7f818b014c0df9cf4b90 /gcc/rtlanal.c
parentd91f677533374080a77615e1628d15a0316d495b (diff)
downloadgcc-7aee3c57c1829894884f0232772dab762012f116.tar.gz
* rtlanal.c (subreg_regno_offset): Return correct offset for
big endian paradoxical subregs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55650 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index de7efae2d5f..c1fdb7604ae 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3117,6 +3117,16 @@ subreg_regno_offset (xregno, xmode, offset, ymode)
nregs_xmode = HARD_REGNO_NREGS (xregno, xmode);
nregs_ymode = HARD_REGNO_NREGS (xregno, ymode);
+
+ /* If this is a big endian paradoxical subreg, which uses more actual
+ hard registers than the original register, we must return a negative
+ offset so that we find the proper highpart of the register. */
+ if (offset == 0
+ && nregs_ymode > nregs_xmode
+ && (GET_MODE_SIZE (ymode) > UNITS_PER_WORD
+ ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
+ return nregs_xmode - nregs_ymode;
+
if (offset == 0 || nregs_xmode == nregs_ymode)
return 0;