opts: Fix up -ffold-mem-offsets option keywords

Message ID ZajU80qR8PmGe6c4@tucnak
State New
Headers
Series opts: Fix up -ffold-mem-offsets option keywords |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Jakub Jelinek Jan. 18, 2024, 7:36 a.m. UTC
  Hi!

While the option was originally meant to be a Target option for a single
target, it is an option for all targets, so should be Common rather than
Target, and because it is an optimization option which could be different
in between different LTO TUs, I've added Optimization keyword too.
From what I can see, Bool is a non-documented non-existing keyword (at
least, grep Bool *.awk shows nothing, so I've dropped that too.  Seems
that the option parsing simply parses and ignores any non-existing keywords.

Guess we should drop the Bool keywords from the gcc/config/riscv/riscv.opt
file eventually, so that people don't copy this around.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2024-01-18  Jakub Jelinek  <jakub@redhat.com>

	PR other/113399
	* common.opt (ffold-mem-offsets): Remove Target and Bool keywords, add
	Common and Optimization.


	Jakub
  

Comments

Richard Biener Jan. 18, 2024, 7:32 a.m. UTC | #1
On Thu, 18 Jan 2024, Jakub Jelinek wrote:

> Hi!
> 
> While the option was originally meant to be a Target option for a single
> target, it is an option for all targets, so should be Common rather than
> Target, and because it is an optimization option which could be different
> in between different LTO TUs, I've added Optimization keyword too.
> From what I can see, Bool is a non-documented non-existing keyword (at
> least, grep Bool *.awk shows nothing, so I've dropped that too.  Seems
> that the option parsing simply parses and ignores any non-existing keywords.
> 
> Guess we should drop the Bool keywords from the gcc/config/riscv/riscv.opt
> file eventually, so that people don't copy this around.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK

> 2024-01-18  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR other/113399
> 	* common.opt (ffold-mem-offsets): Remove Target and Bool keywords, add
> 	Common and Optimization.
> 
> --- gcc/common.opt.jj	2024-01-03 11:51:31.467732078 +0100
> +++ gcc/common.opt	2024-01-17 17:22:05.975424001 +0100
> @@ -1262,7 +1262,7 @@ Common Var(flag_cprop_registers) Optimiz
>  Perform a register copy-propagation optimization pass.
>  
>  ffold-mem-offsets
> -Target Bool Var(flag_fold_mem_offsets) Init(1)
> +Common Var(flag_fold_mem_offsets) Init(1) Optimization
>  Fold instructions calculating memory offsets to the memory access instruction if possible.
>  
>  fcrossjumping
> 
> 	Jakub
> 
>
  

Patch

--- gcc/common.opt.jj	2024-01-03 11:51:31.467732078 +0100
+++ gcc/common.opt	2024-01-17 17:22:05.975424001 +0100
@@ -1262,7 +1262,7 @@  Common Var(flag_cprop_registers) Optimiz
 Perform a register copy-propagation optimization pass.
 
 ffold-mem-offsets
-Target Bool Var(flag_fold_mem_offsets) Init(1)
+Common Var(flag_fold_mem_offsets) Init(1) Optimization
 Fold instructions calculating memory offsets to the memory access instruction if possible.
 
 fcrossjumping