public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add tabulars for options with enum values.
@ 2017-02-28 13:15 Martin Liška
  2017-02-28 13:16 ` [PATCH 2/3] Introduce =<number> for couple of options Martin Liška
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Martin Liška @ 2017-02-28 13:15 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 2789 bytes --]

Hello.

We have various enum options that do not properly display options with --help=*:
Apart from that, some of them are not separated by tabular, but with a space.

Using the suggested patch, --help=common will get:

--- /tmp/before	2017-02-28 10:41:12.107024945 +0100
+++ /tmp/after	2017-02-28 10:41:32.615415978 +0100
@@ -193,7 +193,7 @@
   -ffloat-store               		[disabled]
   -fforce-addr                		
   -fforward-propagate         		[disabled]
-  -ffp-contract=              		fast
+  -ffp-contract=[off|on|fast] 		fast
   -ffp-int-builtin-inexact    		[enabled]
   -ffunction-cse              		[enabled]
   -ffunction-sections         		[disabled]
@@ -242,10 +242,10 @@
   -fipa-sra                   		[disabled]
   -fipa-struct-reorg          		
   -fipa-vrp                   		[disabled]
-  -fira-algorithm=            		CB
+  -fira-algorithm=[CB|priority] 	CB
   -fira-hoist-pressure        		[enabled]
   -fira-loop-pressure         		[disabled]
-  -fira-region=               		[default]
+  -fira-region=[one|all|mixed] 		[default]
   -fira-share-save-slots      		[enabled]
   -fira-share-spill-slots     		[enabled]
   -fira-verbose=<number>      		0x5
@@ -336,7 +336,7 @@
   -fregmove                   		
   -frename-registers          		[enabled]
   -freorder-blocks            		[disabled]
-  -freorder-blocks-algorithm= 		simple
+  -freorder-blocks-algorithm=[simple|stc] 	simple
   -freorder-blocks-and-partition 	[disabled]
   -freorder-functions         		[disabled]
   -freport-bug                		[disabled]
@@ -386,7 +386,7 @@
   -fshrink-wrap-separate      		[enabled]
   -fsignaling-nans            		[disabled]
   -fsigned-zeros              		[enabled]
-  -fsimd-cost-model=          		unlimited
+  -fsimd-cost-model=[unlimited|dynamic|cheap] 	unlimited
   -fsingle-precision-constant 		[disabled]
   -fsplit-ivs-in-unroller     		[enabled]
   -fsplit-loops               		[disabled]
@@ -404,7 +404,7 @@
   -fstack-protector-all       		[disabled]
   -fstack-protector-explicit  		[disabled]
   -fstack-protector-strong    		[disabled]
-  -fstack-reuse=              		all
+  -fstack-reuse=[all|named_vars|none] 	all
   -fstack-usage               		[disabled]
   -fstdarg-opt                		[enabled]
   -fstore-merging             		[disabled]
@@ -489,7 +489,7 @@
   -fvar-tracking-uninit       		[disabled]
   -fvariable-expansion-in-unroller 	[disabled]
   -fvect-cost-model           		
-  -fvect-cost-model=          		[default]
+  Specifies the cost model for vectorization. -fvect-cost-model=[unlimited|dynamic|cheap] 	[default]
   -fverbose-asm               		[disabled]
   -fversion                   		
   -fvisibility=[default|internal|hidden|protected] 	default

Ready to be installed after regression tests?
Thanks,
Martin

[-- Attachment #2: 0001-Add-tabulars-for-options-with-enum-values.patch --]
[-- Type: text/x-patch, Size: 4425 bytes --]

From 13f710c2487fbd74d6b8a01dab7d33b9e0614727 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Sun, 26 Feb 2017 23:00:02 +0100
Subject: [PATCH 1/3] Add tabulars for options with enum values.

gcc/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	* common.opt: Fix --help=option -Q for options which are of
	an enum type.

gcc/c-family/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	* c.opt: Fix --help=option -Q for options which are of
	an enum type.
---
 gcc/c-family/c.opt |  2 +-
 gcc/common.opt     | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index a863471da7f..9b9aab44810 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -293,7 +293,7 @@ Warn about 'new' of type with extended alignment without -faligned-new.
 
 Waligned-new=
 C++ ObjC++ Var(warn_aligned_new) Enum(warn_aligned_new_level) Joined RejectNegative Warning LangEnabledBy(C++ ObjC++,Wall,1,0)
--Waligned-new=all Warn even if 'new' uses a class member allocation function.
+-Waligned-new=[none|global|all]	Warn even if 'new' uses a class member allocation function.
 
 Wall
 C ObjC C++ ObjC++ Warning
diff --git a/gcc/common.opt b/gcc/common.opt
index e5ae364abd9..1a19847fe44 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1376,7 +1376,7 @@ Perform a forward propagation pass on RTL.
 
 ffp-contract=
 Common Joined RejectNegative Enum(fp_contract_mode) Var(flag_fp_contract_mode) Init(FP_CONTRACT_FAST) Optimization
--ffp-contract=[off|on|fast] Perform floating-point expression contraction.
+-ffp-contract=[off|on|fast]	Perform floating-point expression contraction.
 
 Enum
 Name(fp_contract_mode) Type(enum fp_contract_mode) UnknownError(unknown floating point contraction style %qs)
@@ -1528,7 +1528,7 @@ Perform conversion of conditional jumps to conditional execution.
 
 fstack-reuse=
 Common Joined RejectNegative Enum(stack_reuse_level) Var(flag_stack_reuse) Init(SR_ALL) Optimization
--fstack-reuse=[all|named_vars|none] Set stack reuse level for local variables.
+-fstack-reuse=[all|named_vars|none]	Set stack reuse level for local variables.
 
 Enum
 Name(stack_reuse_level) Type(enum stack_reuse_level) UnknownError(unknown Stack Reuse Level %qs)
@@ -1661,7 +1661,7 @@ Perform IPA Value Range Propagation.
 
 fira-algorithm=
 Common Joined RejectNegative Enum(ira_algorithm) Var(flag_ira_algorithm) Init(IRA_ALGORITHM_CB) Optimization
--fira-algorithm=[CB|priority] Set the used IRA algorithm.
+-fira-algorithm=[CB|priority]	Set the used IRA algorithm.
 
 Enum
 Name(ira_algorithm) Type(enum ira_algorithm) UnknownError(unknown IRA algorithm %qs)
@@ -1674,7 +1674,7 @@ Enum(ira_algorithm) String(priority) Value(IRA_ALGORITHM_PRIORITY)
 
 fira-region=
 Common Joined RejectNegative Enum(ira_region) Var(flag_ira_region) Init(IRA_REGION_AUTODETECT) Optimization
--fira-region=[one|all|mixed] Set regions for IRA.
+-fira-region=[one|all|mixed]	Set regions for IRA.
 
 Enum
 Name(ira_region) Type(enum ira_region) UnknownError(unknown IRA region %qs)
@@ -2073,7 +2073,7 @@ Reorder basic blocks to improve code placement.
 
 freorder-blocks-algorithm=
 Common Joined RejectNegative Enum(reorder_blocks_algorithm) Var(flag_reorder_blocks_algorithm) Init(REORDER_BLOCKS_ALGORITHM_SIMPLE) Optimization
--freorder-blocks-algorithm=[simple|stc] Set the used basic block reordering algorithm.
+-freorder-blocks-algorithm=[simple|stc]	Set the used basic block reordering algorithm.
 
 Enum
 Name(reorder_blocks_algorithm) Type(enum reorder_blocks_algorithm) UnknownError(unknown basic block reordering algorithm %qs)
@@ -2691,10 +2691,11 @@ Enable basic block vectorization (SLP) on trees.
 fvect-cost-model=
 Common Joined RejectNegative Enum(vect_cost_model) Var(flag_vect_cost_model) Init(VECT_COST_MODEL_DEFAULT) Optimization
 Specifies the cost model for vectorization.
+-fvect-cost-model=[unlimited|dynamic|cheap]	Specifies the cost model for vectorization.
 
 fsimd-cost-model=
 Common Joined RejectNegative Enum(vect_cost_model) Var(flag_simd_cost_model) Init(VECT_COST_MODEL_UNLIMITED) Optimization
-Specifies the vectorization cost model for code marked with a simd directive.
+-fsimd-cost-model=[unlimited|dynamic|cheap]	Specifies the vectorization cost model for code marked with a simd directive.
 
 Enum
 Name(vect_cost_model) Type(enum vect_cost_model) UnknownError(unknown vectorizer cost model %qs)
-- 
2.11.1


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

* [PATCH 2/3] Introduce =<number> for couple of options.
  2017-02-28 13:15 [PATCH] Add tabulars for options with enum values Martin Liška
@ 2017-02-28 13:16 ` Martin Liška
  2017-02-28 18:47   ` Joseph Myers
  2017-02-28 13:25 ` [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659) Martin Liška
  2017-02-28 18:22 ` [PATCH] Add tabulars for options with enum values Joseph Myers
  2 siblings, 1 reply; 10+ messages in thread
From: Martin Liška @ 2017-02-28 13:16 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

Hello.

This is second patch, where I add '=<number>' for some of options.

Thanks,
Martin

[-- Attachment #2: 0002-Introduce-number-for-couple-of-options.patch --]
[-- Type: text/x-patch, Size: 3794 bytes --]

From add261f1fdf40b90d1a74dd7183923123943ba5e Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 27 Feb 2017 15:27:54 +0100
Subject: [PATCH 2/3] Introduce =<number> for couple of options.

gcc/c-family/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	* c.opt: Replace space with tabular for options of <number>
	type.

gcc/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	* common.opt: Replace space with tabular for options of <number>
	type.
	* config/i386/i386.opt: Show <number> value for
	-mlarge-data-threshold.
	* opts.c (print_filtered_help): Do not display number in hexadecimal
	format.
---
 gcc/c-family/c.opt       | 4 ++--
 gcc/common.opt           | 6 +++---
 gcc/config/i386/i386.opt | 2 +-
 gcc/opts.c               | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 9b9aab44810..cf459ab4427 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -314,7 +314,7 @@ C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning
 
 Walloca-larger-than=
 C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined RejectNegative UInteger
--Walloca-larger-than=<number> Warn on unbounded uses of
+-Walloca-larger-than=<number>	Warn on unbounded uses of
 alloca, and on bounded uses of alloca whose bound can be larger than
 <number> bytes.
 
@@ -1097,7 +1097,7 @@ Warn if a variable length array is used.
 
 Wvla-larger-than=
 C ObjC C++ ObjC++ Var(warn_vla_limit) Warning Joined RejectNegative UInteger
--Wvla-larger-than=<number> Warn on unbounded uses of variable-length arrays, and
+-Wvla-larger-than=<number>	Warn on unbounded uses of variable-length arrays, and
 on bounded uses of variable-length arrays whose bound can be
 larger than <number> bytes.
 
diff --git a/gcc/common.opt b/gcc/common.opt
index 1a19847fe44..4021622cf5c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -689,8 +689,8 @@ Common Var(warn_stack_protect) Warning
 Warn when not issuing stack smashing protection for some reason.
 
 Wstack-usage=
-Common Joined RejectNegative UInteger Var(warn_stack_usage) Init(-1) Warning
-Warn if stack usage might be larger than specified amount.
+Common Joined RejectNegative UInteger Var(warn_stack_usage) Warning
+-Wstack-usage=<number>	Warn if stack usage might be larger than specified amount.
 
 Wstrict-aliasing
 Common Warning
@@ -2523,7 +2523,7 @@ Enable loop optimizations on tree level.
 
 ftree-parallelize-loops=
 Common Report Joined RejectNegative UInteger Var(flag_tree_parallelize_loops) Init(1) Optimization
-Enable automatic parallelization of loops.
+-ftree-parallelize-loops=<number>	Enable automatic parallelization of loops.
 
 ftree-phiprop
 Common Report Var(flag_tree_phiprop) Init(1) Optimization
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 36251abfeb5..9384e29b1de 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -272,7 +272,7 @@ Branches are this expensive (1-5, arbitrary units).
 
 mlarge-data-threshold=
 Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(DEFAULT_LARGE_SECTION_THRESHOLD)
-Data greater than given threshold will go into .ldata section in x86-64 medium model.
+-mlarge-data-threshold=<number>	Data greater than given threshold will go into .ldata section in x86-64 medium model.
 
 mcmodel=
 Target RejectNegative Joined Enum(cmodel) Var(ix86_cmodel) Init(CM_32)
diff --git a/gcc/opts.c b/gcc/opts.c
index c4768603ec9..8274fab6661 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1246,7 +1246,7 @@ print_filtered_help (unsigned int include_flags,
 		    }
 		  else
 		    sprintf (new_help + strlen (new_help),
-			     "%#x", * (int *) flag_var);
+			     "%d", * (int *) flag_var);
 		}
 	      else
 		strcat (new_help, option_enabled (i, opts)
-- 
2.11.1


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

* [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659).
  2017-02-28 13:15 [PATCH] Add tabulars for options with enum values Martin Liška
  2017-02-28 13:16 ` [PATCH 2/3] Introduce =<number> for couple of options Martin Liška
@ 2017-02-28 13:25 ` Martin Liška
  2017-03-15  9:58   ` Martin Liška
  2017-02-28 18:22 ` [PATCH] Add tabulars for options with enum values Joseph Myers
  2 siblings, 1 reply; 10+ messages in thread
From: Martin Liška @ 2017-02-28 13:25 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jan Hubicka

Hi.

Last patch from the mini-series fixes the PR mentioned in subject. I'm not sure whether it's stage4 material,
or should I postpone it to next stage1?

Thanks for review.
Martin

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

* Re: [PATCH] Add tabulars for options with enum values.
  2017-02-28 13:15 [PATCH] Add tabulars for options with enum values Martin Liška
  2017-02-28 13:16 ` [PATCH 2/3] Introduce =<number> for couple of options Martin Liška
  2017-02-28 13:25 ` [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659) Martin Liška
@ 2017-02-28 18:22 ` Joseph Myers
  2 siblings, 0 replies; 10+ messages in thread
From: Joseph Myers @ 2017-02-28 18:22 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

On Tue, 28 Feb 2017, Martin Liška wrote:

> Ready to be installed after regression tests?

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 2/3] Introduce =<number> for couple of options.
  2017-02-28 13:16 ` [PATCH 2/3] Introduce =<number> for couple of options Martin Liška
@ 2017-02-28 18:47   ` Joseph Myers
  0 siblings, 0 replies; 10+ messages in thread
From: Joseph Myers @ 2017-02-28 18:47 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

On Tue, 28 Feb 2017, Martin Liška wrote:

> Hello.
> 
> This is second patch, where I add '=<number>' for some of options.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659).
  2017-02-28 13:25 ` [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659) Martin Liška
@ 2017-03-15  9:58   ` Martin Liška
  2017-06-28  4:52     ` Jeff Law
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Liška @ 2017-03-15  9:58 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 43 bytes --]

Huh, I forgot to attach the patch.

Martin

[-- Attachment #2: 0001-Introduce-IntegerRange-for-options-PR-driver-79659.patch --]
[-- Type: text/x-patch, Size: 12336 bytes --]

From bb89456e6cecfa9497cf8e265d2083e762d5bc3e Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 27 Feb 2017 14:07:03 +0100
Subject: [PATCH] Introduce IntegerRange for options (PR driver/79659).

gcc/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	PR driver/79659
	* common.opt: Add IntegerRange to various options.
	* opt-functions.awk (integer_range_info): New function.
	* optc-gen.awk: Add integer_range_info to cl_options struct.
	* opts-common.c (decode_cmdline_option): Handle
	CL_ERR_INT_RANGE_ARG.
	(cmdline_handle_error): Likewise.
	* opts.c (print_filtered_help): Show valid interval in
	when --help is provided.
	* opts.h (struct cl_option): Add range_min and range_max fields.
	* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.

gcc/c-family/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	PR driver/79659
	* c.opt: Add IntegerRange to various options.

gcc/testsuite/ChangeLog:

2017-02-28  Martin Liska  <mliska@suse.cz>

	PR driver/79659
	* g++.dg/opt/pr79659.C: New test.
---
 gcc/c-family/c.opt                 | 20 ++++++++++----------
 gcc/common.opt                     |  8 ++++----
 gcc/config/i386/i386.opt           |  4 ++--
 gcc/opt-functions.awk              | 11 +++++++++++
 gcc/optc-gen.awk                   |  4 ++--
 gcc/opts-common.c                  | 12 ++++++++++++
 gcc/opts.c                         |  9 +++++++++
 gcc/opts.h                         |  9 +++++++--
 gcc/testsuite/g++.dg/opt/pr79659.C |  5 +++++
 9 files changed, 62 insertions(+), 20 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/opt/pr79659.C

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index cf459ab4427..d071c180bd1 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -529,7 +529,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O
 Warn about format strings that are not literals.
 
 Wformat-overflow
-C ObjC C++ LTO ObjC++ Warning Alias(Wformat-overflow=, 1, 0)
+C ObjC C++ LTO ObjC++ Warning Alias(Wformat-overflow=, 1, 0) IntegerRange(0, 2)
 Warn about function calls with format strings that write past the end
 of the destination region.  Same as -Wformat-overflow=1.
 
@@ -555,16 +555,16 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
 Warn about zero-length formats.
 
 Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
 Warn about printf/scanf/strftime/strfmon format string anomalies.
 
 Wformat-overflow=
-C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_overflow) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
+C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_overflow) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2)
 Warn about function calls with format strings that write past the end
 of the destination region.
 
 Wformat-truncation=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format_trunc) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format_trunc) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2)
 Warn about calls to snprintf and similar functions that truncate output.
 
 Wignored-qualifiers
@@ -712,7 +712,7 @@ Warn about buffer overflow in string manipulation functions like memcpy
 and strcpy.
 
 Wstringop-overflow=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow) Init(2) Warning
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow) Init(2) Warning IntegerRange(0, 4)
 Under the control of Object Size type, warn about buffer overflow in string
 manipulation functions like memcpy and strcpy.
 
@@ -908,7 +908,7 @@ C++ Warning Alias(Wplacement-new=, 1, 0)
 Warn for placement new expressions with undefined behavior.
 
 Wplacement-new=
-C++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning
+C++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning IntegerRange(0, 2)
 Warn for placement new expressions with undefined behavior.
 
 Wredundant-decls
@@ -948,7 +948,7 @@ C ObjC C++ ObjC++ Warning Alias(Wshift-overflow=, 1, 0)
 Warn if left shift of a signed value overflows.
 
 Wshift-overflow=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_shift_overflow) Init(-1) Warning
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_shift_overflow) Init(-1) Warning IntegerRange(0, 2)
 Warn if left shift of a signed value overflows.
 
 Wshift-count-negative
@@ -988,11 +988,11 @@ C ObjC Var(warn_strict_prototypes) Warning
 Warn about unprototyped function declarations.
 
 Wstrict-aliasing=
-C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0)
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0) IntegerRange(0, 3)
 ;
 
 Wstrict-overflow=
-C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 5)
 ;
 
 Wstrict-selector-match
@@ -1080,7 +1080,7 @@ C ObjC C++ ObjC++ Warning Alias(Wunused-const-variable=, 2, 0)
 Warn when a const variable is unused.
 
 Wunused-const-variable=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0) IntegerRange(0, 2)
 Warn when a const variable is unused.
 
 Wvariadic-macros
diff --git a/gcc/common.opt b/gcc/common.opt
index 4021622cf5c..6c7be565e8c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -546,7 +546,7 @@ Common Var(warn_array_bounds) Warning
 Warn if an array is accessed out of bounds.
 
 Warray-bounds=
-Common Joined RejectNegative UInteger Var(warn_array_bounds) Warning
+Common Joined RejectNegative UInteger Var(warn_array_bounds) Warning IntegerRange(0, 2)
 Warn if an array is accessed out of bounds.
 
 Wattributes
@@ -601,7 +601,7 @@ Wimplicit-fallthrough
 Common Alias(Wimplicit-fallthrough=,3,0) Warning
 
 Wimplicit-fallthrough=
-Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning
+Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning IntegerRange(0, 5)
 Warn when a switch case falls through.
 
 Winline
@@ -1774,7 +1774,7 @@ Specify the algorithm to partition symbols and vars at linktime.
 
 ; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
 flto-compression-level=
-Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1)
+Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1) IntegerRange(0, 9)
 -flto-compression-level=<number>	Use zlib compression level <number> for IL.
 
 flto-odr-type-merging
@@ -2053,7 +2053,7 @@ Tell DSE that the storage for a C++ object is dead when the constructor
 starts and when the destructor finishes.
 
 flifetime-dse=
-Common Joined RejectNegative UInteger Var(flag_lifetime_dse) Optimization
+Common Joined RejectNegative UInteger Var(flag_lifetime_dse) Optimization IntegerRange(0, 2)
 
 flive-range-shrinkage
 Common Report Var(flag_live_range_shrinkage) Init(0) Optimization
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 9384e29b1de..ef16cdefa5e 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -267,8 +267,8 @@ EnumValue
 Enum(asm_dialect) String(att) Value(ASM_ATT)
 
 mbranch-cost=
-Target RejectNegative Joined UInteger Var(ix86_branch_cost)
-Branches are this expensive (1-5, arbitrary units).
+Target RejectNegative Joined UInteger Var(ix86_branch_cost) IntegerRange(1, 5)
+Branches are this expensive (arbitrary units).
 
 mlarge-data-threshold=
 Target RejectNegative Joined UInteger Var(ix86_section_threshold) Init(DEFAULT_LARGE_SECTION_THRESHOLD)
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index 0736a6f3faf..90b263223b4 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -314,6 +314,17 @@ function search_var_name(name, opt_numbers, opts, flags, n_opts)
     return ""
 }
 
+function integer_range_info(range_option)
+{
+    if (range_option != "") {
+	start = nth_arg(0, range_option);
+	end = nth_arg(1, range_option);
+	return start ", " end
+    }
+    else
+        return "-1, -1"
+}
+
 # Handle LangEnabledBy(ENABLED_BY_LANGS, ENABLEDBY_NAME, ENABLEDBY_POSARG,
 # ENABLEDBY_NEGARG). This function does not return anything.
 function lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enabledby_negarg)
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 3b9126ccf97..5b9e12c03a1 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -399,8 +399,8 @@ for (i = 0; i < n_opts; i++) {
 		printf("    %s,\n" \
 		       "    0, %s,\n",
 		       cl_flags, cl_bit_fields)
-	printf("    %s, %s }%s\n", var_ref(opts[i], flags[i]),
-	       var_set(flags[i]), comma)
+	printf("    %s, %s, %s }%s\n", var_ref(opts[i], flags[i]),
+	       var_set(flags[i]), integer_range_info(opt_args("IntegerRange", flags[i])), comma)
 }
 
 print "};"
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index f2f7385a4c7..0cab42a021c 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -661,6 +661,11 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
       value = integral_argument (arg);
       if (value == -1)
 	errors |= CL_ERR_UINT_ARG;
+
+      /* Reject value out of a range.  */
+      if (option->range_max != -1
+	  && (value < option->range_min || value > option->range_max))
+	errors |= CL_ERR_INT_RANGE_ARG;
     }
 
   /* If the switch takes an enumerated argument, convert it.  */
@@ -1137,6 +1142,13 @@ cmdline_handle_error (location_t loc, const struct cl_option *option,
       return true;
     }
 
+  if (errors & CL_ERR_INT_RANGE_ARG)
+    {
+      error_at (loc, "argument to %qs is not between %d and %d",
+		option->opt_text, option->range_min, option->range_max);
+      return true;
+    }
+
   if (errors & CL_ERR_ENUM_ARG)
     {
       const struct cl_enum *e = &cl_enums[option->var_enum];
diff --git a/gcc/opts.c b/gcc/opts.c
index 8274fab6661..aac099ad8b0 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1256,6 +1256,15 @@ print_filtered_help (unsigned int include_flags,
 	  help = new_help;
 	}
 
+      if (option->range_max != -1)
+	{
+	  char b[128];
+	  snprintf (b, sizeof (b), "<%d,%d>", option->range_min,
+		    option->range_max);
+	  opt = concat (opt, b, NULL);
+	  len += strlen (b);
+	}
+
       wrap_help (help, opt, len, columns);
       displayed = true;
 
diff --git a/gcc/opts.h b/gcc/opts.h
index eb626aa90ec..38a390bbebb 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -110,6 +110,10 @@ struct cl_option
   enum cl_var_type var_type;
   /* Value or bit-mask with which to set a field.  */
   HOST_WIDE_INT var_value;
+  /* Range info minimum, or -1.  */
+  int range_min;
+  /* Range info maximum, or -1.  */
+  int range_max;
 };
 
 /* Records that the state of an option consists of SIZE bytes starting
@@ -200,8 +204,9 @@ extern const unsigned int cl_enums_count;
 #define CL_ERR_MISSING_ARG	(1 << 1) /* Argument required but missing.  */
 #define CL_ERR_WRONG_LANG	(1 << 2) /* Option for wrong language.  */
 #define CL_ERR_UINT_ARG		(1 << 3) /* Bad unsigned integer argument.  */
-#define CL_ERR_ENUM_ARG		(1 << 4) /* Bad enumerated argument.  */
-#define CL_ERR_NEGATIVE		(1 << 5) /* Negative form of option
+#define CL_ERR_INT_RANGE_ARG	(1 << 4) /* Bad unsigned integer argument.  */
+#define CL_ERR_ENUM_ARG		(1 << 5) /* Bad enumerated argument.  */
+#define CL_ERR_NEGATIVE		(1 << 6) /* Negative form of option
 					    not permitted (together
 					    with OPT_SPECIAL_unknown).  */
 
diff --git a/gcc/testsuite/g++.dg/opt/pr79659.C b/gcc/testsuite/g++.dg/opt/pr79659.C
new file mode 100644
index 00000000000..132d5c1e7f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr79659.C
@@ -0,0 +1,5 @@
+// PR target/79659
+// { dg-do compile }
+// { dg-options "-flifetime-dse=123456" }
+
+// { dg-error "is not between 0 and 2" "" { target *-*-* } 0 }
-- 
2.11.1


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

* Re: [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659).
  2017-03-15  9:58   ` Martin Liška
@ 2017-06-28  4:52     ` Jeff Law
  2017-06-28 12:43       ` Martin Liška
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Law @ 2017-06-28  4:52 UTC (permalink / raw)
  To: Martin Liška, GCC Patches; +Cc: Jan Hubicka

On 03/15/2017 03:58 AM, Martin Liška wrote:
> Huh, I forgot to attach the patch.
> 
> Martin
> 
> 0001-Introduce-IntegerRange-for-options-PR-driver-79659.patch
> 
> 
> From bb89456e6cecfa9497cf8e265d2083e762d5bc3e Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Mon, 27 Feb 2017 14:07:03 +0100
> Subject: [PATCH] Introduce IntegerRange for options (PR driver/79659).
> 
> gcc/ChangeLog:
> 
> 2017-02-28  Martin Liska  <mliska@suse.cz>
> 
> 	PR driver/79659
> 	* common.opt: Add IntegerRange to various options.
> 	* opt-functions.awk (integer_range_info): New function.
> 	* optc-gen.awk: Add integer_range_info to cl_options struct.
> 	* opts-common.c (decode_cmdline_option): Handle
> 	CL_ERR_INT_RANGE_ARG.
> 	(cmdline_handle_error): Likewise.
> 	* opts.c (print_filtered_help): Show valid interval in
> 	when --help is provided.
> 	* opts.h (struct cl_option): Add range_min and range_max fields.
> 	* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.
> 
> gcc/c-family/ChangeLog:
> 
> 2017-02-28  Martin Liska  <mliska@suse.cz>
> 
> 	PR driver/79659
> 	* c.opt: Add IntegerRange to various options.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-02-28  Martin Liska  <mliska@suse.cz>
> 
> 	PR driver/79659
> 	* g++.dg/opt/pr79659.C: New test.
Presumably this never fully moved forward because it wasn't a regression?

This looks quite reasonable to me.  I'm not sure of the state of the
prereqs and you may want/need to add IntegerRange checks on newly added
options since this was first submitted.

If the prereqs are ack'd, then as far as I'm concerned this is good to
go and you're free to add any new IntegerRange checks you deem
necessary/desirable.

jeff

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

* Re: [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659).
  2017-06-28  4:52     ` Jeff Law
@ 2017-06-28 12:43       ` Martin Liška
  2017-06-28 20:15         ` Rainer Orth
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Liška @ 2017-06-28 12:43 UTC (permalink / raw)
  To: Jeff Law, GCC Patches; +Cc: Jan Hubicka

On 06/28/2017 06:52 AM, Jeff Law wrote:
> On 03/15/2017 03:58 AM, Martin Liška wrote:
>> Huh, I forgot to attach the patch.
>>
>> Martin
>>
>> 0001-Introduce-IntegerRange-for-options-PR-driver-79659.patch
>>
>>
>> From bb89456e6cecfa9497cf8e265d2083e762d5bc3e Mon Sep 17 00:00:00 2001
>> From: marxin <mliska@suse.cz>
>> Date: Mon, 27 Feb 2017 14:07:03 +0100
>> Subject: [PATCH] Introduce IntegerRange for options (PR driver/79659).
>>
>> gcc/ChangeLog:
>>
>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>
>> 	PR driver/79659
>> 	* common.opt: Add IntegerRange to various options.
>> 	* opt-functions.awk (integer_range_info): New function.
>> 	* optc-gen.awk: Add integer_range_info to cl_options struct.
>> 	* opts-common.c (decode_cmdline_option): Handle
>> 	CL_ERR_INT_RANGE_ARG.
>> 	(cmdline_handle_error): Likewise.
>> 	* opts.c (print_filtered_help): Show valid interval in
>> 	when --help is provided.
>> 	* opts.h (struct cl_option): Add range_min and range_max fields.
>> 	* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.
>>
>> gcc/c-family/ChangeLog:
>>
>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>
>> 	PR driver/79659
>> 	* c.opt: Add IntegerRange to various options.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>
>> 	PR driver/79659
>> 	* g++.dg/opt/pr79659.C: New test.
> Presumably this never fully moved forward because it wasn't a regression?
> 
> This looks quite reasonable to me.  I'm not sure of the state of the
> prereqs and you may want/need to add IntegerRange checks on newly added
> options since this was first submitted.
> 
> If the prereqs are ack'd, then as far as I'm concerned this is good to
> go and you're free to add any new IntegerRange checks you deem
> necessary/desirable.
> 
> jeff
> 

Thank you Jeff for looking at the patch. I've just re-tested the patch and
I'm going to install it.

Martin

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

* Re: [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659).
  2017-06-28 12:43       ` Martin Liška
@ 2017-06-28 20:15         ` Rainer Orth
  2017-06-29  9:00           ` [PATCH][OBVIOUS] Fix -mbranch-cost range Martin Liška
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2017-06-28 20:15 UTC (permalink / raw)
  To: Martin Liška; +Cc: Jeff Law, GCC Patches, Jan Hubicka

Hi Martin,

> On 06/28/2017 06:52 AM, Jeff Law wrote:
>> On 03/15/2017 03:58 AM, Martin Liška wrote:
>>> Huh, I forgot to attach the patch.
>>>
>>> Martin
>>>
>>> 0001-Introduce-IntegerRange-for-options-PR-driver-79659.patch
>>>
>>>
>>> From bb89456e6cecfa9497cf8e265d2083e762d5bc3e Mon Sep 17 00:00:00 2001
>>> From: marxin <mliska@suse.cz>
>>> Date: Mon, 27 Feb 2017 14:07:03 +0100
>>> Subject: [PATCH] Introduce IntegerRange for options (PR driver/79659).
>>>
>>> gcc/ChangeLog:
>>>
>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>
>>> 	PR driver/79659
>>> 	* common.opt: Add IntegerRange to various options.
>>> 	* opt-functions.awk (integer_range_info): New function.
>>> 	* optc-gen.awk: Add integer_range_info to cl_options struct.
>>> 	* opts-common.c (decode_cmdline_option): Handle
>>> 	CL_ERR_INT_RANGE_ARG.
>>> 	(cmdline_handle_error): Likewise.
>>> 	* opts.c (print_filtered_help): Show valid interval in
>>> 	when --help is provided.
>>> 	* opts.h (struct cl_option): Add range_min and range_max fields.
>>> 	* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.
>>>
>>> gcc/c-family/ChangeLog:
>>>
>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>
>>> 	PR driver/79659
>>> 	* c.opt: Add IntegerRange to various options.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>
>>> 	PR driver/79659
>>> 	* g++.dg/opt/pr79659.C: New test.
>> Presumably this never fully moved forward because it wasn't a regression?
>> 
>> This looks quite reasonable to me.  I'm not sure of the state of the
>> prereqs and you may want/need to add IntegerRange checks on newly added
>> options since this was first submitted.
>> 
>> If the prereqs are ack'd, then as far as I'm concerned this is good to
>> go and you're free to add any new IntegerRange checks you deem
>> necessary/desirable.
>> 
>> jeff
>> 
>
> Thank you Jeff for looking at the patch. I've just re-tested the patch and
> I'm going to install it.

seems you didn't test thoroughly enough: your patch introduced a couple
of testsuite regressions on i386-pc-solaris2.12 and x86_64-pc-linux-gnu
(any x86 target, in fact):

+FAIL: gcc.dg/uninit-pred-7_d.c (test for excess errors)
+FAIL: gcc.dg/uninit-pred-7_d.c warning (test for warnings, line 48)
+FAIL: gcc.dg/uninit-pred-8_d.c (test for excess errors)
+FAIL: gcc.dg/uninit-pred-8_d.c warning (test for warnings, line 42)

+FAIL: gcc.target/i386/branch-cost1.c (test for excess errors)
+UNRESOLVED: gcc.target/i386/branch-cost1.c scan-tree-dump-not gimple " & "
+UNRESOLVED: gcc.target/i386/branch-cost1.c scan-tree-dump-times gimple "if " 2
+FAIL: gcc.target/i386/branch-cost4.c (test for excess errors)
+UNRESOLVED: gcc.target/i386/branch-cost4.c scan-tree-dump-not gimple " & "
+UNRESOLVED: gcc.target/i386/branch-cost4.c scan-tree-dump-times gimple "if " 2

In all cases, you get

Excess errors:
xgcc: error: argument to '-mbranch-cost=' is not between 1 and 5

since the tests are compiled with -mbranch-cost=0.

Please fix.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* [PATCH][OBVIOUS] Fix -mbranch-cost range.
  2017-06-28 20:15         ` Rainer Orth
@ 2017-06-29  9:00           ` Martin Liška
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Liška @ 2017-06-29  9:00 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Jeff Law, GCC Patches, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 3265 bytes --]

On 06/28/2017 10:14 PM, Rainer Orth wrote:
> Hi Martin,
> 
>> On 06/28/2017 06:52 AM, Jeff Law wrote:
>>> On 03/15/2017 03:58 AM, Martin Liška wrote:
>>>> Huh, I forgot to attach the patch.
>>>>
>>>> Martin
>>>>
>>>> 0001-Introduce-IntegerRange-for-options-PR-driver-79659.patch
>>>>
>>>>
>>>> From bb89456e6cecfa9497cf8e265d2083e762d5bc3e Mon Sep 17 00:00:00 2001
>>>> From: marxin <mliska@suse.cz>
>>>> Date: Mon, 27 Feb 2017 14:07:03 +0100
>>>> Subject: [PATCH] Introduce IntegerRange for options (PR driver/79659).
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>>
>>>> 	PR driver/79659
>>>> 	* common.opt: Add IntegerRange to various options.
>>>> 	* opt-functions.awk (integer_range_info): New function.
>>>> 	* optc-gen.awk: Add integer_range_info to cl_options struct.
>>>> 	* opts-common.c (decode_cmdline_option): Handle
>>>> 	CL_ERR_INT_RANGE_ARG.
>>>> 	(cmdline_handle_error): Likewise.
>>>> 	* opts.c (print_filtered_help): Show valid interval in
>>>> 	when --help is provided.
>>>> 	* opts.h (struct cl_option): Add range_min and range_max fields.
>>>> 	* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.
>>>>
>>>> gcc/c-family/ChangeLog:
>>>>
>>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>>
>>>> 	PR driver/79659
>>>> 	* c.opt: Add IntegerRange to various options.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> 2017-02-28  Martin Liska  <mliska@suse.cz>
>>>>
>>>> 	PR driver/79659
>>>> 	* g++.dg/opt/pr79659.C: New test.
>>> Presumably this never fully moved forward because it wasn't a regression?
>>>
>>> This looks quite reasonable to me.  I'm not sure of the state of the
>>> prereqs and you may want/need to add IntegerRange checks on newly added
>>> options since this was first submitted.
>>>
>>> If the prereqs are ack'd, then as far as I'm concerned this is good to
>>> go and you're free to add any new IntegerRange checks you deem
>>> necessary/desirable.
>>>
>>> jeff
>>>
>>
>> Thank you Jeff for looking at the patch. I've just re-tested the patch and
>> I'm going to install it.
> 
> seems you didn't test thoroughly enough: your patch introduced a couple
> of testsuite regressions on i386-pc-solaris2.12 and x86_64-pc-linux-gnu
> (any x86 target, in fact):
> 
> +FAIL: gcc.dg/uninit-pred-7_d.c (test for excess errors)
> +FAIL: gcc.dg/uninit-pred-7_d.c warning (test for warnings, line 48)
> +FAIL: gcc.dg/uninit-pred-8_d.c (test for excess errors)
> +FAIL: gcc.dg/uninit-pred-8_d.c warning (test for warnings, line 42)
> 
> +FAIL: gcc.target/i386/branch-cost1.c (test for excess errors)
> +UNRESOLVED: gcc.target/i386/branch-cost1.c scan-tree-dump-not gimple " & "
> +UNRESOLVED: gcc.target/i386/branch-cost1.c scan-tree-dump-times gimple "if " 2
> +FAIL: gcc.target/i386/branch-cost4.c (test for excess errors)
> +UNRESOLVED: gcc.target/i386/branch-cost4.c scan-tree-dump-not gimple " & "
> +UNRESOLVED: gcc.target/i386/branch-cost4.c scan-tree-dump-times gimple "if " 2
> 
> In all cases, you get
> 
> Excess errors:
> xgcc: error: argument to '-mbranch-cost=' is not between 1 and 5
> 
> since the tests are compiled with -mbranch-cost=0.
> 
> Please fix.
> 
> 	Rainer
> 

Thanks for head up, I didn't catch it because I did testing on a ppc64le machine.
Fixed as obvious.

Martin

[-- Attachment #2: 0001-Fix-mbranch-cost-range.patch --]
[-- Type: text/x-patch, Size: 890 bytes --]

From d0003f3602f099dac9be1266c974eb24de4265f9 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 29 Jun 2017 10:42:04 +0200
Subject: [PATCH] Fix -mbranch-cost range.

gcc/ChangeLog:

2017-06-29  Martin Liska  <mliska@suse.cz>

	* config/i386/i386.opt: Change range from [1,5] to [0,5].
---
 gcc/config/i386/i386.opt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 90eadbc4e18..adc75f36602 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -267,7 +267,7 @@ EnumValue
 Enum(asm_dialect) String(att) Value(ASM_ATT)
 
 mbranch-cost=
-Target RejectNegative Joined UInteger Var(ix86_branch_cost) IntegerRange(1, 5)
+Target RejectNegative Joined UInteger Var(ix86_branch_cost) IntegerRange(0, 5)
 Branches are this expensive (arbitrary units).
 
 mlarge-data-threshold=
-- 
2.13.1


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

end of thread, other threads:[~2017-06-29  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 13:15 [PATCH] Add tabulars for options with enum values Martin Liška
2017-02-28 13:16 ` [PATCH 2/3] Introduce =<number> for couple of options Martin Liška
2017-02-28 18:47   ` Joseph Myers
2017-02-28 13:25 ` [PATCH 3/3] Introduce IntegerRange for options (PR driver/79659) Martin Liška
2017-03-15  9:58   ` Martin Liška
2017-06-28  4:52     ` Jeff Law
2017-06-28 12:43       ` Martin Liška
2017-06-28 20:15         ` Rainer Orth
2017-06-29  9:00           ` [PATCH][OBVIOUS] Fix -mbranch-cost range Martin Liška
2017-02-28 18:22 ` [PATCH] Add tabulars for options with enum values Joseph Myers

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