2004-06-06 Steven Bosscher <stevenb@suse.de>
+ * tree-cfg.c (tree_verify_flow_info): Make sure that labels in
+ SWITCH_LABELS are always sorted.
+
+2004-06-06 Steven Bosscher <stevenb@suse.de>
+
* hooks.c (hook_int_void_1): New generic hook.
* hooks.h (hook_int_void_1): Add prototype.
* config/c4x/c4x.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE):
case SWITCH_EXPR:
{
+ tree prev;
edge e;
size_t i, n;
tree vec;
label_bb->aux = (void *)1;
}
+ /* Verify that the case labels are sorted. */
+ prev = TREE_VEC_ELT (vec, 0);
+ for (i = 1; i < n - 1; ++i)
+ {
+ tree c = TREE_VEC_ELT (vec, i);
+ if (! CASE_LOW (c))
+ {
+ error ("Found default case not at end of case vector");
+ err = 1;
+ continue;
+ }
+ if (! tree_int_cst_lt (CASE_LOW (prev), CASE_LOW (c)))
+ {
+ error ("Case labels not sorted:\n ");
+ print_generic_expr (stderr, prev, 0);
+ fprintf (stderr," is greater than ");
+ print_generic_expr (stderr, c, 0);
+ fprintf (stderr," but comes before it.\n");
+ err = 1;
+ }
+ prev = c;
+ }
+ if (CASE_LOW (TREE_VEC_ELT (vec, n - 1)))
+ {
+ error ("No default case found at end of case vector");
+ err = 1;
+ }
+
for (e = bb->succ; e; e = e->succ_next)
{
if (!e->dest->aux)