summaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authortege <tege@138bc75d-0d04-0410-961f-82ee72b054a4>1996-08-14 23:46:53 +0000
committertege <tege@138bc75d-0d04-0410-961f-82ee72b054a4>1996-08-14 23:46:53 +0000
commit984c9abdf96eb065cbb434b608f190a910a7cd21 (patch)
tree15de8732d22332b6f4cd644eccab9d9afc2b7832 /gcc/stmt.c
parentac5850cf01205bb2695988dc3d76f7db18fe14a3 (diff)
downloadgcc-984c9abdf96eb065cbb434b608f190a910a7cd21.tar.gz
(expand_return): In code for doing scc with jumps,
stick to default handling if we have corresponding scc pattern. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 080b1e4466e..5ebadb5f21c 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2734,29 +2734,51 @@ expand_return (retval)
{
/* If this is return x == y; then generate
if (x == y) return 1; else return 0;
- if we can do it with explicit return insns and
- branches are cheap. */
+ if we can do it with explicit return insns and branches are cheap,
+ but not if we have the corresponding scc insn. */
+ int has_scc = 0;
if (retval_rhs)
switch (TREE_CODE (retval_rhs))
{
case EQ_EXPR:
+#ifdef HAVE_seq
+ has_scc = HAVE_seq;
+#endif
case NE_EXPR:
+#ifdef HAVE_sne
+ has_scc = HAVE_sne;
+#endif
case GT_EXPR:
+#ifdef HAVE_sgt
+ has_scc = HAVE_sgt;
+#endif
case GE_EXPR:
+#ifdef HAVE_sge
+ has_scc = HAVE_sge;
+#endif
case LT_EXPR:
+#ifdef HAVE_slt
+ has_scc = HAVE_slt;
+#endif
case LE_EXPR:
+#ifdef HAVE_sle
+ has_scc = HAVE_sle;
+#endif
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case TRUTH_AND_EXPR:
case TRUTH_OR_EXPR:
case TRUTH_NOT_EXPR:
case TRUTH_XOR_EXPR:
- op0 = gen_label_rtx ();
- jumpifnot (retval_rhs, op0);
- expand_value_return (const1_rtx);
- emit_label (op0);
- expand_value_return (const0_rtx);
- return;
+ if (! has_scc)
+ {
+ op0 = gen_label_rtx ();
+ jumpifnot (retval_rhs, op0);
+ expand_value_return (const1_rtx);
+ emit_label (op0);
+ expand_value_return (const0_rtx);
+ return;
+ }
}
}
#endif /* HAVE_return */