aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 761ebff..572d24f 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4931,21 +4931,6 @@ fold_rtx (x, insn)
switch (code)
{
case CONST:
- /* If the operand is a CONSTANT_P_RTX, see if what's inside it
- is known to be constant and replace the whole thing with a
- CONST_INT of either zero or one. Note that this code assumes
- that an insn that recognizes a CONST will also recognize a
- CONST_INT, but that seems to be a safe assumption. */
- if (GET_CODE (XEXP (x, 0)) == CONSTANT_P_RTX)
- {
- x = equiv_constant (fold_rtx (XEXP (XEXP (x, 0), 0), 0));
- return (x != 0 && (GET_CODE (x) == CONST_INT
- || GET_CODE (x) == CONST_DOUBLE)
- ? const1_rtx : const0_rtx);
- }
-
- /* ... fall through ... */
-
case CONST_INT:
case CONST_DOUBLE:
case SYMBOL_REF:
@@ -5865,6 +5850,12 @@ fold_rtx (x, insn)
const_arg1 ? const_arg1 : folded_arg1,
const_arg2 ? const_arg2 : XEXP (x, 2));
break;
+
+ case 'x':
+ /* Always eliminate CONSTANT_P_RTX at this stage. */
+ if (code == CONSTANT_P_RTX)
+ return (const_arg0 ? const1_rtx : const0_rtx);
+ break;
}
return new ? new : x;
@@ -6864,12 +6855,6 @@ cse_insn (insn, libcall_insn)
if (src == src_folded)
src_folded = 0;
- /* Folds of constant_p_rtx are to be preferred, since we do
- not wish any to live past CSE. */
- if (src && GET_CODE (src) == CONST
- && GET_CODE (XEXP (src, 0)) == CONSTANT_P_RTX)
- src = 0;
-
/* At this point, ELT, if non-zero, points to a class of expressions
equivalent to the source of this SET and SRC, SRC_EQV, SRC_FOLDED,
and SRC_RELATED, if non-zero, each contain additional equivalent