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)
{
}
walk_subtrees = 0;
}
- else if (TYPE_P (decl))
+ else if (TYPE_P (decl) || TREE_CODE (decl) == PARM_DECL)
walk_subtrees = 0;
return NULL_TREE;
}
#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.
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. */
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))