aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-05-31 10:57:19 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-05-31 10:57:19 +0000
commitecc9dd932a3a296e3fccee2a61af4ec57ba8bbee (patch)
treee202fea906f4cfcb781d70df01056893ebd3f9bf /gcc
parentce7715bdb84179a6e5be019be8df7846674f80f7 (diff)
downloadgcc-ecc9dd932a3a296e3fccee2a61af4ec57ba8bbee.zip
gcc-ecc9dd932a3a296e3fccee2a61af4ec57ba8bbee.tar.gz
gcc-ecc9dd932a3a296e3fccee2a61af4ec57ba8bbee.tar.bz2
stmt (expand_end_case): Reorder conversion sequence for jump table to avoid extra truncations.
* stmt (expand_end_case): Reorder conversion sequence for jump table to avoid extra truncations. From-SVN: r34291
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/stmt.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35680e7..47df6aa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * stmt (expand_end_case): Reorder conversion sequence for jump
+ table to avoid extra truncations.
+
Wed May 31 01:31:42 2000 Jeffrey A Law (law@cygnus.com)
* ifcvt.c (cond_exec_process_if_block): Do nothing if the last insn
diff --git a/gcc/stmt.c b/gcc/stmt.c
index a1beb46..3d26748 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -5579,10 +5579,10 @@ expand_end_case (orig_index)
#ifdef HAVE_tablejump
if (! win && HAVE_tablejump)
{
- index_expr = convert (thiscase->data.case_stmt.nominal_type,
- fold (build (MINUS_EXPR, index_type,
- index_expr, minval)));
- index_type = TREE_TYPE (index_expr);
+ index_type = thiscase->data.case_stmt.nominal_type;
+ index_expr = fold (build (MINUS_EXPR, index_type,
+ convert (index_type, index_expr),
+ convert (index_type, minval)));
index = expand_expr (index_expr, NULL_RTX, VOIDmode, 0);
emit_queue ();
index = protect_from_queue (index, 0);