From dff73565df46267296c9bee0589e1f106a07a5e2 Mon Sep 17 00:00:00 2001 From: law Date: Wed, 14 Feb 2018 07:21:11 +0000 Subject: 2018-02-14 Jozef Lawrynowicz PR target/79242 * machmode.def: Define a complex mode for PARTIAL_INT. * genmodes.c (complex_class): Return MODE_COMPLEX_INT for MODE_PARTIAL_INT. * doc/rtl.texi: Document CSPImode. * config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode handling. (msp430_hard_regno_nregs_with_padding): Likewise. PR target/79242 * gcc.target/msp430/pr79242.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257653 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/rtl.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/doc') 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 -- cgit v1.2.1 From 1c9aa9c6652df0be177e1b578cc174712f474a28 Mon Sep 17 00:00:00 2001 From: itsimbal Date: Wed, 14 Feb 2018 15:06:21 +0000 Subject: Reimplement CET intrinsics for rdssp/incssp insn. Introduce a couple of new CET intrinsics for reading and updating a shadow stack pointer (_get_ssp and _inc_ssp). They replace the existing _rdssp[d|q] and _incssp[d|q] instrinsics. PR target/84239 * gcc/config/i386/cetintrin.h: Remove _rdssp[d|q] and add _get_ssp intrinsics. Remove argument from __builtin_ia32_rdssp[d|q]. * gcc/config/i386/i386-builtin-types.def: Add UINT_FTYPE_VOID. * gcc/config/i386/i386-builtin.def: Remove argument from __builtin_ia32_rdssp[d|q]. * gcc/config/i386/i386.c: Use UINT_FTYPE_VOID. Use ix86_expand_special_args_builtin for _rdssp[d|q]. * gcc/config/i386/i386.md: Remove argument from rdssp[si|di] insn. Clear register before usage. * doc/extend.texi: Remove argument from __builtin_ia32_rdssp[d|q]. Add documentation for new _get_ssp and _inc_ssp intrinsics. * testsuite/gcc.target/i386/cet-intrin-3.c: Use new _get_ssp and _inc_ssp intrinsics. * testsuite/gcc.target/i386/cet-intrin-4.c: Likewise. * testsuite/gcc.target/i386/cet-rdssp-1.c: Remove argument from __builtin_ia32_rdssp[d|q]. * libgcc/config/i386/shadow-stack-unwind.hi (_Unwind_Frames_Extra): Use new _get_ssp and _inc_ssp intrinsics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257660 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 62 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 4f79a92fc1d..5c3c5ec2dc8 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12461,6 +12461,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 @@ -21772,13 +21773,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 +21890,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 + +/* 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 -- cgit v1.2.1 From 9ba421241e4803e309b288116e1365a0f288e35f Mon Sep 17 00:00:00 2001 From: kelvin Date: Wed, 14 Feb 2018 19:20:30 +0000 Subject: gcc/ChangeLog: 2018-02-14 Kelvin Nilsen * config/rs6000/rs6000.c (rs6000_option_override_internal): Issue warning message if user requests -maltivec=be. * doc/invoke.texi: Document deprecation of -maltivec=be. gcc/testsuite/ChangeLog: 2018-02-14 Kelvin Nilsen * gcc.dg/vmx/extract-be-order.c: Disable -maltivec=be warning so this test case still works ok. * gcc.dg/vmx/extract-vsx-be-order.c: Likewise. * gcc.dg/vmx/insert-be-order.c: Likewise. * gcc.dg/vmx/insert-vsx-be-order.c: Likewise. * gcc.dg/vmx/ld-be-order.c: Likewise. * gcc.dg/vmx/ld-vsx-be-order.c: Likewise. * gcc.dg/vmx/lde-be-order.c: Likewise. * gcc.dg/vmx/ldl-be-order.c: Likewise. * gcc.dg/vmx/ldl-vsx-be-order.c: Likewise. * gcc.dg/vmx/merge-be-order.c: Likewise. * gcc.dg/vmx/merge-vsx-be-order.c: Likewise. * gcc.dg/vmx/mult-even-odd-be-order.c: Likewise. * gcc.dg/vmx/pack-be-order.c: Likewise. * gcc.dg/vmx/perm-be-order.c: Likewise. * gcc.dg/vmx/splat-be-order.c: Likewise. * gcc.dg/vmx/splat-vsx-be-order.c: Likewise. * gcc.dg/vmx/st-be-order.c: Likewise. * gcc.dg/vmx/st-vsx-be-order.c: Likewise. * gcc.dg/vmx/ste-be-order.c: Likewise. * gcc.dg/vmx/stl-be-order.c: Likewise. * gcc.dg/vmx/stl-vsx-be-order.c: Likewise. * gcc.dg/vmx/sum2s-be-order.c: Likewise. * gcc.dg/vmx/unpack-be-order.c: Likewise. * gcc.dg/vmx/vsums-be-order.c: Likewise. * gcc.target/powerpc/vec-setup-be-long.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257668 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/invoke.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 48194c825f3..f0b11a01354 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -23371,7 +23371,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 -- cgit v1.2.1 From bc37679f1e7b2a24bcb191cd84baf5efaad14625 Mon Sep 17 00:00:00 2001 From: msebor Date: Thu, 15 Feb 2018 00:47:22 +0000 Subject: gcc/ChangeLog: 2018-02-14 Indu Bhagat * doc/invoke.texi: Correct -Wformat-overflow code sample. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257680 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/invoke.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f0b11a01354..bcffc8c1098 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4184,7 +4184,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 -- cgit v1.2.1 From 5d4ea37d1bc6a1ddaa19c1f1ac8210a51abb2751 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 16 Feb 2018 16:21:36 +0000 Subject: [C++ PATCH] Deprecate -ffriend-injection https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00998.html Deprecate -ffriend-injection. * decl.c (cxx_init_decl_processing): Emit warning on option. * name-lookup.c (do_pushdecl): Emit warning if we push a visible friend. * doc/extend.texi (Backwards Compatibility): Mention friend injection. Note for-scope is deprecated. * doc/invoke.texi (-ffriend-injection): Deprecate. * g++.old-deja/g++.jason/scoping15.C: Expect warnings. * g++.old-deja/g++.mike/net43.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257742 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 18 +++++++++++++++--- gcc/doc/invoke.texi | 3 +-- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 5c3c5ec2dc8..ee37eee4a5a 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -23881,11 +23881,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 behaviour. +Without the option, G++ retains this, but issues a warning, if such a variable is accessed outside the for scope. +The behaviour 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 behaviour 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 bcffc8c1098..277c99a0527 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 -- cgit v1.2.1 From 8c76a28ef7f3e672a92eb18c5d1449a091e1a480 Mon Sep 17 00:00:00 2001 From: carll Date: Fri, 16 Feb 2018 17:30:45 +0000 Subject: gcc/ChangeLog: 2018-02-16 Carl Love * config/rs6000/altivec.h: Add builtin names vec_extract4b vec_insert4b. * config/rs6000/rs6000-builtin.def: Add INSERT4B and EXTRACT4B definitions. * config/rs6000/rs6000-c.c: Add the definitions for P9V_BUILTIN_VEC_EXTRACT4B and P9V_BUILTIN_VEC_INSERT4B. * config/rs6000/rs6000.c (altivec_expand_builtin): Add P9V_BUILTIN_EXTRACT4B and P9V_BUILTIN_INSERT4B case statements. * config/rs6000/vsx.md: Add define_insn extract4b. Add define_expand definition for insert4b and define insn *insert3b_internal. * doc/extend.texi: Add documentation for vec_extract4b. gcc/testsuite/ChangeLog: 2018-02-16 Carl Love * gcc.target/powerpc/builtins-7-p9-runnable.c: New runnable test file for the ABI definitions for vec_extract4b and vec_insert4b. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257747 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index ee37eee4a5a..b7effef1774 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -19056,8 +19056,15 @@ vector int vec_vctzw (vector int); vector unsigned int vec_vctzw (vector int); long long vec_vextract4b (const vector signed char, const int); +vector unsigned long long vec_extract4b (vector unsigned char, + const int); +long long vec_extract4b (const vector signed char, const int); long long vec_vextract4b (const vector unsigned 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 (vector int, vector signed char, const int); vector unsigned char vec_insert4b (vector unsigned int, vector unsigned char, const int); -- cgit v1.2.1 From 115efe630c5325471c7c2bce474525c2278182e0 Mon Sep 17 00:00:00 2001 From: carll Date: Fri, 16 Feb 2018 17:35:13 +0000 Subject: gcc/ChangeLog: 2018-02-16 Carl Love * config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b. * config/rs6000/rs6000-builtin.def: Remove macro expansion for VEXTRACT4B, VINSERT4B, VINSERT4B_DI and VEXTRACT4B. * config/rs6000/rs6000.c: Remove case statements for P9V_BUILTIN_VEXTRACT4B, P9V_BUILTIN_VEC_VEXTRACT4B, P9V_BUILTIN_VINSERT4B, P9V_BUILTIN_VINSERT4B_DI, and P9V_BUILTIN_VEC_VINSERT4B. * config/rs6000/rs6000-c.c (altivec_expand_builtin): Remove entries for P9V_BUILTIN_VEC_VEXTRACT4B and P9V_BUILTIN_VEC_VINSERT4B. * config/rs6000/vsx.md: * doc/extend.texi: Remove vec_vextract4b, non ABI definitions for vec_insert4b. gcc/testsuite/ChangeLog: 2018-02-16 Carl Love * gcc.target/powerpc/p9-vinsert4b-1.c: Remove test file for non-ABI tests. * gcc.target/powerpc/p9-vinsert4b-2.c: Remove test file for non-ABI tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257748 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b7effef1774..d38840e4912 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -19055,21 +19055,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); -vector unsigned long long vec_extract4b (vector unsigned char, - const int); -long long vec_extract4b (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 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 (vector int, vector signed 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); -- cgit v1.2.1 From d76b54bd32265c0d5e257674458cf645de34fb41 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 16 Feb 2018 19:08:07 +0000 Subject: [C++ PATCH] Deprecate -ffriend-injection https://gcc.gnu.org/ml/gcc-patches/2018-02/msg01020.html * doc/extend.texi (Backwards Compatibility): Americanize 'behaviour'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257755 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index d38840e4912..b5240095ab6 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -23882,13 +23882,13 @@ deprecated. @xref{Deprecated Features}. 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 behaviour. +@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 behaviour is deprecated, only available with @option{-std=c++98} +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 behaviour will be +@option{-fpermissive} option to enable it. The behavior will be removed. @item Friend Injection -- cgit v1.2.1 From 47f1fd04f7e813fbfe041d7bde9edeadbef35f9d Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 19 Feb 2018 09:54:09 +0000 Subject: Fix documentation typos (PR other/80589). 2018-02-19 Martin Liska PR other/80589 * doc/invoke.texi: Fix typo. * params.def (PARAM_MAX_LOOP_HEADER_INSNS): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257803 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/invoke.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 277c99a0527..a580794bfba 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -8619,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 -- cgit v1.2.1 From 42b1063146566519fef7a8589e3fd82b7240ae0f Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 20 Feb 2018 10:04:13 +0000 Subject: Add limit for maximal alignment options (PR c/84310). 2018-02-20 Martin Liska PR c/84310 PR target/79747 * final.c (shorten_branches): Build align_tab array with one more element. * opts.c (finish_options): Add alignment option limit check. (MAX_CODE_ALIGN): Likewise. (MAX_CODE_ALIGN_VALUE): Likewise. * doc/invoke.texi: Document maximum allowed option value for all -falign-* options. 2018-02-20 Martin Liska PR c/84310 PR target/79747 * gcc.target/i386/pr84310.c: New test. * gcc.target/i386/pr84310-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257842 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/invoke.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index a580794bfba..973d77d47bf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9159,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}. @@ -9184,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}. @@ -9197,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. @@ -9214,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}. -- cgit v1.2.1 From ba56bbb1d55c267a47663a3757a3b96c4907f9df Mon Sep 17 00:00:00 2001 From: sje Date: Thu, 22 Feb 2018 16:49:28 +0000 Subject: 2018-02-22 Steve Ellcey * doc/extend.texi (__builtin_extend_pointer): Document builtin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257906 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/extend.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b5240095ab6..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 -- cgit v1.2.1 From 95b8f16f0c0ceef491a2b776533935877829fe0d Mon Sep 17 00:00:00 2001 From: hjl Date: Thu, 22 Feb 2018 17:09:06 +0000 Subject: i386: Add __x86_indirect_thunk_nt_reg for -fcf-protection -mcet nocf_check attribute can be used with -fcf-protection -mcet to disable control-flow check by adding NOTRACK prefix before indirect branch. When -mindirect-branch=thunk-extern -mindirect-branch-register is added, indirect branch via register, "notrack call/jmp reg", is converted to call/jmp __x86_indirect_thunk_nt_reg When running on machines with CET enabled, __x86_indirect_thunk_nt_reg can be updated to notrack jmp reg at run-time to restore NOTRACK prefix in the original indirect branch. Since we don't support -mindirect-branch=thunk-extern, CET and MPX at the same time, -mindirect-branch=thunk-extern is disallowed with -fcf-protection=branch and -fcheck-pointer-bounds. Tested on i686 and x86-64. gcc/ PR target/84176 * config/i386/i386.c (ix86_set_indirect_branch_type): Issue an error when -mindirect-branch=thunk-extern, -fcf-protection=branch and -fcheck-pointer-bounds are used together. (indirect_thunk_prefix): New enum. (indirect_thunk_need_prefix): New function. (indirect_thunk_name): Replace need_bnd_p with need_prefix. Use "_nt" instead of "_bnd" for NOTRACK prefix. (output_indirect_thunk): Replace need_bnd_p with need_prefix. (output_indirect_thunk_function): Likewise. (): Likewise. (ix86_code_end): Update output_indirect_thunk_function calls. (ix86_output_indirect_branch_via_reg): Replace ix86_bnd_prefixed_insn_p with indirect_thunk_need_prefix. (ix86_output_indirect_branch_via_push): Likewise. (ix86_output_function_return): Likewise. * doc/invoke.texi: Document -mindirect-branch=thunk-extern is incompatible with -fcf-protection=branch and -fcheck-pointer-bounds. gcc/testsuite/ PR target/84176 * gcc.target/i386/indirect-thunk-11.c: New test. * gcc.target/i386/indirect-thunk-12.c: Likewise. * gcc.target/i386/indirect-thunk-attr-12.c: Likewise. * gcc.target/i386/indirect-thunk-attr-13.c: Likewise. * gcc.target/i386/indirect-thunk-attr-14.c: Likewise. * gcc.target/i386/indirect-thunk-attr-15.c: Likewise. * gcc.target/i386/indirect-thunk-attr-16.c: Likewise. * gcc.target/i386/indirect-thunk-extern-10.c: Likewise. * gcc.target/i386/indirect-thunk-extern-8.c: Likewise. * gcc.target/i386/indirect-thunk-extern-9.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257909 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/invoke.texi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 973d77d47bf..e70e2bad4d8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27837,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}, -- cgit v1.2.1