This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3] Remove support for obsolete x86 -malign-foo options
- From: Martin Liška <mliska at suse dot cz>
- To: Uros Bizjak <ubizjak at gmail dot com>, Denys Vlasenko <dvlasenk at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at gmail dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Mon, 12 Feb 2018 11:07:33 +0100
- Subject: Re: [PATCH 1/3] Remove support for obsolete x86 -malign-foo options
- Authentication-results: sourceware.org; auth=none
- References: <20170418183023.7857-1-dvlasenk@redhat.com> <20170418183023.7857-2-dvlasenk@redhat.com> <CAFULd4ZS=_tQa70+QpYD6LLfEetJv9n2OA8fMBxPHbj62S5nfA@mail.gmail.com>
On 05/06/2017 09:20 AM, Uros Bizjak wrote:
> On Tue, Apr 18, 2017 at 8:30 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>> 2017-04-18 Denys Vlasenko <dvlasenk@redhat.com>
>>
>> * config/i386/i386-common.c (ix86_handle_option): Remove support
>> for obsolete -malign-loops, -malign-jumps and -malign-functions
>> options.
>> * config/i386/i386.opt: Likewise.
>> Index: gcc/common/config/i386/i386-common.c
>> ===================================================================
>> --- gcc/common/config/i386/i386-common.c (revision 240663)
>> +++ gcc/common/config/i386/i386-common.c (working copy)
>> @@ -998,38 +998,6 @@ ix86_handle_option (struct gcc_options *opts,
>> }
>> return true;
>>
>> -
>> - /* 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;
>> -
>> - case OPT_malign_jumps_:
>> - warning_at (loc, 0, "-malign-jumps is obsolete, use -falign-jumps");
>> - if (value > MAX_CODE_ALIGN)
>> - error_at (loc, "-malign-jumps=%d is not between 0 and %d",
>> - value, MAX_CODE_ALIGN);
>> - else
>> - opts->x_align_jumps = 1 << value;
>> - return true;
>> -
>> - case OPT_malign_functions_:
>> - warning_at (loc, 0,
>> - "-malign-functions is obsolete, use -falign-functions");
>> - if (value > MAX_CODE_ALIGN)
>> - error_at (loc, "-malign-functions=%d is not between 0 and %d",
>> - value, MAX_CODE_ALIGN);
>> - else
>> - opts->x_align_functions = 1 << value;
>> - return true;
>> -
>> case OPT_mbranch_cost_:
>> if (value > 5)
>> {
>> Index: gcc/config/i386/i386.opt
>> ===================================================================
>> --- gcc/config/i386/i386.opt (revision 240663)
>> +++ gcc/config/i386/i386.opt (working copy)
>> @@ -205,18 +205,6 @@ malign-double
>> Target Report Mask(ALIGN_DOUBLE) Save
>> Align some doubles on dword boundary.
>>
>> -malign-functions=
>> -Target RejectNegative Joined UInteger
>> -Function starts are aligned to this power of 2.
>> -
>> -malign-jumps=
>> -Target RejectNegative Joined UInteger
>> -Jump targets are aligned to this power of 2.
>> -
>> -malign-loops=
>> -Target RejectNegative Joined UInteger
>> -Loop code aligned to this power of 2.
>> -
>> malign-stringops
>> Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS) Save
>> Align destination of the string operations.
>
> Instead of removing the above definitions, please rather redefine them
> in a similar way -mcpu in i386.opt is obsoleted, e.g.:
>
> malign-functions=
> Target RejectNegative Joined Undocumented Alias(falign-functions=)
> Warn(%<-malign-functions%> is obsolete, use %<-falign-functions%>)
Please correct me but doing the alias is not simple as value of -malign-functions
option is a power of 2, while -falign-functions= is an absolute value.
Thus -malign-functions=5 == -falign-functions=32.
I believe the legacy options are not problem for the patch series as it only sets
value of -falign-functions option.
Martin
>
> This cleanup should be done a long time ago, the patch can be
> committed independently of other patches in the series.
>
> Uros.
>