Commit 002618d8 by Martin Liska Committed by Martin Liska

Fix profile update in tree-ssa-isolate-paths.c (PR tree-optimization/82059).

2017-09-01  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/82059
	* gimple-ssa-isolate-paths.c (isolate_path): Add profile and
	frequency only when an edge is redirected.
2017-09-01  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/82059
	* gcc.dg/tree-ssa/pr82059.c: New test.

From-SVN: r251591
parent a2de90a4
2017-09-01 Martin Liska <mliska@suse.cz>
PR tree-optimization/82059
* gimple-ssa-isolate-paths.c (isolate_path): Add profile and
frequency only when an edge is redirected.
2017-09-01 Claudiu Zissulescu <claziss@synopsys.com> 2017-09-01 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-c.c (__ARC_LPC_WIDTH__): Add builtin define. * config/arc/arc-c.c (__ARC_LPC_WIDTH__): Add builtin define.
......
...@@ -160,14 +160,17 @@ isolate_path (basic_block bb, basic_block duplicate, ...@@ -160,14 +160,17 @@ isolate_path (basic_block bb, basic_block duplicate,
for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); ) for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); )
remove_edge (e2); remove_edge (e2);
} }
bb->frequency += EDGE_FREQUENCY (e);
bb->count += e->count;
/* Complete the isolation step by redirecting E to reach DUPLICATE. */ /* Complete the isolation step by redirecting E to reach DUPLICATE. */
e2 = redirect_edge_and_branch (e, duplicate); e2 = redirect_edge_and_branch (e, duplicate);
if (e2) if (e2)
flush_pending_stmts (e2); {
flush_pending_stmts (e2);
/* Update profile only when redirection is really processed. */
bb->frequency += EDGE_FREQUENCY (e);
bb->count += e->count;
}
/* There may be more than one statement in DUPLICATE which exhibits /* There may be more than one statement in DUPLICATE which exhibits
undefined behavior. Ultimately we want the first such statement in undefined behavior. Ultimately we want the first such statement in
......
2017-09-01 Martin Liska <mliska@suse.cz>
PR tree-optimization/82059
* gcc.dg/tree-ssa/pr82059.c: New test.
2017-09-01 Claudiu Zissulescu <claziss@synopsys.com> 2017-09-01 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/loop-1.c: Deleted. * gcc.target/arc/loop-1.c: Deleted.
......
/* PR tree-optimization/82059 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-isolate-paths" } */
struct a
{
char b;
struct a *c;
} d (), f;
void *e;
long g;
void
h ()
{
struct a *i = 0;
if (g)
i = e;
if (!i)
d ();
i->c = &f;
i->b = *(char *) h;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment