Commit 4e89adf9 by Eric Botcazou Committed by Eric Botcazou

invoke.texi (C Dialect Options): Document it.

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

From-SVN: r244115
parent cfd719e7
2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
* doc/invoke.texi (C Dialect Options): Document it.
2017-01-05 Jakub Jelinek <jakub@redhat.com> 2017-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71016 PR tree-optimization/71016
......
2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
* c.opt (fsso-struct): Add 'native' value.
2017-01-05 Martin Liska <mliska@suse.cz> 2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970 PR pch/78970
......
...@@ -1631,7 +1631,7 @@ C++ ObjC++ Ignore Warn(switch %qs is no longer supported) ...@@ -1631,7 +1631,7 @@ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fsso-struct= fsso-struct=
C ObjC Joined RejectNegative Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE) 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 Enum
Name(sso_struct) Type(enum scalar_storage_order_kind) UnknownError(unrecognized scalar storage order value %qs) 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) Value(SSO_BIG_ENDIAN) ...@@ -1642,6 +1642,9 @@ Enum(sso_struct) String(big-endian) Value(SSO_BIG_ENDIAN)
EnumValue EnumValue
Enum(sso_struct) String(little-endian) Value(SSO_LITTLE_ENDIAN) Enum(sso_struct) String(little-endian) Value(SSO_LITTLE_ENDIAN)
EnumValue
Enum(sso_struct) String(native) Value(SSO_NATIVE)
fstats fstats
C++ ObjC++ Var(flag_detailed_statistics) C++ ObjC++ Var(flag_detailed_statistics)
Display statistics accumulated during compilation. Display statistics accumulated during compilation.
......
...@@ -2166,9 +2166,9 @@ basic integer types such as @code{int} are signed types. ...@@ -2166,9 +2166,9 @@ basic integer types such as @code{int} are signed types.
@item -fsso-struct=@var{endianness} @item -fsso-struct=@var{endianness}
@opindex fsso-struct @opindex fsso-struct
Set the default scalar storage order of structures and unions to the Set the default scalar storage order of structures and unions to the
specified endianness. The accepted values are @samp{big-endian} and specified endianness. The accepted values are @samp{big-endian},
@samp{little-endian}. If the option is not passed, the compiler uses @samp{little-endian} and @samp{native} for the native endianness of
the native endianness of the target. This option is not supported for C++. the target (the default). This option is not supported for C++.
@strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
code that is not binary compatible with code generated without it if the code that is not binary compatible with code generated without it if the
......
2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/sso-10.c: New test.
2017-01-05 Jakub Jelinek <jakub@redhat.com> 2017-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71016 PR tree-optimization/71016
......
/* { dg-do run } */
/* { dg-options "-fsso-struct=native" } */
/* { dg-require-effective-target int32plus } */
struct S1
{
int i;
};
struct S1 my_s1 = { 0x12345678 };
unsigned char big_endian_pattern[4] = { 0x12, 0x34, 0x56, 0x78 };
unsigned char little_endian_pattern[4] = { 0x78, 0x56, 0x34, 0x12 };
int main (void)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
if (__builtin_memcmp (&my_s1, &little_endian_pattern, 4) != 0)
__builtin_abort ();
#else
if (__builtin_memcmp (&my_s1, &big_endian_pattern, 4) != 0)
__builtin_abort ();
#endif
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment