(simplify_plus_minus): Reject "simplifications" that are too complex
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 14 Mar 1993 14:37:43 +0000 (09:37 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 14 Mar 1993 14:37:43 +0000 (09:37 -0500)
in form.

From-SVN: r3733

gcc/cse.c

index 799f31a746a2c844b682ad992506642eef88c1e8..9187d6f938ccf08a33d272430b6d6df4f47b3d09 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4015,7 +4015,17 @@ simplify_plus_minus (code, mode, op0, op1)
                ncode = MINUS;
 
              tem = simplify_binary_operation (ncode, mode, lhs, rhs);
-             if (tem)
+
+             /* If we got a simple object, a SUBREG of a simple
+                object, or a NEG, use it.  Otherwise, we either got nothing
+                or we got something (like a NOT), which can cause an
+                infinite loop.  */
+
+             if (tem != 0
+                 && ((GET_CODE (tem) == SUBREG
+                      && GET_RTX_CLASS (GET_CODE (SUBREG_REG (tem))) == 'o')
+                     || GET_CODE (tem) == NEG
+                     || GET_RTX_CLASS (GET_CODE (tem)) == 'o'))
                {
                  ops[i] = tem, ops[j] = 0;
                  negs[i] = negs[i] && negs[j];