diff mbox

Add RejectNegative for a c option.

Message ID e9bcf468-9f04-3146-d8b4-3fac2e5ed4e9@suse.cz
State New
Headers show

Commit Message

Martin Liška Dec. 27, 2016, 4:26 p.m. UTC
Without RejectNegative one can cause an ICE in the compiler.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

Comments

Sandra Loosemore Dec. 27, 2016, 6:18 p.m. UTC | #1
On 12/27/2016 09:26 AM, Martin Liška wrote:
> Without RejectNegative one can cause an ICE in the compiler.

> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

>

> Ready to be installed?

> Martin


Any chance you can also fix the manual to fully document the
-fstrong-eval-order= form of the option?  It doesn't currently list
that or what the possible enum values are.  I assume
-fno-strong-eval-order is a synonym for -fstrong-eval-order=none ?

-Sandra
Martin Liška Dec. 29, 2016, 10:38 a.m. UTC | #2
On 12/27/2016 07:18 PM, Sandra Loosemore wrote:
> On 12/27/2016 09:26 AM, Martin Liška wrote:

>> Without RejectNegative one can cause an ICE in the compiler.

>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

>>

>> Ready to be installed?

>> Martin

> 

> Any chance you can also fix the manual to fully document the

> -fstrong-eval-order= form of the option?  It doesn't currently list

> that or what the possible enum values are.  I assume

> -fno-strong-eval-order is a synonym for -fstrong-eval-order=none ?

> 

> -Sandra

> 


Hello.

I've just installed the patch. To be honest, I'm not familiar with the option,
I guess Jason would be the right person to add documentation entry for the that.
As I've read other options allowing 'none' value, all of them have RejectNegative
flag set and do not allow synonyms.

Thanks,
Martin
diff mbox

Patch

From e005f69008daf6ad7705a2f9c3d0242e426c168f Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 27 Dec 2016 15:35:03 +0100
Subject: [PATCH] Add RejectNegative for a c option.

gcc/testsuite/ChangeLog:

2016-12-27  Martin Liska  <mliska@suse.cz>

	* g++.dg/pr78933.C: New test.

gcc/c-family/ChangeLog:

2016-12-27  Martin Liska  <mliska@suse.cz>

	* c.opt (strong-eval-order): Add RejectNegative keyword.
---
 gcc/c-family/c.opt             | 2 +-
 gcc/testsuite/g++.dg/pr78933.C | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/pr78933.C

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index a5333a35e41..ba5c39d4f1c 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1649,7 +1649,7 @@  Follow the C++17 evaluation order requirements for assignment expressions,
 shift, member function calls, etc.
 
 fstrong-eval-order=
-C++ ObjC++ Common Var(flag_strong_eval_order) Joined Enum(strong_eval_order) Init(-1)
+C++ ObjC++ Common Var(flag_strong_eval_order) Joined Enum(strong_eval_order) RejectNegative Init(-1)
 Follow the C++17 evaluation order requirements for assignment expressions,
 shift, member function calls, etc.
 
diff --git a/gcc/testsuite/g++.dg/pr78933.C b/gcc/testsuite/g++.dg/pr78933.C
new file mode 100644
index 00000000000..91a3a511711
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr78933.C
@@ -0,0 +1,3 @@ 
+// PR c/78933
+// { dg-do compile }
+// { dg-options "-fno-strong-eval-order" }
-- 
2.11.0