aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-01-05 21:20:16 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-01-05 21:20:16 +0000
commit4e89adf9709dba511949a65a211d9bf702fe5753 (patch)
treedbd4806f74ed6642850686f771644372bbfc0f73 /gcc
parentcfd719e7769fd43fbfecfc0c8f69d5f05e54169b (diff)
downloadgcc-4e89adf9709dba511949a65a211d9bf702fe5753.zip
gcc-4e89adf9709dba511949a65a211d9bf702fe5753.tar.gz
gcc-4e89adf9709dba511949a65a211d9bf702fe5753.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c.opt5
-rw-r--r--gcc/doc/invoke.texi6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/sso-10.c27
6 files changed, 46 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8e51cee..1629b96 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * doc/invoke.texi (C Dialect Options): Document it.
+
2017-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71016
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 7ec36dc..0e1b4dd 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c.opt (fsso-struct): Add 'native' value.
+
2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 714ce3a..0b74aba 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1631,7 +1631,7 @@ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
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) Value(SSO_BIG_ENDIAN)
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.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a6ea425..83ac135 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2166,9 +2166,9 @@ basic integer types such as @code{int} are signed types.
@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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e99e399..08fa8c6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/sso-10.c: New test.
+
2017-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71016
diff --git a/gcc/testsuite/gcc.dg/sso-10.c b/gcc/testsuite/gcc.dg/sso-10.c
new file mode 100644
index 0000000..9dfa297
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sso-10.c
@@ -0,0 +1,27 @@
+/* { 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;
+}