From 63c6c7e070b9c79d0a797ed50fa90c8f1d35480d Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Sun, 20 Sep 2009 11:22:11 +0200 Subject: [PATCH] [multiple changes] 2009-09-20 Paolo Bonzini 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 * gcc.c-tortue/compile/pr39886.c: New. From-SVN: r151895 --- gcc/ChangeLog | 6 ++++++ gcc/combine.c | 7 ++++--- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/pr39886.c | 12 ++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr39886.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 656df2a86cbc..9ed696d931b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-09-20 Paolo Bonzini + + 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 * config/mips/mips.opt (mrelax-pic-calls): New option. diff --git a/gcc/combine.c b/gcc/combine.c index 6b507c2991d1..35ab576d612f 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 97997aed9795..6481b993bea4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-09-20 Kai Tietz + + * gcc.c-tortue/compile/pr39886.c: New. + 2009-09-20 Chris Demetriou 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 index 000000000000..e85dbb3418d3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr39886.c @@ -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)); +} + -- 2.47.2