* recog.c (validate_replace_rtx_1): Only perform substitutions
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Jan 1998 21:00:42 +0000 (21:00 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Jan 1998 21:00:42 +0000 (21:00 +0000)
        of arguments to commutative and comparison operators once.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17482 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/recog.c

index 4a5d987..d0f76d2 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 a2d2489..ef8d762 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);
+        }
     }
 }