recog.c (validate_replace_rtx_1): Only perform substitutions of arguments to commutat...
authorAlasdair Baird <alasdair@wildcat.demon.co.uk>
Sun, 25 Jan 1998 21:00:42 +0000 (21:00 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 25 Jan 1998 21:00:42 +0000 (14:00 -0700)
        * recog.c (validate_replace_rtx_1): Only perform substitutions
        of arguments to commutative and comparison operators once.

From-SVN: r17482

gcc/ChangeLog
gcc/recog.c

index 4a5d98765f7256ba387860032423bdd67802ac70..d0f76d280b1a64ab72016617b77840b36b134a71 100644 (file)
@@ -1,3 +1,8 @@
+Sun Jan 25 22:00:25 1998  Alasdair Baird <alasdair@wildcat.demon.co.uk>
+
+       * recog.c (validate_replace_rtx_1): Only perform substitutions
+       of arguments to commutative and comparison operators once.
+
 Sun Jan 25 12:30:18 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * sparc.c (output_cbranch): Add default case in
index a2d2489357a8b8d33a16a3c77a33a53dde568a55..ef8d7626e3f716e2448ac6572e2dcf6fe0c2dc32 100644 (file)
@@ -510,14 +510,19 @@ validate_replace_rtx_1 (loc, from, to, object)
       break;
     }
       
-  fmt = GET_RTX_FORMAT (code);
-  for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+  /* For commutative or comparison operations we've already performed
+     replacements.  Don't try to perform them again.  */
+  if (GET_RTX_CLASS (code) != '<' && GET_RTX_CLASS (code) != 'c')
     {
-      if (fmt[i] == 'e')
-       validate_replace_rtx_1 (&XEXP (x, i), from, to, object);
-      else if (fmt[i] == 'E')
-       for (j = XVECLEN (x, i) - 1; j >= 0; j--)
-         validate_replace_rtx_1 (&XVECEXP (x, i, j), from, to, object);
+      fmt = GET_RTX_FORMAT (code);
+      for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+        {
+          if (fmt[i] == 'e')
+            validate_replace_rtx_1 (&XEXP (x, i), from, to, object);
+          else if (fmt[i] == 'E')
+            for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+              validate_replace_rtx_1 (&XVECEXP (x, i, j), from, to, object);
+        }
     }
 }