stmt.c (HAVE_casesi): Define it not already defined.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 18 Jan 2004 22:49:23 +0000 (22:49 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 18 Jan 2004 22:49:23 +0000 (22:49 +0000)
* 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

gcc/ChangeLog
gcc/stmt.c

index 566043acea7c4e4bad69d27091c43b2178574d83..c6cfde6aee6908a6abb31a94821f727d5b70c0f3 100644 (file)
@@ -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.
index 6288341a48f55f0ab02576389a317cb57fa9ee3d..22bb49bf04aa20de2f3e8c400333b568bebaa17e 100644 (file)
@@ -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);