stmt (expand_end_case): Reorder conversion sequence for jump table to avoid extra...
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 31 May 2000 10:57:19 +0000 (10:57 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 31 May 2000 10:57:19 +0000 (10:57 +0000)
* stmt (expand_end_case): Reorder conversion sequence for jump
table to avoid extra truncations.

From-SVN: r34291

gcc/ChangeLog
gcc/stmt.c

index 35680e7ffa36e62a7b09a68edd830bea699dcbba..47df6aa8c0301ec5d568d2d4d7df16dc46d3fd52 100644 (file)
@@ -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
index a1beb46ca9a9421bb42634a3631fe9f7ad3026ae..3d26748029ba504865fa29250cd19a5a6be393e9 100644 (file)
@@ -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);