Re: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL

2020-09-16 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 15, 2020 at 03:32:40PM +, Vaseeharan Vinayagamoorthy wrote:
> I am seeing this unused parameter 'opts' error when building for this 
> configuration:
> Build: arm-none-linux-gnueabihf
> Host: arm-none-linux-gnueabihf
> Target: arm-none-linux-gnueabihf
> 
> In function 'void arm_option_restore(gcc_options*, gcc_options*, 
> cl_target_option*)':
> /src/gcc/gcc/config/arm/arm.c:3042:41: error: unused parameter 'opts' 
> [-Werror=unused-parameter]
>  3042 | arm_option_restore (struct gcc_options *opts, struct gcc_options 
> *opts_set,
>   | ^~~~

Oops, sorry, don't know how this got through, fixed as obvious with the
patch below:

2020-09-16  Jakub Jelinek  

* config/arm/arm.c (arm_option_restore): Comment out opts argument
name to avoid unused parameter warnings.

--- gcc/config/arm/arm.c
+++ gcc/config/arm/arm.c
@@ -3039,8 +3039,8 @@ arm_override_options_after_change (void)
 
 /* Implement TARGET_OPTION_RESTORE.  */
 static void
-arm_option_restore (struct gcc_options *opts, struct gcc_options *opts_set,
-   struct cl_target_option *ptr)
+arm_option_restore (struct gcc_options */* opts */,
+   struct gcc_options *opts_set, struct cl_target_option *ptr)
 {
   arm_configure_build_target (_active_target, ptr, opts_set, false);
 }


Jakub



Re: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL

2020-09-15 Thread Vaseeharan Vinayagamoorthy
I am seeing this unused parameter 'opts' error when building for this 
configuration:
Build: arm-none-linux-gnueabihf
Host: arm-none-linux-gnueabihf
Target: arm-none-linux-gnueabihf

In function 'void arm_option_restore(gcc_options*, gcc_options*, 
cl_target_option*)':
/src/gcc/gcc/config/arm/arm.c:3042:41: error: unused parameter 'opts' 
[-Werror=unused-parameter]
 3042 | arm_option_restore (struct gcc_options *opts, struct gcc_options 
*opts_set,
  | ^~~~


Regards
Vasee


On 13/09/2020, 09:39, "Gcc-patches on behalf of Jakub Jelinek via Gcc-patches" 
 wrote:

Hi!

The following patch on top of the
https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553801.html
patch fixes the gcc.target/arm/lto/pr96939_* test in certain ARM
configurations.
As said in the above mentioned patch, the generic code takes care of
saving/restoring TargetVariables or Target Save options, so this just
arranges for the generic code to save those instead of needing the
arm backend to do it manually.

Bootstrapped/regtested on armv7hl-linux-gnueabi, ok for trunk?

2020-09-13  Jakub Jelinek  

* config/arm/arm.opt (x_arm_arch_string, x_arm_cpu_string,
x_arm_tune_string): Remove TargetSave entries.
(march=, mcpu=, mtune=): Add Save keyword.
* config/arm/arm.c (arm_option_save): Remove.
(TARGET_OPTION_SAVE): Don't redefine.
(arm_option_restore): Don't restore x_arm_*_string here.

--- gcc/config/arm/arm.opt.jj   2020-01-12 11:54:36.273415521 +0100
+++ gcc/config/arm/arm.opt  2020-09-12 10:45:51.239935884 +0200
@@ -21,15 +21,6 @@
 HeaderInclude
 config/arm/arm-opts.h

-TargetSave
-const char *x_arm_arch_string
-
-TargetSave
-const char *x_arm_cpu_string
-
-TargetSave
-const char *x_arm_tune_string
-
 Enum
 Name(tls_type) Type(enum arm_tls_type)
 TLS dialect to use:
@@ -82,7 +73,7 @@ mapcs-stack-check
 Target Report Mask(APCS_STACK) Undocumented

 march=
-Target RejectNegative Negative(march=) ToLower Joined Var(arm_arch_string)
+Target Save RejectNegative Negative(march=) ToLower Joined 
Var(arm_arch_string)
 Specify the name of the target architecture.

 ; Other arm_arch values are loaded from arm-tables.opt
@@ -107,7 +98,7 @@ Target Report Mask(CALLER_INTERWORKING)
 Thumb: Assume function pointers may go to non-Thumb aware code.

 mcpu=
-Target RejectNegative Negative(mcpu=) ToLower Joined Var(arm_cpu_string)
+Target Save RejectNegative Negative(mcpu=) ToLower Joined 
Var(arm_cpu_string)
 Specify the name of the target CPU.

 mfloat-abi=
@@ -232,7 +223,7 @@ Target Report Mask(TPCS_LEAF_FRAME)
 Thumb: Generate (leaf) stack frames even if not needed.

 mtune=
-Target RejectNegative Negative(mtune=) ToLower Joined Var(arm_tune_string)
+Target Save RejectNegative Negative(mtune=) ToLower Joined 
Var(arm_tune_string)
 Tune code for the given processor.

 mprint-tune-info
--- gcc/config/arm/arm.c.jj 2020-09-11 17:44:28.643014087 +0200
+++ gcc/config/arm/arm.c2020-09-12 10:48:09.951888347 +0200
@@ -247,8 +247,6 @@ static tree arm_build_builtin_va_list (v
 static void arm_expand_builtin_va_start (tree, rtx);
 static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq 
*);
 static void arm_option_override (void);
-static void arm_option_save (struct cl_target_option *, struct gcc_options 
*,
-struct gcc_options *);
 static void arm_option_restore (struct gcc_options *, struct gcc_options *,
struct cl_target_option *);
 static void arm_override_options_after_change (void);
@@ -443,9 +441,6 @@ static const struct attribute_spec arm_a
 #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
 #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE 
arm_override_options_after_change

-#undef TARGET_OPTION_SAVE
-#define TARGET_OPTION_SAVE arm_option_save
-
 #undef TARGET_OPTION_RESTORE
 #define TARGET_OPTION_RESTORE arm_option_restore

@@ -3042,24 +3037,11 @@ arm_override_options_after_change (void)
   arm_override_options_after_change_1 (_options, 
_options_set);
 }

-/* Implement TARGET_OPTION_SAVE.  */
-static void
-arm_option_save (struct cl_target_option *ptr, struct gcc_options *opts,
-struct gcc_options */* opts_set */)
-{
-  ptr->x_arm_arch_string = opts->x_arm_arch_string;
-  ptr->x_arm_cpu_string = opts->x_arm_cpu_string;
-  ptr->x_arm_tune_string = opts->x_arm_tune_string;
-}
-
 /* Implement TARGET_OPTION_RESTORE.  */
 static void
 arm_option_restore (struct gcc_options *opts, struct gcc_options *opts_set,
struct cl_target_option *ptr)
 {
-  opts->x_arm_arch_string = ptr->x_arm_arch_string;
-  opts->x_arm_cpu_string 

RE: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL

2020-09-14 Thread Kyrylo Tkachov
Hi Jakub,

> -Original Message-
> From: Jakub Jelinek 
> Sent: 13 September 2020 09:39
> To: Richard Earnshaw ; Kyrylo Tkachov
> 
> Cc: gcc-patches@gcc.gnu.org
> Subject: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL
> 
> Hi!
> 
> The following patch on top of the
> https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553801.html
> patch fixes the gcc.target/arm/lto/pr96939_* test in certain ARM
> configurations.
> As said in the above mentioned patch, the generic code takes care of
> saving/restoring TargetVariables or Target Save options, so this just
> arranges for the generic code to save those instead of needing the
> arm backend to do it manually.
> 
> Bootstrapped/regtested on armv7hl-linux-gnueabi, ok for trunk?

Ok.
Thanks,
Kyrill

> 
> 2020-09-13  Jakub Jelinek  
> 
>   * config/arm/arm.opt (x_arm_arch_string, x_arm_cpu_string,
>   x_arm_tune_string): Remove TargetSave entries.
>   (march=, mcpu=, mtune=): Add Save keyword.
>   * config/arm/arm.c (arm_option_save): Remove.
>   (TARGET_OPTION_SAVE): Don't redefine.
>   (arm_option_restore): Don't restore x_arm_*_string here.
> 
> --- gcc/config/arm/arm.opt.jj 2020-01-12 11:54:36.273415521 +0100
> +++ gcc/config/arm/arm.opt2020-09-12 10:45:51.239935884 +0200
> @@ -21,15 +21,6 @@
>  HeaderInclude
>  config/arm/arm-opts.h
> 
> -TargetSave
> -const char *x_arm_arch_string
> -
> -TargetSave
> -const char *x_arm_cpu_string
> -
> -TargetSave
> -const char *x_arm_tune_string
> -
>  Enum
>  Name(tls_type) Type(enum arm_tls_type)
>  TLS dialect to use:
> @@ -82,7 +73,7 @@ mapcs-stack-check
>  Target Report Mask(APCS_STACK) Undocumented
> 
>  march=
> -Target RejectNegative Negative(march=) ToLower Joined
> Var(arm_arch_string)
> +Target Save RejectNegative Negative(march=) ToLower Joined
> Var(arm_arch_string)
>  Specify the name of the target architecture.
> 
>  ; Other arm_arch values are loaded from arm-tables.opt
> @@ -107,7 +98,7 @@ Target Report Mask(CALLER_INTERWORKING)
>  Thumb: Assume function pointers may go to non-Thumb aware code.
> 
>  mcpu=
> -Target RejectNegative Negative(mcpu=) ToLower Joined
> Var(arm_cpu_string)
> +Target Save RejectNegative Negative(mcpu=) ToLower Joined
> Var(arm_cpu_string)
>  Specify the name of the target CPU.
> 
>  mfloat-abi=
> @@ -232,7 +223,7 @@ Target Report Mask(TPCS_LEAF_FRAME)
>  Thumb: Generate (leaf) stack frames even if not needed.
> 
>  mtune=
> -Target RejectNegative Negative(mtune=) ToLower Joined
> Var(arm_tune_string)
> +Target Save RejectNegative Negative(mtune=) ToLower Joined
> Var(arm_tune_string)
>  Tune code for the given processor.
> 
>  mprint-tune-info
> --- gcc/config/arm/arm.c.jj   2020-09-11 17:44:28.643014087 +0200
> +++ gcc/config/arm/arm.c  2020-09-12 10:48:09.951888347 +0200
> @@ -247,8 +247,6 @@ static tree arm_build_builtin_va_list (v
>  static void arm_expand_builtin_va_start (tree, rtx);
>  static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq
> *);
>  static void arm_option_override (void);
> -static void arm_option_save (struct cl_target_option *, struct gcc_options *,
> -  struct gcc_options *);
>  static void arm_option_restore (struct gcc_options *, struct gcc_options *,
>   struct cl_target_option *);
>  static void arm_override_options_after_change (void);
> @@ -443,9 +441,6 @@ static const struct attribute_spec arm_a
>  #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
>  #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
> arm_override_options_after_change
> 
> -#undef TARGET_OPTION_SAVE
> -#define TARGET_OPTION_SAVE arm_option_save
> -
>  #undef TARGET_OPTION_RESTORE
>  #define TARGET_OPTION_RESTORE arm_option_restore
> 
> @@ -3042,24 +3037,11 @@ arm_override_options_after_change (void)
>arm_override_options_after_change_1 (_options,
> _options_set);
>  }
> 
> -/* Implement TARGET_OPTION_SAVE.  */
> -static void
> -arm_option_save (struct cl_target_option *ptr, struct gcc_options *opts,
> -  struct gcc_options */* opts_set */)
> -{
> -  ptr->x_arm_arch_string = opts->x_arm_arch_string;
> -  ptr->x_arm_cpu_string = opts->x_arm_cpu_string;
> -  ptr->x_arm_tune_string = opts->x_arm_tune_string;
> -}
> -
>  /* Implement TARGET_OPTION_RESTORE.  */
>  static void
>  arm_option_restore (struct gcc_options *opts, struct gcc_options *opts_set,
>   struct cl_target_option *ptr)
>  {
> -  opts->x_arm_arch_string = ptr->x_arm_arch_string;
> -  opts->x_arm_cpu_string = ptr->x_arm_cpu_string;
> -  opts->x_arm_tune_string = ptr->x_arm_tune_string;
>arm_configure_build_target (_active_target, ptr, opts_set, false);
>  }
> 
> 
> 
>   Jakub