]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
- Revert the previous patch:
authorMatthias Klose <doko@debian.org>
Thu, 29 Apr 2004 05:49:12 +0000 (05:49 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Thu, 29 Apr 2004 05:49:12 +0000 (05:49 +0000)
        * expr.c (expand_expr_real) <NOP_EXPR>: 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
gcc/expr.c

index a11ba3c85b09111e543409bcee544c2f45b4fdb9..8a88e3e858ac998d291b716863c4821c78c2db84 100644 (file)
@@ -5,9 +5,9 @@
        2004-03-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/14235
-       * expr.c (expand_expr_real) <NOP_EXPR>: 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  <jakub@redhat.com>
 
index 1a162a95a609755e80fd5358e909ea64838d6f0a..3193271dbef76369cab540fc3c5e880da16b716b 100644 (file)
@@ -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: