From: Richard Henderson Date: Sun, 8 Jul 2001 16:03:26 +0000 (-0700) Subject: * stmt.c (emit_case_nodes): Convert modes properly in low+high test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45c8268d06270cff703a2caf0d20eea043759bdc;p=gcc.git * stmt.c (emit_case_nodes): Convert modes properly in low+high test. From-SVN: r43847 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8e500841a66..d0929d8fc97 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-07-08 Richard Henderson + + * stmt.c (emit_case_nodes): Convert modes properly in low+high test. + 2001-07-08 Richard Henderson * config/i386/i386.md: Remove constraints strings from define_split diff --git a/gcc/stmt.c b/gcc/stmt.c index ee4523c33c5..48b3a87cc66 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -6321,19 +6321,24 @@ emit_case_nodes (index, node, default_label, index_type) } 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, node->low)); rtx new_index; new_index = expand_binop (mode, sub_optab, index, - expand_expr (node->low, NULL_RTX, - VOIDmode, 0), - NULL_RTX, 0, OPTAB_WIDEN); + convert_modes (mode, imode, + expand_expr (node->low, NULL_RTX, + mode, 0), + unsignedp), + NULL_RTX, unsignedp, OPTAB_WIDEN); emit_cmp_and_jump_insns (new_index, - expand_expr (new_bound, NULL_RTX, - VOIDmode, 0), + convert_modes (mode, imode, + expand_expr (new_bound, NULL_RTX, + mode, 0), + unsignedp), GT, NULL_RTX, mode, 1, 0, default_label); }