summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-24 22:37:05 +0000
committerccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-24 22:37:05 +0000
commit04953c086dbc2ee9a2350d2618094aebd89dea7f (patch)
tree6458eefa49d090a1d57d4fe791e5a56f2a987f5e
parent270aef919c1b4cf7ea1c54e861768c20d5901471 (diff)
downloadppe42-gcc-04953c086dbc2ee9a2350d2618094aebd89dea7f.tar.gz
ppe42-gcc-04953c086dbc2ee9a2350d2618094aebd89dea7f.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150065 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfghooks.c1
-rw-r--r--gcc/tree-cfg.c8
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5fc84c68ec6..13acf76809e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 2c65726fe17..d6690a4b434 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -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))
{
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 964a537266f..d818b6b52dc 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -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);
}
OpenPOWER on IntegriCloud