+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.
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
+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.
--- /dev/null
+/* 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;
+}