* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
From-SVN: r43847
This commit is contained in:
parent
d5d6a58b0a
commit
45c8268d06
@ -1,3 +1,7 @@
|
|||||||
|
2001-07-08 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
|
||||||
|
|
||||||
2001-07-08 Richard Henderson <rth@redhat.com>
|
2001-07-08 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* config/i386/i386.md: Remove constraints strings from define_split
|
* config/i386/i386.md: Remove constraints strings from define_split
|
||||||
|
17
gcc/stmt.c
17
gcc/stmt.c
@ -6321,19 +6321,24 @@ emit_case_nodes (index, node, default_label, index_type)
|
|||||||
}
|
}
|
||||||
else if (!low_bound && !high_bound)
|
else if (!low_bound && !high_bound)
|
||||||
{
|
{
|
||||||
/* Instead of doing two branches emit test (index-low) <= (high-low). */
|
/* Instead of doing two branches, emit
|
||||||
|
(index-low) <= (high-low). */
|
||||||
tree new_bound = fold (build (MINUS_EXPR, index_type, node->high,
|
tree new_bound = fold (build (MINUS_EXPR, index_type, node->high,
|
||||||
node->low));
|
node->low));
|
||||||
rtx new_index;
|
rtx new_index;
|
||||||
|
|
||||||
new_index = expand_binop (mode, sub_optab, index,
|
new_index = expand_binop (mode, sub_optab, index,
|
||||||
expand_expr (node->low, NULL_RTX,
|
convert_modes (mode, imode,
|
||||||
VOIDmode, 0),
|
expand_expr (node->low, NULL_RTX,
|
||||||
NULL_RTX, 0, OPTAB_WIDEN);
|
mode, 0),
|
||||||
|
unsignedp),
|
||||||
|
NULL_RTX, unsignedp, OPTAB_WIDEN);
|
||||||
|
|
||||||
emit_cmp_and_jump_insns (new_index,
|
emit_cmp_and_jump_insns (new_index,
|
||||||
expand_expr (new_bound, NULL_RTX,
|
convert_modes (mode, imode,
|
||||||
VOIDmode, 0),
|
expand_expr (new_bound, NULL_RTX,
|
||||||
|
mode, 0),
|
||||||
|
unsignedp),
|
||||||
GT, NULL_RTX, mode, 1, 0,
|
GT, NULL_RTX, mode, 1, 0,
|
||||||
default_label);
|
default_label);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user