2010-05-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/44071
+ * cfglayout.c (fixup_reorder_chain): Allow asm goto to have
+ no fallthru edge.
+ * cfgcleanup.c (try_optimize_cfg): When in cfglayout mode
+ optimizing away empty bb with no successors, move over its
+ footer chain to fallthru predecessor.
+ * cfgrtl.c (patch_jump_insn): Update also REG_LABEL_OPERAND.
+ (rtl_split_edge): For asm goto call patch_jump_insn even if
+ splitting fallthru edge.
+
PR c++/44059
* config/elfos.h (ASM_DECLARE_OBJECT_NAME): Use qnu_unique_object
even for DECL_ONE_ONLY DECL_ARTIFICIAL !TREE_READONLY decls.
&& single_succ_edge (ENTRY_BLOCK_PTR)->dest != b))
{
c = b->prev_bb;
- if (EDGE_COUNT (b->preds) > 0)
+ if ((mode & CLEANUP_CFGLAYOUT)
+ && EDGE_COUNT (b->preds) > 0
+ && b->il.rtl->footer
+ && BARRIER_P (b->il.rtl->footer))
{
edge e;
edge_iterator ei;
- if (current_ir_type () == IR_RTL_CFGLAYOUT)
- {
- if (b->il.rtl->footer
- && BARRIER_P (b->il.rtl->footer))
- FOR_EACH_EDGE (e, ei, b->preds)
- if ((e->flags & EDGE_FALLTHRU)
- && e->src->il.rtl->footer == NULL)
- {
- if (b->il.rtl->footer)
- {
- e->src->il.rtl->footer = b->il.rtl->footer;
- b->il.rtl->footer = NULL;
- }
- else
- {
- start_sequence ();
- e->src->il.rtl->footer = emit_barrier ();
- end_sequence ();
- }
- }
- }
- else
- {
- rtx last = get_last_bb_insn (b);
- if (last && BARRIER_P (last))
- FOR_EACH_EDGE (e, ei, b->preds)
- if ((e->flags & EDGE_FALLTHRU))
- emit_barrier_after (BB_END (e->src));
- }
+ FOR_EACH_EDGE (e, ei, b->preds)
+ if (e->flags & EDGE_FALLTHRU)
+ {
+ if (e->src->il.rtl->footer == NULL)
+ {
+ e->src->il.rtl->footer = b->il.rtl->footer;
+ b->il.rtl->footer = NULL;
+ }
+ break;
+ }
}
delete_basic_block (b);
if (!(mode & CLEANUP_CFGLAYOUT))
2010-05-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/44071
+ * c-c++-common/asmgoto-4.c: New test.
+ * gcc.target/i386/pr44071.c: New test.
+
PR c++/44062
* c-c++-common/Wunused-var-7.c: New test.
* g++.dg/warn/Wunused-var-9.C: New test.