From f40e678a2c9867935dd502ac7bb4d9fd9177155a Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Thu, 29 Apr 2004 05:49:12 +0000 Subject: [PATCH] - Revert the previous patch: * expr.c (expand_expr_real) : Return a new pseudo when converting from a sub-word source to a larger-than-word register which conflicts with the source. - Checkin the updated patch: * expr.c (convert_move): Copy the source to a new pseudo when converting from a sub-word source to a larger-than-word register which conflicts with the source. From-SVN: r81275 --- gcc/ChangeLog | 6 +++--- gcc/expr.c | 21 ++++++++------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a11ba3c85b09..8a88e3e858ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,9 +5,9 @@ 2004-03-04 Eric Botcazou PR optimization/14235 - * expr.c (expand_expr_real) : Return a new - pseudo when converting from a sub-word source to a - larger-than-word register which conflicts with the source. + * expr.c (convert_move): Copy the source to a new pseudo + when converting from a sub-word source to a larger-than-word + register which conflicts with the source. 2004-04-29 Jakub Jelinek diff --git a/gcc/expr.c b/gcc/expr.c index 1a162a95a609..3193271dbef7 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -915,7 +915,11 @@ convert_move (to, from, unsignedp) != CODE_FOR_nothing)) { if (GET_CODE (to) == REG) - emit_insn (gen_rtx_CLOBBER (VOIDmode, to)); + { + if (reg_overlap_mentioned_p (to, from)) + from = force_reg (from_mode, from); + emit_insn (gen_rtx_CLOBBER (VOIDmode, to)); + } convert_move (gen_lowpart (word_mode, to), from, unsignedp); emit_unop_insn (code, to, gen_lowpart (word_mode, to), equiv_code); @@ -7909,18 +7913,9 @@ expand_expr (exp, target, tmode, modifier) return convert_to_mode (mode, op0, TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); - - /* Check if convert_move may do the conversion by using a low-part, - after clobbering the whole target which is known to conflict with - the source. In this case, play safe and make a new pseudo. */ - if (GET_CODE (target) == REG - && GET_MODE_BITSIZE (GET_MODE (op0)) < BITS_PER_WORD - && GET_MODE_BITSIZE (mode) > BITS_PER_WORD - && ! safe_from_p (target, TREE_OPERAND (exp, 0), 1)) - target = gen_reg_rtx (mode); - - convert_move (target, op0, - TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); + else + convert_move (target, op0, + TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); return target; case VIEW_CONVERT_EXPR: -- 2.47.2