]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/14235 (ICE in verify_local_live_at start (flow.c...
authorMatthias Klose <doko@debian.org>
Thu, 29 Apr 2004 04:54:39 +0000 (04:54 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Thu, 29 Apr 2004 04:54:39 +0000 (04:54 +0000)
2004-04-29  Matthias Klose  <doko@debian.org>

        Backport:

        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.

2004-04-29  Matthias Klose  <doko@debian.org>

        Backport:

        2004-03-04  Eric Botcazou  <ebotcazou@libertysurf.fr>

        * gcc.c-torture/compile/20040304-1.c: New test.

From-SVN: r81274

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog

index fec6686fab6e118e909f8e460cd81eee12afe524..a11ba3c85b09111e543409bcee544c2f45b4fdb9 100644 (file)
@@ -1,3 +1,14 @@
+2004-04-29  Matthias Klose  <doko@debian.org>
+
+       Backport:
+
+       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.
+
 2004-04-29  Jakub Jelinek  <jakub@redhat.com>
 
        * config/sparc/sparc.h (FLOATDITF2_LIBCALL, FIX_TRUNCTFDI2_LIBCALL,
index c7b14da283c923203bb5a255abcfcc4bbe974238..1a162a95a609755e80fd5358e909ea64838d6f0a 100644 (file)
@@ -7909,9 +7909,18 @@ expand_expr (exp, target, tmode, modifier)
        return
          convert_to_mode (mode, op0,
                           TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
-      else
-       convert_move (target, 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))));
       return target;
 
     case VIEW_CONVERT_EXPR:
index 4120627d6103a9037adb3c590fbbaea0d27c67a5..a3812b3314d51d24bfe97c7a076679117aa5c0c3 100644 (file)
@@ -1,3 +1,11 @@
+2004-04-29  Matthias Klose  <doko@debian.org>
+
+       Backport:
+
+       2004-03-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.c-torture/compile/20040304-1.c: New test.
+
 2004-04-20  Paul Brook  <paul@codesourcery.com>
 
        PR 2123