expr.c (expand_expr_real_1, [...]): Don't check against bounds if bounds aren't constant.

* expr.c (expand_expr_real_1, case SWITCH_EXPR): Don't check against
	bounds if bounds aren't constant.

From-SVN: r84117
This commit is contained in:
Richard Kenner 2004-07-05 15:09:06 +00:00 committed by Richard Kenner
parent 6f70e46e0d
commit ebd5a2087c
2 changed files with 15 additions and 8 deletions

View File

@ -5,6 +5,9 @@
2004-07-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (expand_expr_real_1, case SWITCH_EXPR): Don't check against
bounds if bounds aren't constant.
* tree-cfg.c (verify_expr): Use CHECK_OP in binary case.
* function.c, langhooks-def.h, langhooks.h: Move max_size hook

View File

@ -9221,8 +9221,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
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));
@ -9230,8 +9231,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
/* 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));
@ -9239,8 +9241,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
/* 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));
@ -9248,8 +9251,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
/* 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));