OSDN Git Service

* configure.ac (gcc_cv_nm): Don't use an in-tree nm if
[pf3gnuchains/gcc-fork.git] / gcc / stmt.c
index be19216..be3e876 100644 (file)
@@ -567,9 +567,9 @@ decl_overlaps_hard_reg_set_p (tree *declp, int *walk_subtrees ATTRIBUTE_UNUSED,
   tree decl = *declp;
   const HARD_REG_SET *regs = data;
 
-  if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
+  if (TREE_CODE (decl) == VAR_DECL)
     {
-      if (DECL_REGISTER (decl)
+      if (DECL_HARD_REGISTER (decl)
          && REG_P (DECL_RTL (decl))
          && REGNO (DECL_RTL (decl)) < FIRST_PSEUDO_REGISTER)
        {
@@ -585,7 +585,7 @@ decl_overlaps_hard_reg_set_p (tree *declp, int *walk_subtrees ATTRIBUTE_UNUSED,
        }
       walk_subtrees = 0;
     }
-  else if (TYPE_P (decl))
+  else if (TYPE_P (decl) || TREE_CODE (decl) == PARM_DECL)
     walk_subtrees = 0;
   return NULL_TREE;
 }
@@ -2286,7 +2286,7 @@ emit_case_bit_tests (tree index_type, tree index_expr, tree minval,
 #define HAVE_tablejump 0
 #endif
 
-/* Terminate a case (Pascal) or switch (C) statement
+/* Terminate a case (Pascal/Ada) 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
    type as given in the source before any compiler conversions.
@@ -2348,26 +2348,24 @@ expand_case (tree exp)
 
       for (i = TREE_VEC_LENGTH (vec) - 1; --i >= 0; )
        {
+         tree low, high;
          elt = TREE_VEC_ELT (vec, i);
-         gcc_assert (CASE_LOW (elt));
-         case_list = add_case_node (case_list, index_type,
-                                    CASE_LOW (elt), CASE_HIGH (elt),
-                                    CASE_LABEL (elt));
-       }
 
+         low = CASE_LOW (elt);
+         gcc_assert (low);
+         high = CASE_HIGH (elt);
 
-      /* Make sure start points to something that won't need any
-        transformation before the end of this function.  */
-      start = get_last_insn ();
-      if (! NOTE_P (start))
-       {
-         emit_note (NOTE_INSN_DELETED);
-         start = get_last_insn ();
+         /* Discard empty ranges.  */
+         if (high && INT_CST_LT (high, low))
+           continue;
+
+         case_list = add_case_node (case_list, index_type, low, high,
+                                    CASE_LABEL (elt));
        }
 
-      default_label = label_rtx (default_label_decl);
 
-      before_case = get_last_insn ();
+      before_case = start = get_last_insn ();
+      default_label = label_rtx (default_label_decl);
 
       /* Get upper and lower bounds of case values.  */
 
@@ -2936,6 +2934,10 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label,
   enum machine_mode mode = GET_MODE (index);
   enum machine_mode imode = TYPE_MODE (index_type);
 
+  /* Handle indices detected as constant during RTL expansion.  */
+  if (mode == VOIDmode)
+    mode = imode;
+
   /* See if our parents have already tested everything for us.
      If they have, emit an unconditional jump for this node.  */
   if (node_is_bounded (node, index_type))