summaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-23 22:36:54 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-23 22:36:54 +0000
commit88a3ea34080ad3087a8191fbf479543153175d59 (patch)
tree34eaec34d3588e09f9a77abba776266f124dc823 /gcc/doc
parent25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff)
parente65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff)
downloadgccgo.tar.gz
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi98
-rw-r--r--gcc/doc/invoke.texi20
-rw-r--r--gcc/doc/rtl.texi5
3 files changed, 102 insertions, 21 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 4f79a92fc1d..1379502ebbb 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -11042,6 +11042,7 @@ the built-in function returns -1.
@findex __builtin_alloca_with_align
@findex __builtin_alloca_with_align_and_max
@findex __builtin_call_with_static_chain
+@findex __builtin_extend_pointer
@findex __builtin_fpclassify
@findex __builtin_isfinite
@findex __builtin_isnormal
@@ -12419,6 +12420,15 @@ Similar to @code{__builtin_bswap32}, except the argument and return types
are 64 bit.
@end deftypefn
+@deftypefn {Built-in Function} Pmode __builtin_extend_pointer (void * x)
+On targets where the user visible pointer size is smaller than the size
+of an actual hardware address this function returns the extended user
+pointer. Targets where this is true included ILP32 mode on x86_64 or
+Aarch64. This function is mainly useful when writing inline assembly
+code.
+@var{addr}
+@end deftypefn
+
@node Target Builtins
@section Built-in Functions Specific to Particular Target Machines
@@ -12461,6 +12471,7 @@ instructions, but allow the compiler to schedule those calls.
* TILEPro Built-in Functions::
* x86 Built-in Functions::
* x86 transactional memory intrinsics::
+* x86 control-flow protection intrinsics::
@end menu
@node AArch64 Built-in Functions
@@ -19054,14 +19065,12 @@ vector unsigned short vec_vctzh (vector unsigned short);
vector int vec_vctzw (vector int);
vector unsigned int vec_vctzw (vector int);
-long long vec_vextract4b (const vector signed char, const int);
-long long vec_vextract4b (const vector unsigned char, const int);
+vector unsigned long long vec_extract4b (vector unsigned char, const int);
-vector signed char vec_insert4b (vector int, vector signed char, const int);
+vector unsigned char vec_insert4b (vector signed int, vector unsigned char,
+ const int);
vector unsigned char vec_insert4b (vector unsigned int, vector unsigned char,
const int);
-vector signed char vec_insert4b (long long, vector signed char, const int);
-vector unsigned char vec_insert4b (long long, vector unsigned char, const int);
vector unsigned int vec_parity_lsbb (vector signed int);
vector unsigned int vec_parity_lsbb (vector unsigned int);
@@ -21772,13 +21781,17 @@ void __builtin_ia32_wrpkru (unsigned int)
unsigned int __builtin_ia32_rdpkru ()
@end smallexample
-The following built-in functions are available when @option{-mcet} is used.
-They are used to support Intel Control-flow Enforcment Technology (CET).
-Each built-in function generates the machine instruction that is part of the
-function's name.
+The following built-in functions are available when @option{-mcet} or
+@option{-mshstk} option is used. They support shadow stack
+machine instructions from Intel Control-flow Enforcement Technology (CET).
+Each built-in function generates the machine instruction that is part
+of the function's name. These are the internal low-level functions.
+Normally the functions in @ref{x86 control-flow protection intrinsics}
+should be used instead.
+
@smallexample
-unsigned int __builtin_ia32_rdsspd (unsigned int)
-unsigned long long __builtin_ia32_rdsspq (unsigned long long)
+unsigned int __builtin_ia32_rdsspd (void)
+unsigned long long __builtin_ia32_rdsspq (void)
void __builtin_ia32_incsspd (unsigned int)
void __builtin_ia32_incsspq (unsigned long long)
void __builtin_ia32_saveprevssp(void);
@@ -21885,6 +21898,51 @@ else
Note that, in most cases, the transactional and non-transactional code
must synchronize together to ensure consistency.
+@node x86 control-flow protection intrinsics
+@subsection x86 Control-Flow Protection Intrinsics
+
+@deftypefn {CET Function} {ret_type} _get_ssp (void)
+Get the current value of shadow stack pointer if shadow stack support
+from Intel CET is enabled in the hardware or @code{0} otherwise.
+The @code{ret_type} is @code{unsigned long long} for 64-bit targets
+and @code{unsigned int} for 32-bit targets.
+@end deftypefn
+
+@deftypefn {CET Function} void _inc_ssp (unsigned int)
+Increment the current shadow stack pointer by the size specified by the
+function argument. The argument is masked to a byte value for security
+reasons, so to increment by more than 255 bytes you must call the function
+multiple times.
+@end deftypefn
+
+The shadow stack unwind code looks like:
+
+@smallexample
+#include <immintrin.h>
+
+/* Unwind the shadow stack for EH. */
+#define _Unwind_Frames_Extra(x) \
+ do \
+ @{ \
+ _Unwind_Word ssp = _get_ssp (); \
+ if (ssp != 0) \
+ @{ \
+ _Unwind_Word tmp = (x); \
+ while (tmp > 255) \
+ @{ \
+ _inc_ssp (tmp); \
+ tmp -= 255; \
+ @} \
+ _inc_ssp (tmp); \
+ @} \
+ @} \
+ while (0)
+@end smallexample
+
+@noindent
+This code runs unconditionally on all 64-bit processors. For 32-bit
+processors the code runs on those that support multi-byte NOP instructions.
+
@node Target Format Checks
@section Format Checks Specific to Particular Target Machines
@@ -23831,11 +23889,23 @@ deprecated. @xref{Deprecated Features}.
@table @code
@item For scope
-If a variable is declared at for scope, it used to remain in scope until
-the end of the scope that contained the for statement (rather than just
-within the for scope). G++ retains this, but issues a warning, if such a
+If a variable is declared at for scope, it used to remain in scope
+until the end of the scope that contained the for statement (rather
+than just within the for scope). The deprecated
+@option{-fno-for-scope} option enables this non-standard behavior.
+Without the option, G++ retains this, but issues a warning, if such a
variable is accessed outside the for scope.
+The behavior is deprecated, only available with @option{-std=c++98}
+@option{-std=gnu++98} languages and you must use the
+@option{-fpermissive} option to enable it. The behavior will be
+removed.
+
+@item Friend Injection
+The @option{-ffriend-injection} option makes injected friends visible
+to regular name lookup, unlike standard C++. This option is
+deprecated and will be removed.
+
@item Implicit C language
Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
scope to set the language. On such systems, all header files are
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 48194c825f3..e70e2bad4d8 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2451,8 +2451,7 @@ However, in ISO C++ a friend function that is not declared
in an enclosing scope can only be found using argument dependent
lookup. GCC defaults to the standard behavior.
-This option is for compatibility, and may be removed in a future
-release of G++.
+This option is deprecated and will be removed.
@item -fno-elide-constructors
@opindex fno-elide-constructors
@@ -4184,7 +4183,7 @@ warning, though it may not be sufficient to avoid the overflow.
@smallexample
void f (int a, int b)
@{
- char buf [12];
+ char buf [13];
sprintf (buf, "a = %i, b = %i\n", a, b);
@}
@end smallexample
@@ -8620,7 +8619,7 @@ This flag is enabled by default at @option{-O2} and higher and depends on
@item -fisolate-erroneous-paths-attribute
@opindex fisolate-erroneous-paths-attribute
-Detect paths that trigger erroneous or undefined behavior due a null value
+Detect paths that trigger erroneous or undefined behavior due to a null value
being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
attribute. Isolate those paths from the main control flow and turn the
statement with erroneous or undefined behavior into a trap. This is not
@@ -9160,6 +9159,7 @@ Some assemblers only support this flag when @var{n} is a power of two;
in that case, it is rounded up.
If @var{n} is not specified or is zero, use a machine-dependent default.
+The maximum allowed @var{n} option value is 65536.
Enabled at levels @option{-O2}, @option{-O3}.
@@ -9185,6 +9185,7 @@ are greater than this value, then their values are used instead.
If @var{n} is not specified or is zero, use a machine-dependent default
which is very likely to be @samp{1}, meaning no alignment.
+The maximum allowed @var{n} option value is 65536.
Enabled at levels @option{-O2}, @option{-O3}.
@@ -9198,6 +9199,7 @@ operations.
@option{-fno-align-loops} and @option{-falign-loops=1} are
equivalent and mean that loops are not aligned.
+The maximum allowed @var{n} option value is 65536.
If @var{n} is not specified or is zero, use a machine-dependent default.
@@ -9215,6 +9217,7 @@ need be executed.
equivalent and mean that loops are not aligned.
If @var{n} is not specified or is zero, use a machine-dependent default.
+The maximum allowed @var{n} option value is 65536.
Enabled at levels @option{-O2}, @option{-O3}.
@@ -23371,7 +23374,9 @@ little-endian platform.
@opindex maltivec=be
Generate AltiVec instructions using big-endian element order,
regardless of whether the target is big- or little-endian. This is
-the default when targeting a big-endian platform.
+the default when targeting a big-endian platform. Using this option
+is currently deprecated. Support for this feature will be removed in
+GCC 9.
The element order is used to interpret element numbers in AltiVec
intrinsics such as @code{vec_splat}, @code{vec_extract}, and
@@ -27832,6 +27837,11 @@ Note that @option{-mcmodel=large} is incompatible with
@option{-mindirect-branch=thunk-extern} since the thunk function may
not be reachable in large code model.
+Note that @option{-mindirect-branch=thunk-extern} is incompatible with
+@option{-fcf-protection=branch} and @option{-fcheck-pointer-bounds}
+since the external thunk can not be modified to disable control-flow
+check.
+
@item -mfunction-return=@var{choice}
@opindex -mfunction-return
Convert function return with @var{choice}. The default is @samp{keep},
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 43d5405ddb4..b5410f9689d 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -1303,10 +1303,11 @@ point values. The floating point values are in @code{QFmode},
@findex CDImode
@findex CTImode
@findex COImode
-@item CQImode, CHImode, CSImode, CDImode, CTImode, COImode
+@findex CPSImode
+@item CQImode, CHImode, CSImode, CDImode, CTImode, COImode, CPSImode
These modes stand for a complex number represented as a pair of integer
values. The integer values are in @code{QImode}, @code{HImode},
-@code{SImode}, @code{DImode}, @code{TImode}, and @code{OImode},
+@code{SImode}, @code{DImode}, @code{TImode}, @code{OImode}, and @code{PSImode},
respectively.
@findex BND32mode