aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/tree-cfg.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 2bae2ee..2964209 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4809,17 +4809,7 @@ verify_gimple_switch (gswitch *stmt)
return true;
}
- if (elt_type)
- {
- if (TREE_TYPE (CASE_LOW (elt)) != elt_type
- || (CASE_HIGH (elt) && TREE_TYPE (CASE_HIGH (elt)) != elt_type))
- {
- error ("type mismatch for case label in switch statement");
- debug_generic_expr (elt);
- return true;
- }
- }
- else
+ if (! elt_type)
{
elt_type = TREE_TYPE (CASE_LOW (elt));
if (TYPE_PRECISION (index_type) < TYPE_PRECISION (elt_type))
@@ -4828,6 +4818,13 @@ verify_gimple_switch (gswitch *stmt)
return true;
}
}
+ if (TREE_TYPE (CASE_LOW (elt)) != elt_type
+ || (CASE_HIGH (elt) && TREE_TYPE (CASE_HIGH (elt)) != elt_type))
+ {
+ error ("type mismatch for case label in switch statement");
+ debug_generic_expr (elt);
+ return true;
+ }
if (prev_upper_bound)
{