public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: RE: [PATCH] arm: Fix up arm_override_options_after_change_1
Date: Thu, 10 Sep 2020 14:11:25 +0000	[thread overview]
Message-ID: <DB7PR08MB3002CCFCEAF67EA360E329CC93270@DB7PR08MB3002.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20200910085100.GV18149@tucnak>

Hi Jakub,

> -----Original Message-----
> From: Jakub Jelinek <jakub@redhat.com>
> Sent: 10 September 2020 09:51
> To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>; Kyrylo Tkachov
> <Kyrylo.Tkachov@arm.com>; gcc-patches@gcc.gnu.org
> Subject: [PATCH] arm: Fix up arm_override_options_after_change_1
> 
> On Tue, Sep 08, 2020 at 10:45:12AM +0200, Jakub Jelinek via Gcc-patches
> wrote:
> > Looking further at arm_override_options_after_change_1, it also seems to
> be
> > incorrect, rather than testing
> > !opts->x_str_align_functions
> > it should be really testing
> > !opts_set->x_str_align_functions
> > and get &global_options_set or similar passed to it as additional opts_set
> > argument.  That is because otherwise the decision will be sticky, while it
> > should be done whenever use provided -falign-functions but didn't provide
> > -falign-functions= (either on the command line, or through optimize
> > attribute or pragma).
> 
> Here is a fix for that (incremental change on top of the previous patch).
> Bootstrapped/regtested on armv7hl-linux-gnueabi, ok for trunk?

This looks ok to me.
Please commit to master so we can get some wider testing before backporting.

Thanks,
Kyrill

> 
> 2020-09-10  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* config/arm/arm.c (arm_override_options_after_change_1): Add
> opts_set
> 	argument, test opts_set->x_str_align_functions rather than
> 	opts->x_str_align_functions.
> 	(arm_override_options_after_change, arm_option_override_internal,
> 	arm_set_current_function): Adjust callers.
> 
> --- gcc/config/arm/arm.c.jj	2020-09-09 09:19:42.911419411 +0200
> +++ gcc/config/arm/arm.c	2020-09-09 09:28:02.392897384 +0200
> @@ -3024,10 +3024,11 @@ static GTY(()) bool thumb_flipper;
>  static GTY(()) tree init_optimize;
> 
>  static void
> -arm_override_options_after_change_1 (struct gcc_options *opts)
> +arm_override_options_after_change_1 (struct gcc_options *opts,
> +				     struct gcc_options *opts_set)
>  {
>    /* -falign-functions without argument: supply one.  */
> -  if (opts->x_flag_align_functions && !opts->x_str_align_functions)
> +  if (opts->x_flag_align_functions && !opts_set->x_str_align_functions)
>      opts->x_str_align_functions = TARGET_THUMB_P (opts->x_target_flags)
>        && opts->x_optimize_size ? "2" : "4";
>  }
> @@ -3037,7 +3038,7 @@ arm_override_options_after_change_1 (str
>  static void
>  arm_override_options_after_change (void)
>  {
> -  arm_override_options_after_change_1 (&global_options);
> +  arm_override_options_after_change_1 (&global_options,
> &global_options_set);
>  }
> 
>  /* Implement TARGET_OPTION_SAVE.  */
> @@ -3065,7 +3066,7 @@ static void
>  arm_option_override_internal (struct gcc_options *opts,
>  			      struct gcc_options *opts_set)
>  {
> -  arm_override_options_after_change_1 (opts);
> +  arm_override_options_after_change_1 (opts, opts_set);
> 
>    if (TARGET_INTERWORK && !bitmap_bit_p (arm_active_target.isa,
> isa_bit_thumb))
>      {
> @@ -32335,7 +32336,7 @@ arm_set_current_function (tree fndecl)
> 
>    save_restore_target_globals (new_tree);
> 
> -  arm_override_options_after_change_1 (&global_options);
> +  arm_override_options_after_change_1 (&global_options,
> &global_options_set);
>  }
> 
>  /* Implement TARGET_OPTION_PRINT.  */
> 
> 
> 	Jakub


  reply	other threads:[~2020-09-10 14:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  8:45 [PATCH] arm: Fix up arm_override_options_after_change [PR96939] Jakub Jelinek
2020-09-08 22:01 ` Jeff Law
2020-09-10  8:51 ` [PATCH] arm: Fix up arm_override_options_after_change_1 Jakub Jelinek
2020-09-10 14:11   ` Kyrylo Tkachov [this message]
2020-09-10 14:58     ` Jeff Law
2020-09-10 15:01     ` Jakub Jelinek
2020-09-10 15:04       ` Kyrylo Tkachov
2020-09-11  7:46 ` [PATCH] arm: Fix up arm_override_options_after_change [PR96939] Christophe Lyon
2020-09-11  9:29   ` Jakub Jelinek
2020-09-13  8:29     ` [PATCH] options: Save and restore opts_set for Optimization and Target options Jakub Jelinek
2020-09-14  6:32       ` Richard Biener
2020-09-14  8:06         ` Christophe Lyon
2020-09-28 19:50       ` Stefan Schulze Frielinghaus
2020-09-28 19:58         ` Jakub Jelinek
2020-09-30  9:32         ` Jakub Jelinek
2020-09-30 11:21           ` Stefan Schulze Frielinghaus
2020-09-30 11:39             ` Jakub Jelinek
2020-09-30 13:24               ` Stefan Schulze Frielinghaus
2020-10-02  8:46                 ` Jakub Jelinek
2020-10-02 14:21                   ` Stefan Schulze Frielinghaus
2020-10-03  8:41                     ` Jakub Jelinek
2020-10-03 18:02                       ` Richard Biener
2020-10-04  7:13                   ` Andreas Schwab
2020-10-04 19:16                     ` Jakub Jelinek
2020-10-05  7:08                       ` Jakub Jelinek
2020-10-05  7:10                         ` Richard Biener
2020-10-06  9:28                       ` Andreas Schwab
2020-10-06 13:20                         ` [PATCH] options: Avoid unused variable mask warning [PR97305] Jakub Jelinek
2020-10-06 13:32                           ` Richard Biener

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=DB7PR08MB3002CCFCEAF67EA360E329CC93270@DB7PR08MB3002.eurprd08.prod.outlook.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).