reload1.c (reload): Unshare all rtl after reload is done.
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 6 Mar 2002 23:07:08 +0000 (23:07 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Wed, 6 Mar 2002 23:07:08 +0000 (23:07 +0000)
        * reload1.c (reload): Unshare all rtl after reload is done.

* simplify-rtx.c (simplify_plus_minus): Do not abort,
but simply fail if the expression is too complex to simplify.
(simplify_gen_binary): Handle simplify_plus_minus failures.

From-SVN: r50380

gcc/ChangeLog
gcc/reload1.c
gcc/simplify-rtx.c

index 64cf53def75ef8eda0704edc12f0f7691ac01db7..583e83a1ab32e6984f995039c868e2b5290f9a39 100644 (file)
@@ -1,3 +1,11 @@
+2002-03-06  Ulrich Weigand  <uweigand@de.ibm.com>
+
+        * reload1.c (reload): Unshare all rtl after reload is done.
+
+       * simplify-rtx.c (simplify_plus_minus): Do not abort, 
+       but simply fail if the expression is too complex to simplify.
+       (simplify_gen_binary): Handle simplify_plus_minus failures.
+
 Wed Mar  6 20:32:09 CET 2002  Jan Hubicka  <jh@suse.cz>
 
        * toplev.c (rest_of_compilation): Do jump threading before SSA path;
index 7b420a1ea3d5282b0974c62f59da451a5202dba4..a4a9c0cfa91c8c4d26b2a3ed498f66a30a53f365 100644 (file)
@@ -1278,6 +1278,11 @@ reload (first, global)
   unused_insn_chains = 0;
   fixup_abnormal_edges ();
 
+  /* Replacing pseudos with their memory equivalents might have
+     created shared rtx.  Subsequent passes would get confused
+     by this, so unshare everything here.  */
+  unshare_all_rtl_again (first);
+
   return failure;
 }
 
index 5596e0c1e0a29e40c869a85ef4ae5c644d7a9679..b50a3392f7b19470b91e73c59631b911b4db4571 100644 (file)
@@ -143,9 +143,13 @@ simplify_gen_binary (code, mode, op0, op1)
      the operation.  */
 
   if (code == PLUS || code == MINUS)
-    return simplify_plus_minus (code, mode, op0, op1, 1);
-  else
-    return gen_rtx_fmt_ee (code, mode, op0, op1);
+    {
+      tem = simplify_plus_minus (code, mode, op0, op1, 1);
+      if (tem)
+       return tem;
+    }
+
+  return gen_rtx_fmt_ee (code, mode, op0, op1);
 }
 \f
 /* If X is a MEM referencing the constant pool, return the real value.
@@ -1649,7 +1653,9 @@ simplify_binary_operation (code, mode, op0, op1)
    we rebuild the operation. 
 
    If FORCE is true, then always generate the rtx.  This is used to 
-   canonicalize stuff emitted from simplify_gen_binary.  */
+   canonicalize stuff emitted from simplify_gen_binary.  Note that this
+   can still fail if the rtx is too complex.  It won't fail just because
+   the result is not 'simpler' than the input, however.  */
 
 struct simplify_plus_minus_op_data
 {
@@ -1708,11 +1714,7 @@ simplify_plus_minus (code, mode, op0, op1, force)
            case PLUS:
            case MINUS:
              if (n_ops == 7)
-               {
-                 if (force)
-                   abort ();
-                 return NULL_RTX;
-               }
+               return NULL_RTX;
 
              ops[n_ops].op = XEXP (this_op, 1);
              ops[n_ops].neg = (this_code == MINUS) ^ this_neg;