aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-01-18 22:49:23 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-01-18 22:49:23 +0000
commit41cbdcd0a240a38b741290576bfda22bab62a656 (patch)
treee0b753619973c633deb46d2c9b655b8c3fc014c7
parent5cfc5f84fbd2ec29b1ac0cdba44ff468c82f48fe (diff)
downloadgcc-41cbdcd0a240a38b741290576bfda22bab62a656.zip
gcc-41cbdcd0a240a38b741290576bfda22bab62a656.tar.gz
gcc-41cbdcd0a240a38b741290576bfda22bab62a656.tar.bz2
stmt.c (HAVE_casesi): Define it not already defined.
* stmt.c (HAVE_casesi): Define it not already defined. (HAVE_tablejump): Likewise. (expand_end_case_type): Resort to the binary tree method if neither casesi or tablejump is available. From-SVN: r76120
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/stmt.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 566043a..c6cfde6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * stmt.c (HAVE_casesi): Define it not already defined.
+ (HAVE_tablejump): Likewise.
+ (expand_end_case_type): Resort to the binary tree method if
+ neither casesi or tablejump is available.
+
2004-01-18 Daniel Jacobowitz <drow@mvista.com>
* final.c (final_scan_insn): Make non-static again.
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 6288341..22bb49b 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -5342,6 +5342,14 @@ emit_case_bit_tests (tree index_type, tree index_expr, tree minval,
emit_jump (default_label);
}
+#ifndef HAVE_casesi
+#define HAVE_casesi 0
+#endif
+
+#ifndef HAVE_tablejump
+#define HAVE_tablejump 0
+#endif
+
/* Terminate a case (Pascal) or switch (C) statement
in which ORIG_INDEX is the expression to be tested.
If ORIG_TYPE is not NULL, it is the original ORIG_INDEX
@@ -5530,7 +5538,10 @@ expand_end_case_type (tree orig_index, tree orig_type)
#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
|| flag_pic
#endif
- || TREE_CONSTANT (index_expr))
+ || TREE_CONSTANT (index_expr)
+ /* If neither casesi or tablejump is available, we can
+ only go this way. */
+ || (!HAVE_casesi && !HAVE_tablejump))
{
index = expand_expr (index_expr, NULL_RTX, VOIDmode, 0);