OSDN Git Service

* cfglayout.c (fixup_reorder_chain): Remove kludge for the
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jan 2006 22:47:50 +0000 (22:47 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jan 2006 22:47:50 +0000 (22:47 +0000)
case of conditional jump jumping to the next instruction.
* cfgrtl.c (force_nonfallthru_and_redirect): Accept all
cases of conditional jump jumping to the next instruction.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109247 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfglayout.c
gcc/cfgrtl.c

index 2834096..0423185 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-02  Eric Botcazou  <ebotcazou@adacore.com>
+            Jan Hubicka  <jh@suse.cz>
+
+       * cfglayout.c (fixup_reorder_chain): Remove kludge for the
+       case of conditional jump jumping to the next instruction.
+       * cfgrtl.c (force_nonfallthru_and_redirect): Accept all
+       cases of conditional jump jumping to the next instruction.
+
 2006-01-02  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (*_cost): Add COSTS_N_INSNS.
index d2580b4..5880819 100644 (file)
@@ -680,41 +680,13 @@ fixup_reorder_chain (void)
                continue;
 
              /* The degenerated case of conditional jump jumping to the next
-                instruction can happen on target having jumps with side
-                effects.
-
-                Create temporarily the duplicated edge representing branch.
-                It will get unidentified by force_nonfallthru_and_redirect
-                that would otherwise get confused by fallthru edge not pointing
-                to the next basic block.  */
+                instruction can happen for jumps with side effects.  We need
+                to construct a forwarder block and this will be done just
+                fine by force_nonfallthru below.  */
              if (!e_taken)
-               {
-                 rtx note;
-                 edge e_fake;
-                 bool redirected;
-
-                 e_fake = unchecked_make_edge (bb, e_fall->dest, 0);
-
-                 redirected = redirect_jump (BB_END (bb),
-                                             block_label (bb), 0);
-                 gcc_assert (redirected);
-                 
-                 note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
-                 if (note)
-                   {
-                     int prob = INTVAL (XEXP (note, 0));
-
-                     e_fake->probability = prob;
-                     e_fake->count = e_fall->count * prob / REG_BR_PROB_BASE;
-                     e_fall->probability -= e_fall->probability;
-                     e_fall->count -= e_fake->count;
-                     if (e_fall->probability < 0)
-                       e_fall->probability = 0;
-                     if (e_fall->count < 0)
-                       e_fall->count = 0;
-                   }
-               }
-             /* There is one special case: if *neither* block is next,
+               ;
+
+             /* There is another special case: if *neither* block is next,
                 such as happens at the very end of a function, then we'll
                 need to add a new unconditional jump.  Choose the taken
                 edge based on known or assumed probability.  */
index fcf3590..6ff6c39 100644 (file)
@@ -1014,9 +1014,6 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
      by creating a basic block afterwards to redirect fallthru edge.  */
   if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR
       && any_condjump_p (BB_END (e->src))
-      /* When called from cfglayout, fallthru edges do not
-         necessarily go to the next block.  */
-      && e->src->next_bb == e->dest
       && JUMP_LABEL (BB_END (e->src)) == BB_HEAD (e->dest))
     {
       rtx note;