diff mbox

Fix ICE with -fno-sso-struct=none (PR driver/78957)

Message ID 247277927.gUkCtdRrLC@polaris
State New
Headers show

Commit Message

Eric Botcazou Jan. 5, 2017, 7:53 p.m. UTC
> In this case there is no -fsso-struct option (what would it mean), so

> -fno-sso-struct isn't there either (again, what would that mean).

> The only thing that would make sense IMHO would be to allow

> not just big-endian and little-endian, but also native, so one can

> cancel earlier -fsso-struct= like

> gcc ... -fsso-struct=little-endian ... -fsso-struct=native ...

> and have it act as if neither of those options appeared.


That makes sense and is immediate since the logic is already based on the 
native endianness of the target.

Tested on x86-64_suse-linux, OK for the mainline?


2017-01-05  Eric Botcazou  <ebotcazou@adacore.com>

	* c-family/c.opt (fsso-struct): Add 'native' value.
	* doc/invoke.texi (C Dialect Options): Document it.


2017-01-05  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/sso-10.c: New test.


-- 
Eric Botcazou

Comments

Jakub Jelinek Jan. 5, 2017, 9:09 p.m. UTC | #1
On Thu, Jan 05, 2017 at 08:53:49PM +0100, Eric Botcazou wrote:
> > In this case there is no -fsso-struct option (what would it mean), so

> > -fno-sso-struct isn't there either (again, what would that mean).

> > The only thing that would make sense IMHO would be to allow

> > not just big-endian and little-endian, but also native, so one can

> > cancel earlier -fsso-struct= like

> > gcc ... -fsso-struct=little-endian ... -fsso-struct=native ...

> > and have it act as if neither of those options appeared.

> 

> That makes sense and is immediate since the logic is already based on the 

> native endianness of the target.

> 

> Tested on x86-64_suse-linux, OK for the mainline?

> 

> 

> 2017-01-05  Eric Botcazou  <ebotcazou@adacore.com>

> 

> 	* c-family/c.opt (fsso-struct): Add 'native' value.


c-family/ has its own ChangeLog, so just * c.opt (...): ...

> 	* doc/invoke.texi (C Dialect Options): Document it.

> 

> 

> 2017-01-05  Eric Botcazou  <ebotcazou@adacore.com>

> 

> 	* gcc.dg/sso-10.c: New test.


Ok, thanks.

	Jakub
diff mbox

Patch

Index: c-family/c.opt
===================================================================
--- c-family/c.opt	(revision 244107)
+++ c-family/c.opt	(working copy)
@@ -1631,7 +1631,7 @@  C++ ObjC++ Ignore Warn(switch %qs is no
 
 fsso-struct=
 C ObjC Joined RejectNegative Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE)
--fsso-struct=[big-endian|little-endian]	Set the default scalar storage order.
+-fsso-struct=[big-endian|little-endian|native]	Set the default scalar storage order.
 
 Enum
 Name(sso_struct) Type(enum scalar_storage_order_kind) UnknownError(unrecognized scalar storage order value %qs)
@@ -1642,6 +1642,9 @@  Enum(sso_struct) String(big-endian) Valu
 EnumValue
 Enum(sso_struct) String(little-endian) Value(SSO_LITTLE_ENDIAN)
 
+EnumValue
+Enum(sso_struct) String(native) Value(SSO_NATIVE)
+
 fstats
 C++ ObjC++ Var(flag_detailed_statistics)
 Display statistics accumulated during compilation.
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 244034)
+++ doc/invoke.texi	(working copy)
@@ -2166,9 +2166,9 @@  basic integer types such as @code{int} a
 @item -fsso-struct=@var{endianness}
 @opindex fsso-struct
 Set the default scalar storage order of structures and unions to the
-specified endianness.  The accepted values are @samp{big-endian} and
-@samp{little-endian}.  If the option is not passed, the compiler uses
-the native endianness of the target.  This option is not supported for C++.
+specified endianness.  The accepted values are @samp{big-endian},
+@samp{little-endian} and @samp{native} for the native endianness of
+the target (the default).  This option is not supported for C++.
 
 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
 code that is not binary compatible with code generated without it if the