Re: [PATCH 1/3] Remove support for obsolete x86 -malign-foo options

2018-02-12 Thread Martin Liška
On 05/06/2017 09:20 AM, Uros Bizjak wrote:
> On Tue, Apr 18, 2017 at 8:30 PM, Denys Vlasenko  wrote:
>> 2017-04-18  Denys Vlasenko  
>>
>> * 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.
> 



Re: [PATCH 1/3] Remove support for obsolete x86 -malign-foo options

2017-05-11 Thread Denys Vlasenko

On 05/06/2017 09:20 AM, Uros Bizjak wrote:

On Tue, Apr 18, 2017 at 8:30 PM, Denys Vlasenko  wrote:

2017-04-18  Denys Vlasenko  

* 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.

...

--- 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


They were already obsoleted sixteen years ago. The warning message
was added:

   if (ix86_align_loops_string)
 {
-  i = atoi (ix86_align_loops_string);
-  if (i < 0 || i > MAX_CODE_ALIGN)
-   error ("-malign-loops=%d is not between 0 and %d", i, MAX_CODE_ALIGN);
-  else
-   ix86_align_loops = i;
+  warning ("-malign-loops is obsolete, use -falign-loops");

in the year 2001:

commit a2b35d8705efb23182c3e4b75a5e7727b6ddfc88
Author: geoffk 
Date:   Fri May 4 06:31:27 2001 +

* invoke.texi (i386 Options): Delete references to -malign-jumps,
-malign-loops, -malign-functions.
* i386.c (ix86_align_funcs): Delete.
(ix86_align_loops): Delete.
(ix86_align_jumps): Delete.
(override_options): Mark -malign-* as obsolete.  Emulate their
behaviour with the -falign-* options.  Default -falign-* from
the processor table.
* i386.h (FUNCTION_BOUNDARY): Define to 16; revert Richard Kenner's
patch of Wed May 2 13:09:36 2001.
(LOOP_ALIGN): Delete.
(LOOP_ALIGN_MAX_SKIP): Delete.
(LABEL_ALIGN_AFTER_BARRIER): Delete.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41825 
138bc75d-0d04-0410-961f-82ee72b054a4


I would think sixteen years of receiving these warnings should enough
for everyone to switch to the -falign options.


Re: [PATCH 1/3] Remove support for obsolete x86 -malign-foo options

2017-05-06 Thread Uros Bizjak
On Tue, Apr 18, 2017 at 8:30 PM, Denys Vlasenko  wrote:
> 2017-04-18  Denys Vlasenko  
>
> * 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%>)

This cleanup should be done a long time ago, the patch can be
committed independently of other patches in the series.

Uros.