summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-10 21:59:10 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-10 21:59:10 +0000
commitc037cba785c0ebb425f593565b282586907adbb8 (patch)
tree6073238d34f30c575b259990987114e8a5c396af /gcc/expr.c
parent28e776fd5e53c7e86dfa9219c91a328b3557f23b (diff)
downloadgcc-c037cba785c0ebb425f593565b282586907adbb8.tar.gz
* expr.c (emit_group_load): extract_bit_field requires a REG or
MEM as an argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 7edfea63c09..cdabeddece7 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1959,18 +1959,6 @@ emit_group_load (dst, orig_src, ssize, align)
tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
- /* If we won't be loading directly from memory, protect the real source
- from strange tricks we might play. */
- src = orig_src;
- if (GET_CODE (src) != MEM && ! CONSTANT_P (src))
- {
- if (GET_MODE (src) == VOIDmode)
- src = gen_reg_rtx (GET_MODE (dst));
- else
- src = gen_reg_rtx (GET_MODE (orig_src));
- emit_move_insn (src, orig_src);
- }
-
/* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++)
{
@@ -1988,6 +1976,22 @@ emit_group_load (dst, orig_src, ssize, align)
abort ();
}
+ /* If we won't be loading directly from memory, protect the real source
+ from strange tricks we might play; but make sure that the source can
+ be loaded directly into the destination. */
+ src = orig_src;
+ if (GET_CODE (orig_src) != MEM
+ && (!CONSTANT_P (orig_src)
+ || (GET_MODE (orig_src) != mode
+ && GET_MODE (orig_src) != VOIDmode)))
+ {
+ if (GET_MODE (orig_src) == VOIDmode)
+ src = gen_reg_rtx (mode);
+ else
+ src = gen_reg_rtx (GET_MODE (orig_src));
+ emit_move_insn (src, orig_src);
+ }
+
/* Optimize the access just a bit. */
if (GET_CODE (src) == MEM
&& align >= GET_MODE_ALIGNMENT (mode)
@@ -2011,8 +2015,7 @@ emit_group_load (dst, orig_src, ssize, align)
else
abort ();
}
- else if ((CONSTANT_P (src)
- && (GET_MODE (src) == VOIDmode || GET_MODE (src) == mode))
+ else if (CONSTANT_P (src)
|| (GET_CODE (src) == REG && GET_MODE (src) == mode))
tmps[i] = src;
else