+2009-07-24 Cary Coutant <ccoutant@google.com>
+
+ * cfghooks.c (split_block): Copy discriminator to new block.
+ * tree-cfg.c (assign_discriminator): Check location of last
+ instruction in block as well as first.
+
2009-07-24 Uros Bizjak <ubizjak@gmail.com>
* config/i386/linux.c: Use fputs or putc instead of fprintf
new_bb->count = bb->count;
new_bb->frequency = bb->frequency;
new_bb->loop_depth = bb->loop_depth;
+ new_bb->discriminator = bb->discriminator;
if (dom_info_available_p (CDI_DOMINATORS))
{
static void
assign_discriminator (location_t locus, basic_block bb)
{
- gimple to_stmt;
+ gimple first_in_to_bb, last_in_to_bb;
if (locus == 0 || bb->discriminator != 0)
return;
- to_stmt = first_non_label_stmt (bb);
- if (to_stmt && same_line_p (locus, gimple_location (to_stmt)))
+ first_in_to_bb = first_non_label_stmt (bb);
+ last_in_to_bb = last_stmt (bb);
+ if (first_in_to_bb && same_line_p (locus, gimple_location (first_in_to_bb))
+ || last_in_to_bb && same_line_p (locus, gimple_location (last_in_to_bb)))
bb->discriminator = next_discriminator_for_locus (locus);
}