aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-09-01 01:06:45 +0000
committerRichard Henderson <rth@redhat.com>2005-09-01 01:06:45 +0000
commit8e067bd8edf7ffec9ef477afe4abc5fc1be7acdc (patch)
tree5a966fde14dee2a816ab071f4c98ff3e3247bf68 /gcc/expr.c
parentcec94e50f73e72245fc19bbb4af179aa7f1c2ff5 (diff)
* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Force subregs
into a pseudo before applying gen_lowpart. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@103712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index e44a54f9729..e5f5c3d05c1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7544,7 +7544,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
&& GET_MODE_SIZE (TYPE_MODE (type))
== GET_MODE_SIZE (GET_MODE (op0)))
- op0 = gen_lowpart (TYPE_MODE (type), op0);
+ {
+ if (GET_CODE (op0) == SUBREG)
+ op0 = force_reg (GET_MODE (op0), op0);
+ op0 = gen_lowpart (TYPE_MODE (type), op0);
+ }
/* If both modes are integral, then we can convert from one to the
other. */
else if (SCALAR_INT_MODE_P (GET_MODE (op0))