if (case_low && case_high)
{
/* Case label is less than minimum for type. */
- if ((tree_int_cst_compare (case_low, min_value) < 0)
- && (tree_int_cst_compare (case_high, min_value) < 0))
+ if (TREE_CODE (min_value) == INTEGER_CST
+ && tree_int_cst_compare (case_low, min_value) < 0
+ && tree_int_cst_compare (case_high, min_value) < 0)
{
warning ("case label value %d is less than minimum value for type",
TREE_INT_CST (case_low));
}
/* Case value is greater than maximum for type. */
- if ((tree_int_cst_compare (case_low, max_value) > 0)
- && (tree_int_cst_compare (case_high, max_value) > 0))
+ if (TREE_CODE (max_value) == INTEGER_CST
+ && tree_int_cst_compare (case_low, max_value) > 0
+ && tree_int_cst_compare (case_high, max_value) > 0)
{
warning ("case label value %d exceeds maximum value for type",
TREE_INT_CST (case_high));
}
/* Saturate lower case label value to minimum. */
- if ((tree_int_cst_compare (case_high, min_value) >= 0)
- && (tree_int_cst_compare (case_low, min_value) < 0))
+ if (TREE_CODE (min_value) == INTEGER_CST
+ && tree_int_cst_compare (case_high, min_value) >= 0
+ && tree_int_cst_compare (case_low, min_value) < 0)
{
warning ("lower value %d in case label range less than minimum value for type",
TREE_INT_CST (case_low));
}
/* Saturate upper case label value to maximum. */
- if ((tree_int_cst_compare (case_low, max_value) <= 0)
- && (tree_int_cst_compare (case_high, max_value) > 0))
+ if (TREE_CODE (max_value) == INTEGER_CST
+ && tree_int_cst_compare (case_low, max_value) <= 0
+ && tree_int_cst_compare (case_high, max_value) > 0)
{
warning ("upper value %d in case label range exceeds maximum value for type",
TREE_INT_CST (case_high));