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 <mli...@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  <mli...@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  <mli...@suse.cz>
>>>>
>>>>    PR driver/79659
>>>>    * c.opt: Add IntegerRange to various options.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> 2017-02-28  Martin Liska  <mli...@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
>From d0003f3602f099dac9be1266c974eb24de4265f9 Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Thu, 29 Jun 2017 10:42:04 +0200
Subject: [PATCH] Fix -mbranch-cost range.

gcc/ChangeLog:

2017-06-29  Martin Liska  <mli...@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

Reply via email to