File tree Expand file tree Collapse file tree 4 files changed +73
-0
lines changed
Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 1+ 2007-07-17 Zdenek Dvorak <dvorakz@suse.cz>
2+
3+ PR rtl-optimization/32773
4+ * cfglayout.c (force_one_exit_fallthru): New function.
5+ (cfg_layout_finalize): Use it.
6+
172007-07-16 Richard Guenther <rguenther@suse.de>
28 Uros Bizjak <ubizjak@gmail.com>
39
Original file line number Diff line number Diff line change @@ -963,6 +963,56 @@ fixup_fallthru_exit_predecessor (void)
963963 bb -> aux = NULL ;
964964 }
965965}
966+
967+ /* In case there are more than one fallthru predecessors of exit, force that
968+ there is only one. */
969+
970+ static void
971+ force_one_exit_fallthru (void )
972+ {
973+ edge e , predecessor = NULL ;
974+ bool more = false;
975+ edge_iterator ei ;
976+ basic_block forwarder , bb ;
977+
978+ FOR_EACH_EDGE (e , ei , EXIT_BLOCK_PTR -> preds )
979+ if (e -> flags & EDGE_FALLTHRU )
980+ {
981+ if (predecessor == NULL )
982+ predecessor = e ;
983+ else
984+ {
985+ more = true;
986+ break ;
987+ }
988+ }
989+
990+ if (!more )
991+ return ;
992+
993+ /* Exit has several fallthru predecessors. Create a forwarder block for
994+ them. */
995+ forwarder = split_edge (predecessor );
996+ for (ei = ei_start (EXIT_BLOCK_PTR -> preds ); (e = ei_safe_edge (ei )); )
997+ {
998+ if (e -> src == forwarder
999+ || !(e -> flags & EDGE_FALLTHRU ))
1000+ ei_next (& ei );
1001+ else
1002+ redirect_edge_and_branch_force (e , forwarder );
1003+ }
1004+
1005+ /* Fix up the chain of blocks -- make FORWARDER immediately preceed the
1006+ exit block. */
1007+ FOR_EACH_BB (bb )
1008+ {
1009+ if (bb -> aux == NULL && bb != forwarder )
1010+ {
1011+ bb -> aux = forwarder ;
1012+ break ;
1013+ }
1014+ }
1015+ }
9661016
9671017/* Return true in case it is possible to duplicate the basic block BB. */
9681018
@@ -1178,6 +1228,7 @@ cfg_layout_finalize (void)
11781228#ifdef ENABLE_CHECKING
11791229 verify_flow_info ();
11801230#endif
1231+ force_one_exit_fallthru ();
11811232 rtl_register_cfg_hooks ();
11821233 if (reload_completed
11831234#ifdef HAVE_epilogue
Original file line number Diff line number Diff line change 1+ 2007-07-17 Zdenek Dvorak <dvorakz@suse.cz>
2+
3+ PR rtl-optimization/32773
4+ * gcc.dg/pr32773.c: New test.
5+
162007-07-16 Andrew Pinski <andrew_pinski@playstation.sony.com>
27
38 * gcc.target/spu/intrinsics-1.c: Use dg-message to
Original file line number Diff line number Diff line change 1+ /* { dg-do compile } */
2+ /* { dg-options "-O -fprofile-use" } */
3+ /* { dg-options "-O -m4 -fprofile-use" { target sh-*-* } } */
4+
5+ void foo (int * p )
6+ {
7+ if (p )
8+ * p = 0 ;
9+ } /* { dg-message "note: \[^\n\]*execution counts estimated" } */
10+
11+ /* { dg-final { cleanup-coverage-files } } */
You can’t perform that action at this time.
0 commit comments