OSDN Git Service

2009-09-20 Paolo Bonzini <bonzini@gnu.org>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Sep 2009 09:22:11 +0000 (09:22 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Sep 2009 09:22:11 +0000 (09:22 +0000)
PR/39886
* combine.c (update_cfg_for_uncondjump): Set EDGE_FALLTHRU
just when insn is equal to BB_END (bb).

2009-09-20  Kai Tietz  <kai.tietz@onevision.com>

* gcc.c-tortue/compile/pr39886.c: New.

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

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr39886.c [new file with mode: 0644]

index 656df2a..9ed696d 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-20  Paolo Bonzini <bonzini@gnu.org>
+
+       PR/39886
+       * combine.c (update_cfg_for_uncondjump): Set EDGE_FALLTHRU
+       just when insn is equal to BB_END (bb).
+
 2009-09-19  Adam Nemet  <anemet@caviumnetworks.com>
 
        * config/mips/mips.opt (mrelax-pic-calls): New option.
index 6b507c2..35ab576 100644 (file)
@@ -2363,7 +2363,7 @@ propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src, bool move)
     }
 }
 
-/* Delete the conditional jump INSN and adjust the CFG correspondingly.
+/* Delete the unconditional jump INSN and adjust the CFG correspondingly.
    Note that the INSN should be deleted *after* removing dead edges, so
    that the kept edge is the fallthrough edge for a (set (pc) (pc))
    but not for a (set (pc) (label_ref FOO)).  */
@@ -2372,12 +2372,13 @@ static void
 update_cfg_for_uncondjump (rtx insn)
 {
   basic_block bb = BLOCK_FOR_INSN (insn);
+  bool at_end = (BB_END (bb) == insn);
 
-  if (BB_END (bb) == insn)
+  if (at_end)
     purge_dead_edges (bb);
 
   delete_insn (insn);
-  if (EDGE_COUNT (bb->succs) == 1)
+  if (at_end && EDGE_COUNT (bb->succs) == 1)
     single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
 }
 
index 97997ae..6481b99 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-20  Kai Tietz  <kai.tietz@onevision.com>
+
+       * gcc.c-tortue/compile/pr39886.c: New.
+
 2009-09-20  Chris Demetriou  <cgd@google.com>
 
        PR preprocessor/28435:
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39886.c b/gcc/testsuite/gcc.c-torture/compile/pr39886.c
new file mode 100644 (file)
index 0000000..e85dbb3
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR middle-end/39886 */
+
+int foo (int);
+
+volatile unsigned char g;
+
+void bar (int p)
+{
+  char l = 0xE1;
+  func ((foo ((p & g) <= l), 1));
+}
+