From 0fd662ee04b37a665ad95d619a7e47185f079183 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 31 Aug 2005 18:06:45 -0700 Subject: [PATCH] expr.c (expand_expr_real_1): Force subregs into a pseudo before applying gen_lowpart. * expr.c (expand_expr_real_1) : Force subregs into a pseudo before applying gen_lowpart. From-SVN: r103712 --- gcc/ChangeLog | 5 +++++ gcc/expr.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8cf77368a75..f887654193b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-08-31 Richard Henderson + + * expr.c (expand_expr_real_1) : Force subregs + into a pseudo before applying gen_lowpart. + 2005-08-31 Geoffrey Keating * doc/install.texi (Specific): Update cctools version required 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)) -- 2.30.2