Updated per Richard's comments and suggestions.

Okay for trunk?

2017-07-10  Michael Collison  <michael.colli...@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.earns...@arm.com] 
Sent: Thursday, July 6, 2017 3:17 AM
To: Michael Collison <michael.colli...@arm.com>; GCC Patches 
<gcc-patches@gcc.gnu.org>
Cc: nd <n...@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.colli...@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: pr1556v2.patch
Description: pr1556v2.patch

Reply via email to