summaryrefslogtreecommitdiff
path: root/gcc/lower-subreg.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 21:19:13 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 21:19:13 +0000
commit5f961ca4acb3437c013283fb771440022aaae34f (patch)
tree37253ea4aff9510b8b59986473fe750663d476f2 /gcc/lower-subreg.c
parent211276ee4c9ecb2ad1240f2f00eecc307ffa7244 (diff)
downloadgcc-5f961ca4acb3437c013283fb771440022aaae34f.tar.gz
gcc/
* lower-subreg.c (can_decompose_p): Check every word of a hard register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182500 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lower-subreg.c')
-rw-r--r--gcc/lower-subreg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 85aa29891bf..779cc5f40de 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -634,8 +634,15 @@ can_decompose_p (rtx x)
unsigned int regno = REGNO (x);
if (HARD_REGISTER_NUM_P (regno))
- return (validate_subreg (word_mode, GET_MODE (x), x, UNITS_PER_WORD)
- && HARD_REGNO_MODE_OK (regno, word_mode));
+ {
+ unsigned int byte, num_bytes;
+
+ num_bytes = GET_MODE_SIZE (GET_MODE (x));
+ for (byte = 0; byte < num_bytes; byte += UNITS_PER_WORD)
+ if (simplify_subreg_regno (regno, GET_MODE (x), byte, word_mode) < 0)
+ return false;
+ return true;
+ }
else
return !bitmap_bit_p (subreg_context, regno);
}