public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
@ 2017-07-06  5:47 Michael Collison
  2017-07-06  8:56 ` Kyrill Tkachov
  2017-07-06 10:16 ` Richard Earnshaw (lists)
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Collison @ 2017-07-06  5:47 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

NetBSD/Arm requires that DEFAULT_STRUCTURE_SIZE_BOUNDARY (see config/arm/netbsd-elf.h for details). This patch disallows -mstructure-size-boundary on netbsd if the value is not equal to the DEFAULT_STRUCTURE_SIZE_BOUNDARY.

Okay for trunk?

2017-07-05  Michael Collison  <michael.collison@arm.com>

	* config/arm/arm.c (arm_option_override): Disallow
	-mstructure-size-boundary on netbsd if value is not
	DEFAULT_STRUCTURE_SIZE_BOUNDARY.

[-- Attachment #2: pr1556.patch --]
[-- Type: application/octet-stream, Size: 853 bytes --]

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index bc1e607..911c272 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3471,7 +3471,18 @@ arm_option_override (void)
     }
   else
     {
-      if (arm_structure_size_boundary != 8
+      /* Do not allow structure size boundary to be overridden for netbsd.  */
+
+      if ((arm_abi == ARM_ABI_ATPCS)
+	  && (arm_structure_size_boundary != DEFAULT_STRUCTURE_SIZE_BOUNDARY))
+	{
+	  warning (0,
+		   "option %<-mstructure-size-boundary%> is deprecated for netbsd; "
+		   "defaulting to %d",
+		   DEFAULT_STRUCTURE_SIZE_BOUNDARY);
+	  arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
+	}
+      else if (arm_structure_size_boundary != 8
 	  && arm_structure_size_boundary != 32
 	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
 	{
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
  2017-07-06  5:47 [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations Michael Collison
@ 2017-07-06  8:56 ` Kyrill Tkachov
  2017-07-06 10:16 ` Richard Earnshaw (lists)
  1 sibling, 0 replies; 5+ messages in thread
From: Kyrill Tkachov @ 2017-07-06  8:56 UTC (permalink / raw)
  To: Michael Collison, GCC Patches; +Cc: nd

Hi Michael,

On 06/07/17 06:46, Michael Collison wrote:
> NetBSD/Arm requires that DEFAULT_STRUCTURE_SIZE_BOUNDARY (see config/arm/netbsd-elf.h for details). This patch disallows -mstructure-size-boundary on netbsd if the value is not equal to the DEFAULT_STRUCTURE_SIZE_BOUNDARY.
>
> Okay for trunk?
>
> 2017-07-05  Michael Collison  <michael.collison@arm.com>
>
> 	* config/arm/arm.c (arm_option_override): Disallow
> 	-mstructure-size-boundary on netbsd if value is not
> 	DEFAULT_STRUCTURE_SIZE_BOUNDARY.

I don't have any experience with this option so I'll let Richard or Ramana comment on whether this
is appropriate, but if you go ahead with this you'll also need to update the documentation for this
option in doc/invoke.texi.

If this goes in we'll also need an entry for the changes.html page for GCC 8.

Kyrill

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
  2017-07-06  5:47 [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations Michael Collison
  2017-07-06  8:56 ` Kyrill Tkachov
@ 2017-07-06 10:16 ` Richard Earnshaw (lists)
  2017-07-13 10:26   ` Michael Collison
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Earnshaw (lists) @ 2017-07-06 10:16 UTC (permalink / raw)
  To: Michael Collison, GCC Patches; +Cc: nd

On 06/07/17 06:46, Michael Collison wrote:
> NetBSD/Arm requires that DEFAULT_STRUCTURE_SIZE_BOUNDARY (see config/arm/netbsd-elf.h for details). This patch disallows -mstructure-size-boundary on netbsd if the value is not equal to the DEFAULT_STRUCTURE_SIZE_BOUNDARY.
> 
> Okay for trunk?
> 
> 2017-07-05  Michael Collison  <michael.collison@arm.com>
> 
> 	* config/arm/arm.c (arm_option_override): Disallow
> 	-mstructure-size-boundary on netbsd if value is not
> 	DEFAULT_STRUCTURE_SIZE_BOUNDARY.
> 
> 

Frankly, I'd rather we moved towards obsoleting this option entirely.
The origins are from the days of the APCS (note, not AAPCS) when the
default was 32 when most of the world expected 8.

Now that the AAPCS is widely adopted, APCS is obsolete (NetBSD uses
ATPCS) and NetBSD (the only port not based on AAPCS these days) defaults
to 8 I can't see why anybody now would be interested in using a
different value.

So let's just mark this option as deprecated (emit a warning if

global_options_set.x_arm_structure_size_boundary

is ever set by the user, regardless of value).  Then in GCC 9 we can
perhaps remove this code entirely.

Documentation and release notes will need corresponding updates as well.

R.

> pr1556.patch
> 
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index bc1e607..911c272 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -3471,7 +3471,18 @@ arm_option_override (void)
>      }
>    else
>      {
> -      if (arm_structure_size_boundary != 8
> +      /* Do not allow structure size boundary to be overridden for netbsd.  */
> +
> +      if ((arm_abi == ARM_ABI_ATPCS)
> +	  && (arm_structure_size_boundary != DEFAULT_STRUCTURE_SIZE_BOUNDARY))
> +	{
> +	  warning (0,
> +		   "option %<-mstructure-size-boundary%> is deprecated for netbsd; "
> +		   "defaulting to %d",
> +		   DEFAULT_STRUCTURE_SIZE_BOUNDARY);
> +	  arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
> +	}
> +      else if (arm_structure_size_boundary != 8
>  	  && arm_structure_size_boundary != 32
>  	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
>  	{
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
  2017-07-06 10:16 ` Richard Earnshaw (lists)
@ 2017-07-13 10:26   ` Michael Collison
  2017-07-21 13:22     ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Collison @ 2017-07-13 10:26 UTC (permalink / raw)
  To: Richard Earnshaw, GCC Patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 2882 bytes --]

Updated per Richard's comments and suggestions.

Okay for trunk?

2017-07-10  Michael Collison  <michael.collison@arm.com>

	* config/arm/arm.c (arm_option_override): Deprecate
	use of -mstructure-size-boundary.
	* config/arm/arm.opt: Deprecate -mstructure-size-boundary.
	* doc/invoke.texi: Deprecate -mstructure-size-boundary.

-----Original Message-----
From: Richard Earnshaw (lists) [mailto:Richard.Earnshaw@arm.com] 
Sent: Thursday, July 6, 2017 3:17 AM
To: Michael Collison <Michael.Collison@arm.com>; GCC Patches <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>
Subject: Re: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations

On 06/07/17 06:46, Michael Collison wrote:
> NetBSD/Arm requires that DEFAULT_STRUCTURE_SIZE_BOUNDARY (see config/arm/netbsd-elf.h for details). This patch disallows -mstructure-size-boundary on netbsd if the value is not equal to the DEFAULT_STRUCTURE_SIZE_BOUNDARY.
> 
> Okay for trunk?
> 
> 2017-07-05  Michael Collison  <michael.collison@arm.com>
> 
> 	* config/arm/arm.c (arm_option_override): Disallow
> 	-mstructure-size-boundary on netbsd if value is not
> 	DEFAULT_STRUCTURE_SIZE_BOUNDARY.
> 
> 

Frankly, I'd rather we moved towards obsoleting this option entirely.
The origins are from the days of the APCS (note, not AAPCS) when the default was 32 when most of the world expected 8.

Now that the AAPCS is widely adopted, APCS is obsolete (NetBSD uses
ATPCS) and NetBSD (the only port not based on AAPCS these days) defaults to 8 I can't see why anybody now would be interested in using a different value.

So let's just mark this option as deprecated (emit a warning if

global_options_set.x_arm_structure_size_boundary

is ever set by the user, regardless of value).  Then in GCC 9 we can perhaps remove this code entirely.

Documentation and release notes will need corresponding updates as well.

R.

> pr1556.patch
> 
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 
> bc1e607..911c272 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -3471,7 +3471,18 @@ arm_option_override (void)
>      }
>    else
>      {
> -      if (arm_structure_size_boundary != 8
> +      /* Do not allow structure size boundary to be overridden for 
> + netbsd.  */
> +
> +      if ((arm_abi == ARM_ABI_ATPCS)
> +	  && (arm_structure_size_boundary != DEFAULT_STRUCTURE_SIZE_BOUNDARY))
> +	{
> +	  warning (0,
> +		   "option %<-mstructure-size-boundary%> is deprecated for netbsd; "
> +		   "defaulting to %d",
> +		   DEFAULT_STRUCTURE_SIZE_BOUNDARY);
> +	  arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
> +	}
> +      else if (arm_structure_size_boundary != 8
>  	  && arm_structure_size_boundary != 32
>  	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
>  	{
> 


[-- Attachment #2: pr1556v2.patch --]
[-- Type: application/octet-stream, Size: 1507 bytes --]

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c6101ef..b5dbfeb 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3489,6 +3489,8 @@ arm_option_override (void)
     }
   else
     {
+      warning (0, "option %<-mstructure-size-boundary%> is deprecated");
+
       if (arm_structure_size_boundary != 8
 	  && arm_structure_size_boundary != 32
 	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index b6c707b..6060516 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -192,7 +192,7 @@ Target RejectNegative Alias(mfloat-abi=, soft) Undocumented
 
 mstructure-size-boundary=
 Target RejectNegative Joined UInteger Var(arm_structure_size_boundary) Init(DEFAULT_STRUCTURE_SIZE_BOUNDARY)
-Specify the minimum bit alignment of structures.
+Specify the minimum bit alignment of structures. (Deprecated).
 
 mthumb
 Target Report RejectNegative Negative(marm) Mask(THUMB) Save
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3e5cee8..cfe5985 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15685,6 +15685,8 @@ incompatible.  Code compiled with one value cannot necessarily expect to
 work with code or libraries compiled with another value, if they exchange
 information using structures or unions.
 
+This option is deprecated.
+
 @item -mabort-on-noreturn
 @opindex mabort-on-noreturn
 Generate a call to the function @code{abort} at the end of a
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
  2017-07-13 10:26   ` Michael Collison
@ 2017-07-21 13:22     ` Richard Earnshaw (lists)
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Earnshaw (lists) @ 2017-07-21 13:22 UTC (permalink / raw)
  To: Michael Collison, GCC Patches; +Cc: nd

On 13/07/17 11:26, Michael Collison wrote:
> Updated per Richard's comments and suggestions.
> 
> Okay for trunk?

OK.  Please can you write up an entry for the release notes (wwwdocs).

R.

> 
> 2017-07-10  Michael Collison  <michael.collison@arm.com>
> 
> 	* config/arm/arm.c (arm_option_override): Deprecate
> 	use of -mstructure-size-boundary.
> 	* config/arm/arm.opt: Deprecate -mstructure-size-boundary.
> 	* doc/invoke.texi: Deprecate -mstructure-size-boundary.
> 
> -----Original Message-----
> From: Richard Earnshaw (lists) [mailto:Richard.Earnshaw@arm.com] 
> Sent: Thursday, July 6, 2017 3:17 AM
> To: Michael Collison <Michael.Collison@arm.com>; GCC Patches <gcc-patches@gcc.gnu.org>
> Cc: nd <nd@arm.com>
> Subject: Re: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations
> 
> On 06/07/17 06:46, Michael Collison wrote:
>> NetBSD/Arm requires that DEFAULT_STRUCTURE_SIZE_BOUNDARY (see config/arm/netbsd-elf.h for details). This patch disallows -mstructure-size-boundary on netbsd if the value is not equal to the DEFAULT_STRUCTURE_SIZE_BOUNDARY.
>>
>> Okay for trunk?
>>
>> 2017-07-05  Michael Collison  <michael.collison@arm.com>
>>
>> 	* config/arm/arm.c (arm_option_override): Disallow
>> 	-mstructure-size-boundary on netbsd if value is not
>> 	DEFAULT_STRUCTURE_SIZE_BOUNDARY.
>>
>>
> 
> Frankly, I'd rather we moved towards obsoleting this option entirely.
> The origins are from the days of the APCS (note, not AAPCS) when the default was 32 when most of the world expected 8.
> 
> Now that the AAPCS is widely adopted, APCS is obsolete (NetBSD uses
> ATPCS) and NetBSD (the only port not based on AAPCS these days) defaults to 8 I can't see why anybody now would be interested in using a different value.
> 
> So let's just mark this option as deprecated (emit a warning if
> 
> global_options_set.x_arm_structure_size_boundary
> 
> is ever set by the user, regardless of value).  Then in GCC 9 we can perhaps remove this code entirely.
> 
> Documentation and release notes will need corresponding updates as well.
> 
> R.
> 
>> pr1556.patch
>>
>>
>> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 
>> bc1e607..911c272 100644
>> --- a/gcc/config/arm/arm.c
>> +++ b/gcc/config/arm/arm.c
>> @@ -3471,7 +3471,18 @@ arm_option_override (void)
>>      }
>>    else
>>      {
>> -      if (arm_structure_size_boundary != 8
>> +      /* Do not allow structure size boundary to be overridden for 
>> + netbsd.  */
>> +
>> +      if ((arm_abi == ARM_ABI_ATPCS)
>> +	  && (arm_structure_size_boundary != DEFAULT_STRUCTURE_SIZE_BOUNDARY))
>> +	{
>> +	  warning (0,
>> +		   "option %<-mstructure-size-boundary%> is deprecated for netbsd; "
>> +		   "defaulting to %d",
>> +		   DEFAULT_STRUCTURE_SIZE_BOUNDARY);
>> +	  arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
>> +	}
>> +      else if (arm_structure_size_boundary != 8
>>  	  && arm_structure_size_boundary != 32
>>  	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
>>  	{
>>
> 
> 
> pr1556v2.patch
> 
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index c6101ef..b5dbfeb 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -3489,6 +3489,8 @@ arm_option_override (void)
>      }
>    else
>      {
> +      warning (0, "option %<-mstructure-size-boundary%> is deprecated");
> +
>        if (arm_structure_size_boundary != 8
>  	  && arm_structure_size_boundary != 32
>  	  && !(ARM_DOUBLEWORD_ALIGN && arm_structure_size_boundary == 64))
> diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
> index b6c707b..6060516 100644
> --- a/gcc/config/arm/arm.opt
> +++ b/gcc/config/arm/arm.opt
> @@ -192,7 +192,7 @@ Target RejectNegative Alias(mfloat-abi=, soft) Undocumented
>  
>  mstructure-size-boundary=
>  Target RejectNegative Joined UInteger Var(arm_structure_size_boundary) Init(DEFAULT_STRUCTURE_SIZE_BOUNDARY)
> -Specify the minimum bit alignment of structures.
> +Specify the minimum bit alignment of structures. (Deprecated).
>  
>  mthumb
>  Target Report RejectNegative Negative(marm) Mask(THUMB) Save
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 3e5cee8..cfe5985 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -15685,6 +15685,8 @@ incompatible.  Code compiled with one value cannot necessarily expect to
>  work with code or libraries compiled with another value, if they exchange
>  information using structures or unions.
>  
> +This option is deprecated.
> +
>  @item -mabort-on-noreturn
>  @opindex mabort-on-noreturn
>  Generate a call to the function @code{abort} at the end of a
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-21 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06  5:47 [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations Michael Collison
2017-07-06  8:56 ` Kyrill Tkachov
2017-07-06 10:16 ` Richard Earnshaw (lists)
2017-07-13 10:26   ` Michael Collison
2017-07-21 13:22     ` Richard Earnshaw (lists)

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