aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-07-30 06:45:24 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-07-30 06:45:24 -0400
commit5eb94e4e8b3bb7cc7407b646d982ad99a192041a (patch)
treea88e78478bc5d780e136b01370495367a8533974 /gcc/stmt.c
parent790e949032a94bc90fc4fcf79b31c8c14850dcb1 (diff)
downloadgcc-5eb94e4e8b3bb7cc7407b646d982ad99a192041a.zip
gcc-5eb94e4e8b3bb7cc7407b646d982ad99a192041a.tar.gz
gcc-5eb94e4e8b3bb7cc7407b646d982ad99a192041a.tar.bz2
(expand_return): Don't use jumps for "return x == y" if they are
expensive. From-SVN: r5043
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 52beb26..af00b07 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1,5 +1,5 @@
/* Expands front end tree to back end RTL for GNU C-Compiler
- Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -2388,11 +2388,13 @@ expand_return (retval)
because expand_null_return takes care of them, too.
Any reason why not? */
if (HAVE_return && cleanup_label == 0
- && ! current_function_returns_pcc_struct)
+ && ! current_function_returns_pcc_struct
+ && BRANCH_COST <= 1)
{
/* 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. */
+ if we can do it with explicit return insns and
+ branches are cheap. */
if (retval_rhs)
switch (TREE_CODE (retval_rhs))
{