This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cond-optab] Un-teach combine about (set (cc0) EXPR)
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Mar 2009 15:17:16 +0100
- Subject: [cond-optab] Un-teach combine about (set (cc0) EXPR)
Combine has special code to unwrap expressions from (compare EXPR
(const_int 0)) on CC0 machines.
Since tst optabs are gone on the branch, there is no reason to keep
these (by the way, H-P told me offlist that he would like to see this
too). The patterns to be modified in the machine descriptions are just
a few, and it makes it easier to achieve zero assembly language
differences on CC0 machines. It also removes one CC0 bogosity.
Paolo
2008-03-24 Paolo Bonzini <bonzini@gnu.org>
* combine.c (combine_simplify_rtx): Do not special case
comparing against zero for cc0 machines.
Index: gcc/combine.c
===================================================================
--- gcc/combine.c (branch cond-optab)
+++ gcc/combine.c (working copy)
@@ -4889,24 +4889,6 @@ combine_simplify_rtx (rtx x, enum machin
return gen_lowpart (mode, XEXP (x, 0));
break;
-#ifdef HAVE_cc0
- case COMPARE:
- /* Convert (compare FOO (const_int 0)) to FOO unless we aren't
- using cc0, in which case we want to leave it as a COMPARE
- so we can distinguish it from a register-register-copy. */
- if (XEXP (x, 1) == const0_rtx)
- return XEXP (x, 0);
-
- /* x - 0 is the same as x unless x's mode has signed zeros and
- allows rounding towards -infinity. Under those conditions,
- 0 - 0 is -0. */
- if (!(HONOR_SIGNED_ZEROS (GET_MODE (XEXP (x, 0)))
- && HONOR_SIGN_DEPENDENT_ROUNDING (GET_MODE (XEXP (x, 0))))
- && XEXP (x, 1) == CONST0_RTX (GET_MODE (XEXP (x, 0))))
- return XEXP (x, 0);
- break;
-#endif
-
case CONST:
/* (const (const X)) can become (const X). Do it this way rather than
returning the inner CONST since CONST can be shared with a
@@ -5741,17 +5723,6 @@ simplify_set (rtx x)
if (other_changed)
undobuf.other_insn = other_insn;
-#ifdef HAVE_cc0
- /* If we are now comparing against zero, change our source if
- needed. If we do not use cc0, we always have a COMPARE. */
- if (op1 == const0_rtx && dest == cc0_rtx)
- {
- SUBST (SET_SRC (x), op0);
- src = op0;
- }
- else
-#endif
-
/* Otherwise, if we didn't previously have a COMPARE in the
correct mode, we need one. */
if (GET_CODE (src) != COMPARE || GET_MODE (src) != compare_mode)