lcm.c (optimize_mode_switching): Emit mode_set before the JUMP_INSN of an abnormal...
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 7 Feb 2001 17:39:47 +0000 (17:39 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 7 Feb 2001 17:39:47 +0000 (17:39 +0000)
* lcm.c (optimize_mode_switching): Emit mode_set before the
JUMP_INSN of an abnormal edge.

From-SVN: r39518

gcc/ChangeLog
gcc/lcm.c

index a5aaf89ac159305897f75ebc20cbe31a3ee65810..bbfc2fe9b306e94291f11555c9b0360ff557959a 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-07  Alexandre Oliva  <aoliva@redhat.com>
+
+       * lcm.c (optimize_mode_switching): Emit mode_set before the
+       JUMP_INSN of an abnormal edge.
+
 2001-02-07  Bernd Schmidt  <bernds@redhat.com>
 
        * builtins.c (expand_builtin_setjmp_receiver): Emit an ASM_INPUT as
index ff442749605ddb1af55e731d941720f8ad3ac084..d092c7a70890e62225be465353b486dd61662fb5 100644 (file)
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -1227,7 +1227,10 @@ optimize_mode_switching (file)
                 previous block.  */
              if (eg->flags & EDGE_ABNORMAL)
                {
-                 src_bb->end = emit_insn_after (mode_set, src_bb->end);
+                 if (GET_CODE (src_bb->end) == JUMP_INSN)
+                   emit_insn_before (mode_set, src_bb->end);
+                 else
+                   src_bb->end = emit_insn_after (mode_set, src_bb->end);
                  bb_info[j][src_bb->index].computing = mode;
                  RESET_BIT (transp[src_bb->index], j);
                }