Patchwork Mark threshold arrays in bb-reorder.c as constant

login
register
mail settings
Submitter David Malcolm
Date May 23, 2013, 12:30 a.m.
Message ID <1369269035.26167.39.camel@surprise>
Download mbox | patch
Permalink /patch/245791/
State New
Headers show

Comments

David Malcolm - May 23, 2013, 12:30 a.m.
The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
since 2004 (in r80564).

As part of my hope of quashing global state in gcc, I'd like to mark
them as const.

Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
has the same test results as an unpatched bootstrap of that revision.

OK to commit to trunk?

2013-05-21  David Malcolm  <dmalcolm@redhat.com>

	* bb-reorder.c (branch_threshold): make const
	(exec_threshold): ditto
Jeff Law - May 23, 2013, 1:56 a.m.
On 05/22/2013 06:30 PM, David Malcolm wrote:
> The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
> since 2004 (in r80564).
>
> As part of my hope of quashing global state in gcc, I'd like to mark
> them as const.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
> has the same test results as an unpatched bootstrap of that revision.
OK.
Jeff
David Malcolm - May 23, 2013, 2:21 a.m.
On Wed, 2013-05-22 at 19:56 -0600, Jeff Law wrote:
> On 05/22/2013 06:30 PM, David Malcolm wrote:
> > The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
> > since 2004 (in r80564).
> >
> > As part of my hope of quashing global state in gcc, I'd like to mark
> > them as const.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
> > has the same test results as an unpatched bootstrap of that revision.
> OK.
Thanks; committed to svn trunk as r199230.
Jakub Jelinek - May 23, 2013, 4:56 a.m.
On Wed, May 22, 2013 at 08:30:35PM -0400, David Malcolm wrote:
> The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
> since 2004 (in r80564).
> 
> As part of my hope of quashing global state in gcc, I'd like to mark
> them as const.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
> has the same test results as an unpatched bootstrap of that revision.
> 
> OK to commit to trunk?
> 
> 2013-05-21  David Malcolm  <dmalcolm@redhat.com>
> 
> 	* bb-reorder.c (branch_threshold): make const
> 	(exec_threshold): ditto

The ChangeLog formatting is bad.  After ): should always be a capital letter
and the description should end with dot.  So:

	* bb-reorder.c (branch_threshold): Make const.
	(exec_threshold): Ditto.

instead.

	Jakub
Chung-Ju Wu - May 24, 2013, 3:51 p.m.
2013/5/23 Jakub Jelinek <jakub@redhat.com>:
> On Wed, May 22, 2013 at 08:30:35PM -0400, David Malcolm wrote:
>> The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
>> since 2004 (in r80564).
>>
>> As part of my hope of quashing global state in gcc, I'd like to mark
>> them as const.
>>
>> Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
>> has the same test results as an unpatched bootstrap of that revision.
>>
>> OK to commit to trunk?
>>
>> 2013-05-21  David Malcolm  <dmalcolm@redhat.com>
>>
>>       * bb-reorder.c (branch_threshold): make const
>>       (exec_threshold): ditto
>
> The ChangeLog formatting is bad.  After ): should always be a capital letter
> and the description should end with dot.  So:
>
>         * bb-reorder.c (branch_threshold): Make const.
>         (exec_threshold): Ditto.
>
> instead.
>
>         Jakub


Hi, David,

There is a similar issue in the contrib/ChangeLog.


2013-05-21  David Malcolm  <dmalcolm@redhat.com>

        * repro_fail: filter out "-ignore SIGHUP" from the spawn lines


It would be great if you can fix them to make formatting consistent. :)


Best regards,
jasonwucj
David Malcolm - May 24, 2013, 4:16 p.m.
On Fri, 2013-05-24 at 23:51 +0800, Chung-Ju Wu wrote:
> 2013/5/23 Jakub Jelinek <jakub@redhat.com>:
> > On Wed, May 22, 2013 at 08:30:35PM -0400, David Malcolm wrote:
> >> The arrays of thresholds in gcc/bb-reorder.c appear not to have changed
> >> since 2004 (in r80564).
> >>
> >> As part of my hope of quashing global state in gcc, I'd like to mark
> >> them as const.
> >>
> >> Bootstrapped and tested on x86_64-unknown-linux-gnu against r199189, and
> >> has the same test results as an unpatched bootstrap of that revision.
> >>
> >> OK to commit to trunk?
> >>
> >> 2013-05-21  David Malcolm  <dmalcolm@redhat.com>
> >>
> >>       * bb-reorder.c (branch_threshold): make const
> >>       (exec_threshold): ditto
> >
> > The ChangeLog formatting is bad.  After ): should always be a capital letter
> > and the description should end with dot.  So:
> >
> >         * bb-reorder.c (branch_threshold): Make const.
> >         (exec_threshold): Ditto.
> >
> > instead.
> >
> >         Jakub
> 
> 
> Hi, David,
> 
> There is a similar issue in the contrib/ChangeLog.
> 
> 
> 2013-05-21  David Malcolm  <dmalcolm@redhat.com>
> 
>         * repro_fail: filter out "-ignore SIGHUP" from the spawn lines
> 
> 
> It would be great if you can fix them to make formatting consistent. :)

I've fixed both of these (I hope) in r199302

Thanks
Dave

Patch

commit 60623f1616b3144310f432174ebbb3e2cc6dff28
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue May 21 21:52:45 2013 -0400

    Make bb-reorder.c arrays const
    
    gcc/
    	* bb-reorder.c (branch_threshold): make const
    	(exec_threshold): ditto

diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 3167220..0a1f42a 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -123,10 +123,10 @@  struct target_bb_reorder *this_target_bb_reorder = &default_target_bb_reorder;
   (this_target_bb_reorder->x_uncond_jump_length)
 
 /* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE.  */
-static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0};
+static const int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0};
 
 /* Exec thresholds in thousandths (per mille) of the frequency of bb 0.  */
-static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0};
+static const int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0};
 
 /* If edge frequency is lower than DUPLICATION_THRESHOLD per mille of entry
    block the edge destination is not duplicated while connecting traces.  */