diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-13 10:29:03 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-13 10:29:03 +0200 |
commit | 1202f33e5e1e4236fec7a3c1d14c16b5f13c2aaa (patch) | |
tree | 685fcc683b155fa909df23b9901c4825e6a36a60 /gcc/config | |
parent | 90bca4ed80de6437b4101a65eb29fb034b793981 (diff) | |
download | gcc-1202f33e5e1e4236fec7a3c1d14c16b5f13c2aaa.zip gcc-1202f33e5e1e4236fec7a3c1d14c16b5f13c2aaa.tar.gz gcc-1202f33e5e1e4236fec7a3c1d14c16b5f13c2aaa.tar.bz2 |
re PR target/77957 (Undefined .LCTOC0 with -fstack-protector-strong -mminimal-toc -O0 on ppc64)
PR target/77957
* hooks.h (hook_tree_void_null): Declare.
* hooks.c (hook_tree_void_null): New function.
* langhooks.c (lhd_return_null_tree_v): Remove.
* langhooks-def.h (lhd_return_null_tree_v): Remove.
* cfgexpand.c (stack_protect_prologue): If guard_decl is NULL,
set y to const0_rtx.
* function.c (stack_protect_epilogue): Likewise.
* config/tilepro/tilepro.c (TARGET_STACK_PROTECT_GUARD): Redefine
if TARGET_THREAD_SSP_OFFSET is defined.
* config/s390/s390.c (TARGET_STACK_PROTECT_GUARD): Likewise.
* config/sparc/sparc.c (TARGET_STACK_PROTECT_GUARD): Likewise.
* config/tilegx/tilegx.c (TARGET_STACK_PROTECT_GUARD): Likewise.
* config/rs6000/rs6000.c (TARGET_STACK_PROTECT_GUARD): Likewise.
* config/i386/i386.c (TARGET_STACK_PROTECT_GUARD): Likewise.
(ix86_stack_protect_guard): New function.
c/
* c-objc-common.h (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
instead of lhd_return_null_tree_v.
ada/
* gcc-interface/misc.c (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
instead of lhd_return_null_tree_v.
From-SVN: r241087
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 17 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 5 | ||||
-rw-r--r-- | gcc/config/tilegx/tilegx.c | 5 | ||||
-rw-r--r-- | gcc/config/tilepro/tilepro.c | 5 |
6 files changed, 42 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f694611..eef6d7b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -44023,6 +44023,18 @@ ix86_mangle_type (const_tree type) } } +#ifdef TARGET_THREAD_SSP_OFFSET +/* If using TLS guards, don't waste time creating and expanding + __stack_chk_guard decl and MEM as we are going to ignore it. */ +static tree +ix86_stack_protect_guard (void) +{ + if (TARGET_SSP_TLS_GUARD) + return NULL_TREE; + return default_stack_protect_guard (); +} +#endif + /* For 32-bit code we can save PIC register setup by using __stack_chk_fail_local hidden function instead of calling __stack_chk_fail directly. 64-bit code doesn't need to setup any PIC @@ -50614,6 +50626,11 @@ ix86_addr_space_zero_address_valid (addr_space_t as) #undef TARGET_MANGLE_TYPE #define TARGET_MANGLE_TYPE ix86_mangle_type +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD ix86_stack_protect_guard +#endif + #if !TARGET_MACHO #undef TARGET_STACK_PROTECT_FAIL #define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 1110ee2..c688e87 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1752,6 +1752,11 @@ static const struct attribute_spec rs6000_attribute_table[] = #define TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION \ rs6000_builtin_md_vectorized_function +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null +#endif + #if !TARGET_MACHO #undef TARGET_STACK_PROTECT_FAIL #define TARGET_STACK_PROTECT_FAIL rs6000_stack_protect_fail diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3bdb648..04d6d44 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -15124,6 +15124,11 @@ s390_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE s390_option_override +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null +#endif + #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO s390_encode_section_info diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index f721ec2..ac05d96 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -798,6 +798,11 @@ char sparc_hard_reg_printed[8]; #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE sparc_option_override +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null +#endif + #if TARGET_GNU_TLS && defined(HAVE_AS_SPARC_UA_PCREL) #undef TARGET_ASM_OUTPUT_DWARF_DTPREL #define TARGET_ASM_OUTPUT_DWARF_DTPREL sparc_output_dwarf_dtprel diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index d743c63..0ef7559 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -5544,6 +5544,11 @@ tilegx_file_end (void) #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE tilegx_option_override +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null +#endif + #undef TARGET_SCALAR_MODE_SUPPORTED_P #define TARGET_SCALAR_MODE_SUPPORTED_P tilegx_scalar_mode_supported_p diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c index b39eff4..505c7a4 100644 --- a/gcc/config/tilepro/tilepro.c +++ b/gcc/config/tilepro/tilepro.c @@ -4948,6 +4948,11 @@ tilepro_file_end (void) #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE tilepro_option_override +#ifdef TARGET_THREAD_SSP_OFFSET +#undef TARGET_STACK_PROTECT_GUARD +#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null +#endif + #undef TARGET_SCALAR_MODE_SUPPORTED_P #define TARGET_SCALAR_MODE_SUPPORTED_P tilepro_scalar_mode_supported_p |