mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 18:01:22 +08:00
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
This commit is contained in:
parent
a2de90a45a
commit
002618d874
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* config/arc/arc-c.c (__ARC_LPC_WIDTH__): Add builtin define.
|
||||
|
@ -160,14 +160,17 @@ isolate_path (basic_block bb, basic_block duplicate,
|
||||
for (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); )
|
||||
remove_edge (e2);
|
||||
}
|
||||
bb->frequency += EDGE_FREQUENCY (e);
|
||||
bb->count += e->count;
|
||||
|
||||
/* Complete the isolation step by redirecting E to reach DUPLICATE. */
|
||||
e2 = redirect_edge_and_branch (e, duplicate);
|
||||
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
|
||||
undefined behavior. Ultimately we want the first such statement in
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* gcc.target/arc/loop-1.c: Deleted.
|
||||
|
22
gcc/testsuite/gcc.dg/tree-ssa/pr82059.c
Normal file
22
gcc/testsuite/gcc.dg/tree-ssa/pr82059.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user