This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/3] Simplify the simple_return handling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]