* cse.c (fold_rtx): Call equiv_constant only when necessary.
authorKazu Hirata <kazu@cs.umass.edu>
Wed, 26 Jan 2005 12:44:58 +0000 (12:44 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Wed, 26 Jan 2005 12:44:58 +0000 (12:44 +0000)
From-SVN: r94260

gcc/ChangeLog
gcc/cse.c

index a418bfc6ac551d9bc9a9cee2dc7cd6f45091766f..202edce6dc1d8264fee85c2b4580230389a8a461 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-26  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * cse.c (fold_rtx): Call equiv_constant only when necessary.
+
 2005-01-26  Bernd Schmidt  <bernd.schmidt@analog.com>
 
        * function.c (expand_function_end): If current_function_calls_alloca,
index 98854c9ba92fb708cfc132a9c6c74c8930eadd71..febf243f9326832b9e7dff941a1a94012cf45f14 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3877,8 +3877,6 @@ fold_rtx (rtx x, rtx insn)
 
          code = find_comparison_args (code, &folded_arg0, &folded_arg1,
                                       &mode_arg0, &mode_arg1);
-         const_arg0 = equiv_constant (folded_arg0);
-         const_arg1 = equiv_constant (folded_arg1);
 
          /* If the mode is VOIDmode or a MODE_CC mode, we don't know
             what kinds of things are being compared, so we can't do
@@ -3887,6 +3885,9 @@ fold_rtx (rtx x, rtx insn)
          if (mode_arg0 == VOIDmode || GET_MODE_CLASS (mode_arg0) == MODE_CC)
            break;
 
+         const_arg0 = equiv_constant (folded_arg0);
+         const_arg1 = equiv_constant (folded_arg1);
+
          /* If we do not now have two constants being compared, see
             if we can nevertheless deduce some things about the
             comparison.  */