aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-07-08 09:03:26 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-07-08 09:03:26 -0700
commit45c8268d06270cff703a2caf0d20eea043759bdc (patch)
treea3407a54f630a52b85d9b16712fe41738a08ee49 /gcc
parentd5d6a58b0a44b5f08fb3ccfc73719fddbb2509b6 (diff)
downloadgcc-45c8268d06270cff703a2caf0d20eea043759bdc.zip
gcc-45c8268d06270cff703a2caf0d20eea043759bdc.tar.gz
gcc-45c8268d06270cff703a2caf0d20eea043759bdc.tar.bz2
* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
From-SVN: r43847
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/stmt.c17
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8e50084..d0929d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
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>
+
* config/i386/i386.md: Remove constraints strings from define_split
and define_peephole2 patterns.
(eh_return_si, eh_return_di): Split eh_return_1 for modes.
diff --git a/gcc/stmt.c b/gcc/stmt.c
index ee4523c..48b3a87 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);
}