+2007-07-17 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR rtl-optimization/32773
+ * cfglayout.c (force_one_exit_fallthru): New function.
+ (cfg_layout_finalize): Use it.
+
2007-07-16 Richard Guenther <rguenther@suse.de>
Uros Bizjak <ubizjak@gmail.com>
bb->aux = NULL;
}
}
+
+/* In case there are more than one fallthru predecessors of exit, force that
+ there is only one. */
+
+static void
+force_one_exit_fallthru (void)
+{
+ edge e, predecessor = NULL;
+ bool more = false;
+ edge_iterator ei;
+ basic_block forwarder, bb;
+
+ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
+ if (e->flags & EDGE_FALLTHRU)
+ {
+ if (predecessor == NULL)
+ predecessor = e;
+ else
+ {
+ more = true;
+ break;
+ }
+ }
+
+ if (!more)
+ return;
+
+ /* Exit has several fallthru predecessors. Create a forwarder block for
+ them. */
+ forwarder = split_edge (predecessor);
+ for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); )
+ {
+ if (e->src == forwarder
+ || !(e->flags & EDGE_FALLTHRU))
+ ei_next (&ei);
+ else
+ redirect_edge_and_branch_force (e, forwarder);
+ }
+
+ /* Fix up the chain of blocks -- make FORWARDER immediately preceed the
+ exit block. */
+ FOR_EACH_BB (bb)
+ {
+ if (bb->aux == NULL && bb != forwarder)
+ {
+ bb->aux = forwarder;
+ break;
+ }
+ }
+}
\f
/* Return true in case it is possible to duplicate the basic block BB. */
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
+ force_one_exit_fallthru ();
rtl_register_cfg_hooks ();
if (reload_completed
#ifdef HAVE_epilogue
+2007-07-17 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR rtl-optimization/32773
+ * gcc.dg/pr32773.c: New test.
+
2007-07-16 Andrew Pinski <andrew_pinski@playstation.sony.com>
* gcc.target/spu/intrinsics-1.c: Use dg-message to
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fprofile-use" } */
+/* { dg-options "-O -m4 -fprofile-use" { target sh-*-* } } */
+
+void foo (int *p)
+{
+ if (p)
+ *p = 0;
+} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
+
+/* { dg-final { cleanup-coverage-files } } */