public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL
@ 2020-09-13  8:38 Jakub Jelinek
  2020-09-14  8:47 ` Kyrylo Tkachov
  2020-09-15 15:32 ` Vaseeharan Vinayagamoorthy
  0 siblings, 2 replies; 4+ messages in thread
From: Jakub Jelinek @ 2020-09-13  8:38 UTC (permalink / raw)
  To: Richard Earnshaw, Kyrylo Tkachov; +Cc: gcc-patches

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  <jakub@redhat.com>

	* 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.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 (&global_options, &global_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 (&arm_active_target, ptr, opts_set, false);
 }
 


	Jakub


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

* RE: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL
  2020-09-13  8:38 [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL Jakub Jelinek
@ 2020-09-14  8:47 ` Kyrylo Tkachov
  2020-09-15 15:32 ` Vaseeharan Vinayagamoorthy
  1 sibling, 0 replies; 4+ messages in thread
From: Kyrylo Tkachov @ 2020-09-14  8:47 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Earnshaw; +Cc: gcc-patches

Hi Jakub,

> -----Original Message-----
> From: Jakub Jelinek <jakub@redhat.com>
> Sent: 13 September 2020 09:39
> To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>; Kyrylo Tkachov
> <Kyrylo.Tkachov@arm.com>
> 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  <jakub@redhat.com>
> 
> 	* 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.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 (&global_options,
> &global_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 (&arm_active_target, ptr, opts_set, false);
>  }
> 
> 
> 
> 	Jakub


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

* Re: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL
  2020-09-13  8:38 [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL Jakub Jelinek
  2020-09-14  8:47 ` Kyrylo Tkachov
@ 2020-09-15 15:32 ` Vaseeharan Vinayagamoorthy
  2020-09-16  8:17   ` Jakub Jelinek
  1 sibling, 1 reply; 4+ messages in thread
From: Vaseeharan Vinayagamoorthy @ 2020-09-15 15:32 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Earnshaw, Kyrylo Tkachov; +Cc: gcc-patches

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" <gcc-patches-bounces@gcc.gnu.org on behalf of gcc-patches@gcc.gnu.org> 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  <jakub@redhat.com>

    	* 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.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 (&global_options, &global_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 (&arm_active_target, ptr, opts_set, false);
     }



    	Jakub



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

* Re: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL
  2020-09-15 15:32 ` Vaseeharan Vinayagamoorthy
@ 2020-09-16  8:17   ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2020-09-16  8:17 UTC (permalink / raw)
  To: Vaseeharan Vinayagamoorthy; +Cc: Richard Earnshaw, Kyrylo Tkachov, gcc-patches

On Tue, Sep 15, 2020 at 03:32:40PM +0000, 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  <jakub@redhat.com>

	* 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 (&arm_active_target, ptr, opts_set, false);
 }


	Jakub


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

end of thread, other threads:[~2020-09-16  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-13  8:38 [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL Jakub Jelinek
2020-09-14  8:47 ` Kyrylo Tkachov
2020-09-15 15:32 ` Vaseeharan Vinayagamoorthy
2020-09-16  8:17   ` Jakub Jelinek

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