diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2017-01-05 01:46:32 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2017-01-05 01:46:32 +0000 |
commit | 4dbebf6fc367d4730d252bb6b1c669d533c13b92 (patch) | |
tree | 667b218094a140a82f7e0a1580cd9223daa468b0 | |
parent | 556655048b30188a560f135ccde732bc436eded2 (diff) | |
download | gcc-4dbebf6fc367d4730d252bb6b1c669d533c13b92.zip gcc-4dbebf6fc367d4730d252bb6b1c669d533c13b92.tar.gz gcc-4dbebf6fc367d4730d252bb6b1c669d533c13b92.tar.bz2 |
[-fcompare-debug] find jump before debug insns in expand
A debug insn after the final jump of a basic block may cause the
expander to emit a dummy move where the non-debug compile won't
because it finds the jump insn at the end of the insn stream.
Fix the condition so that, instead of requiring the jump as the last
insn, it also matches a jump followed by debug insns.
This fixes the compilation of libgcc/libgcov-profiler.c with
-fcompare-debug on i686-linux-gnu.
for gcc/ChangeLog
* cfgexpand.c (expand_gimple_basic_block): Disregard debug
insns after final jump in test to emit dummy move.
From-SVN: r244089
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfgexpand.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f26a7a..1031a43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2017-01-04 Alexandre Oliva <aoliva@redhat.com> + * cfgexpand.c (expand_gimple_basic_block): Disregard debug + insns after final jump in test to emit dummy move. + +2017-01-04 Alexandre Oliva <aoliva@redhat.com> + * gimple-iterator.h (gsi_one_nondebug_before_end_p): New. * tree-eh.c (cleanup_empty_eh): Skip more debug stmts. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index ae063c1..66af699 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -5767,7 +5767,9 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) if (single_succ_p (bb) && (single_succ_edge (bb)->flags & EDGE_FALLTHRU) && (last = get_last_insn ()) - && JUMP_P (last)) + && (JUMP_P (last) + || (DEBUG_INSN_P (last) + && JUMP_P (prev_nondebug_insn (last))))) { rtx dummy = gen_reg_rtx (SImode); emit_insn_after_noloc (gen_move_insn (dummy, dummy), last, NULL); |