OSDN Git Service

* combine.c (update_cfg_for_uncondjump): Instead of testing at_end
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Apr 2011 17:49:11 +0000 (17:49 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Apr 2011 17:49:11 +0000 (17:49 +0000)
assert it is always true.
(try_combine): Don't call update_cfg_for_uncondjump for noop non-jump
moves.

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

gcc/ChangeLog
gcc/combine.c

index f640b28..96f542c 100644 (file)
@@ -1,3 +1,10 @@
+2011-04-12  Jakub Jelinek  <jakub@redhat.com>
+
+       * combine.c (update_cfg_for_uncondjump): Instead of testing at_end
+       assert it is always true.
+       (try_combine): Don't call update_cfg_for_uncondjump for noop non-jump
+       moves.
+
 2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * c-parser.c (c_lex_one_token): Rewritten conditional used when
 2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * c-parser.c (c_lex_one_token): Rewritten conditional used when
index 23015fd..766118d 100644 (file)
@@ -2490,13 +2490,12 @@ static void
 update_cfg_for_uncondjump (rtx insn)
 {
   basic_block bb = BLOCK_FOR_INSN (insn);
 update_cfg_for_uncondjump (rtx insn)
 {
   basic_block bb = BLOCK_FOR_INSN (insn);
-  bool at_end = (BB_END (bb) == insn);
+  gcc_assert (BB_END (bb) == insn);
 
 
-  if (at_end)
-    purge_dead_edges (bb);
+  purge_dead_edges (bb);
 
   delete_insn (insn);
 
   delete_insn (insn);
-  if (at_end && EDGE_COUNT (bb->succs) == 1)
+  if (EDGE_COUNT (bb->succs) == 1)
     {
       rtx insn;
 
     {
       rtx insn;
 
@@ -4409,7 +4408,8 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
 
   /* A noop might also need cleaning up of CFG, if it comes from the
      simplification of a jump.  */
 
   /* A noop might also need cleaning up of CFG, if it comes from the
      simplification of a jump.  */
-  if (GET_CODE (newpat) == SET
+  if (JUMP_P (i3)
+      && GET_CODE (newpat) == SET
       && SET_SRC (newpat) == pc_rtx
       && SET_DEST (newpat) == pc_rtx)
     {
       && SET_SRC (newpat) == pc_rtx
       && SET_DEST (newpat) == pc_rtx)
     {
@@ -4418,6 +4418,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
     }
 
   if (undobuf.other_insn != NULL_RTX
     }
 
   if (undobuf.other_insn != NULL_RTX
+      && JUMP_P (undobuf.other_insn)
       && GET_CODE (PATTERN (undobuf.other_insn)) == SET
       && SET_SRC (PATTERN (undobuf.other_insn)) == pc_rtx
       && SET_DEST (PATTERN (undobuf.other_insn)) == pc_rtx)
       && GET_CODE (PATTERN (undobuf.other_insn)) == SET
       && SET_SRC (PATTERN (undobuf.other_insn)) == pc_rtx
       && SET_DEST (PATTERN (undobuf.other_insn)) == pc_rtx)