cfghooks.c (split_block): Copy discriminator to new block.
authorCary Coutant <ccoutant@google.com>
Fri, 24 Jul 2009 22:37:05 +0000 (22:37 +0000)
committerCary Coutant <ccoutant@gcc.gnu.org>
Fri, 24 Jul 2009 22:37:05 +0000 (15:37 -0700)
* 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.

From-SVN: r150065

gcc/ChangeLog
gcc/cfghooks.c
gcc/tree-cfg.c

index 5fc84c68ec6a0366cec382b8d82d491c726bc907..13acf76809e9aabe30c1d441f9348a86d48eb496 100644 (file)
@@ -1,3 +1,9 @@
+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
index 2c65726fe1777e478faf595a5a8e3c472276cda5..d6690a4b4345772aa9f8f6b18ccdc0eeae60e405 100644 (file)
@@ -437,6 +437,7 @@ split_block (basic_block bb, void *i)
   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))
     {
index 964a537266fc7840634244015ae06dec5a5c67ae..d818b6b52dcacfd5624d19c6d3ab5e0b013b7d17 100644 (file)
@@ -756,13 +756,15 @@ same_line_p (location_t locus1, location_t locus2)
 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);
 }