re PR target/10700 (ICE in copy_to_mode_reg on 64-bit targets)
authorRoger Sayle <roger@eyesopen.com>
Thu, 3 Jul 2003 13:08:10 +0000 (13:08 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 3 Jul 2003 13:08:10 +0000 (13:08 +0000)
PR target/10700
* fold-const.c (extract_muldiv_1): There's nothing that can be done
if the expression is a SAVE_EXPR.

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

From-SVN: r68877

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20030703-1.c [new file with mode: 0644]

index 61c2e01a3fcc2618996b388205cc5708251792a9..1bd44b8d020e34361937ed40fa3131d910781b4a 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-03  Roger Sayle  <roger@eyesopen.com>
+
+       PR target/10700
+       * fold-const.c (extract_muldiv_1): There's nothing that can be done
+       if the expression is a SAVE_EXPR.
+
 2003-07-03  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/m32r/m32r.c: Fix comment typos.
index 7751cb95a372e42362c64b50795712c2c67ad6c6..c4826c784af919ecfa1fcf3cc393e60e1bf89042 100644 (file)
@@ -4150,25 +4150,6 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type)
                      TREE_OPERAND (t, 1));
       break;
 
-    case SAVE_EXPR:
-      /* If this has not been evaluated and the operand has no side effects,
-        we can see if we can do something inside it and make a new one.
-        Note that this test is overly conservative since we can do this
-        if the only reason it had side effects is that it was another
-        similar SAVE_EXPR, but that isn't worth bothering with.  */
-      if (SAVE_EXPR_RTL (t) == 0 && ! TREE_SIDE_EFFECTS (TREE_OPERAND (t, 0))
-         && 0 != (t1 = extract_muldiv (TREE_OPERAND (t, 0), c, code,
-                                       wide_type)))
-       {
-         t1 = save_expr (t1);
-         if (SAVE_EXPR_PERSISTENT_P (t) && TREE_CODE (t1) == SAVE_EXPR)
-           SAVE_EXPR_PERSISTENT_P (t1) = 1;
-         if (is_pending_size (t))
-           put_pending_size (t1);
-         return t1;
-       }
-      break;
-
     case LSHIFT_EXPR:  case RSHIFT_EXPR:
       /* If the second operand is constant, this is a multiplication
         or floor division, by a power of two, so we can treat it that
index 205ac70d06e6ab63b574989b3d34cc093099691a..70bc1834e9ab8f76f3f0c08aa6596b85e446a3bf 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-03  Roger Sayle  <roger@eyesopen.com>
+
+       PR target/10700
+       * gcc.c-torture/compile/20030703-1.c: New test case.
+
 2003-07-03  Mark Mitchell  <mark@codesourcery.com>
 
        * g++.dg/template/local3.C: Remove extra semicolon.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030703-1.c b/gcc/testsuite/gcc.c-torture/compile/20030703-1.c
new file mode 100644 (file)
index 0000000..4b45f5e
--- /dev/null
@@ -0,0 +1,10 @@
+/* Extracted from PR target/10700.  */
+/* The following code used to cause an ICE on 64-bit targets.  */
+
+int SAD_Block(int *);
+void MBMotionEstimation(int *act_block, int block)
+{
+    SAD_Block(act_block + (  (8 * (block == 1 || block == 3))
+                          + (8 * (block == 2 || block == 3))));
+}
+