public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bschmidt@redhat.com>
To: Denys Vlasenko <dvlasenk@redhat.com>, gcc-patches@gcc.gnu.org
Cc: Andrew Pinski <pinskia@gmail.com>, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH 2/2] Extend -falign-FOO=N to N[,M[,N2[,M2]]]
Date: Fri, 30 Sep 2016 12:10:00 -0000	[thread overview]
Message-ID: <9148fbcb-40ff-a437-465f-edce7fd49286@redhat.com> (raw)
In-Reply-To: <175480fb-142a-f261-5f86-421941369848@redhat.com>

On 09/29/2016 07:32 PM, Denys Vlasenko wrote:
> On 09/29/2016 04:45 PM, Bernd Schmidt wrote:
>> On 09/28/2016 02:57 PM, Denys Vlasenko wrote:
>>> -  /* Comes from final.c -- no real reason to change it.  */
>>> -#define MAX_CODE_ALIGN 16
>>> -
>>>      case OPT_malign_loops_:
>>>        warning_at (loc, 0, "-malign-loops is obsolete, use
>>> -falign-loops");
>>> -      if (value > MAX_CODE_ALIGN)
>>> -    error_at (loc, "-malign-loops=%d is not between 0 and %d",
>>> -          value, MAX_CODE_ALIGN);
>>> -      else
>>> -    opts->x_align_loops = 1 << value;
>>>        return true;
>>
>> That does seem to be a functional change. I'll defer to Uros.
>
> It would be awkward to translate -malign-loops=%d et al
> to comma-separated string format.
> Since this warning is there for some 15 years already,
> anyone who actually cares should have converted to new options
> long ago.

Hmm, if it's been 15 years, maybe it's time to remove these. Could you 
submit a patch separately?

>>> -  if (opts->x_align_functions <= 0)
>>> +  if (opts->x_flag_align_functions && !opts->x_str_align_functions)
>>
>> Are these conditions really equivalent? It looks like zero was
>> the default even when no -falign-functions was specified.
>>  Or is that overriden by init_alignments?
>>
>>>  {
>>> -  if (opts->x_align_loops == 0)
>>> +  /* -falign-foo without argument: supply one */
>>> +  if (opts->x_flag_align_loops && !opts->x_str_align_loops)
>>
>> Same here.
>
> The execution flow for option parsing is somewhat convoluted, no doubt.
>
> I found it experimentally that these are locations where
> default alignment parameters are set when -falign-functions
> is given with no arguments (or when it is implied by -O2).

I applied your latest two patches to experiment with them, and I see 
different behaviour before and after on x86_64-linux. There seems to be 
a difference in function alignment and label alignment at -O2.

I think it would be good to add testcases first to document and verify 
existing behaviour, they would then serve to show whether it is 
unchanged afterwards.

Need to look into the x86 hook thing in a bit more detail.


Bernd

  parent reply	other threads:[~2016-09-30 11:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 13:13 [PATCH 0/2] Extend -falign-FOO=N to N[,M[,N2[,M2]]] version 4 Denys Vlasenko
2016-09-28 12:57 ` [PATCH 1/2] Temporary remove "at least 8 byte alignment" code from x86 Denys Vlasenko
2016-09-28 13:31 ` [PATCH 2/2] Extend -falign-FOO=N to N[,M[,N2[,M2]]] Denys Vlasenko
2016-09-29  8:27   ` Florian Weimer
2016-09-29 14:54   ` Bernd Schmidt
2016-09-29 17:36     ` Denys Vlasenko
2016-09-29 22:04       ` Denys Vlasenko
2016-09-30 12:10       ` Bernd Schmidt [this message]
2016-09-30 15:40         ` Denys Vlasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9148fbcb-40ff-a437-465f-edce7fd49286@redhat.com \
    --to=bschmidt@redhat.com \
    --cc=dvlasenk@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).