]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cse.c (fold_rtx): Remove redundant gen_rtx_CONST.
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 11 Nov 2008 23:24:05 +0000 (23:24 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 11 Nov 2008 23:24:05 +0000 (23:24 +0000)
gcc/
* cse.c (fold_rtx): Remove redundant gen_rtx_CONST.

From-SVN: r141775

gcc/ChangeLog
gcc/cse.c

index 4fee1bbeb2789e1b6635b1fe932b10c44a52d58a..755b33b9a652804a36526f3734e5cd226486e77b 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-11  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * cse.c (fold_rtx): Remove redundant gen_rtx_CONST.
+
 2008-11-11  Richard Sandiford  <rdsandiford@googlemail.com>
 
        PR rtl-optimization/37363
index ed7d885643921b03cb5b30b88f1c92d28fa8ead6..e6ff6308c2a4c1bb68af4ad08080ece77241887f 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3171,33 +3171,15 @@ fold_rtx (rtx x, rtx insn)
     {
     case RTX_UNARY:
       {
-       int is_const = 0;
-
        /* We can't simplify extension ops unless we know the
           original mode.  */
        if ((code == ZERO_EXTEND || code == SIGN_EXTEND)
            && mode_arg0 == VOIDmode)
          break;
 
-       /* If we had a CONST, strip it off and put it back later if we
-          fold.  */
-       if (const_arg0 != 0 && GET_CODE (const_arg0) == CONST)
-         is_const = 1, const_arg0 = XEXP (const_arg0, 0);
-
        new_rtx = simplify_unary_operation (code, mode,
                                        const_arg0 ? const_arg0 : folded_arg0,
                                        mode_arg0);
-       /* NEG of PLUS could be converted into MINUS, but that causes
-          expressions of the form
-          (CONST (MINUS (CONST_INT) (SYMBOL_REF)))
-          which many ports mistakenly treat as LEGITIMATE_CONSTANT_P.
-          FIXME: those ports should be fixed.  */
-       if (new_rtx != 0 && is_const
-           && GET_CODE (new_rtx) == PLUS
-           && (GET_CODE (XEXP (new_rtx, 0)) == SYMBOL_REF
-               || GET_CODE (XEXP (new_rtx, 0)) == LABEL_REF)
-           && GET_CODE (XEXP (new_rtx, 1)) == CONST_INT)
-         new_rtx = gen_rtx_CONST (mode, new_rtx);
       }
       break;