This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 0/3] Simplify the simple_return handling
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 May 2016 19:10:41 -0500
- Subject: Re: [PATCH 0/3] Simplify the simple_return handling
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1462256244 dot git dot segher at kernel dot crashing dot org> <57289F56 dot 70506 at redhat dot com>
On Tue, May 03, 2016 at 02:53:42PM +0200, Bernd Schmidt wrote:
> Looking at the outputs I see a number of jump to return replaced with
> plain return, which seems like an improvement. There are random changes
> in .p2align output:
<snip>
> Do you have an explanation as to why this happens? (Testcase: basically
> any large file.)
A simple example is crtstuff.c:__do_global_dtors_aux, that is
===
void deregister_tm_clones (void);
static void __attribute__((used))
__do_global_dtors_aux (void)
{
static _Bool completed;
if (__builtin_expect (completed, 0))
return;
deregister_tm_clones ();
completed = 1;
}
===
The difference happens in final.c:compute_alignments. After the change,
you have a simple fork from bb2 fallthrough to bb3 (90%) and branch to
bb4 (10%), both bb3 and bb4 have a return. compute_alignments decides
to align bb4.
Before the change, bb2 falls through to bb3 (90%) and branches to bb4
(10%); bb3 falls through to bb4; and bb4 has the wrong frequency (9000,
should be 10000). bb4 is not aligned (because it is fallen into).
> I think all three patches look ok, except all your fprintf calls are
> misindented.
Is this sufficient explanation, is it okay with the fprintf's fixed?
Thanks,
Segher