+2016-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2016-10-13 Richard Biener <rguenther@suse.de>
* dwarf2out.c (tree_add_const_value_attribute): Do not try
+2016-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/77957
+ * gcc-interface/misc.c (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
+ instead of lhd_return_null_tree_v.
+
2016-10-12 Yannick Moy <moy@adacore.com>
* einfo.adb, einfo.ads (Partial_Refinement_Constituents): Take
#undef LANG_HOOKS_TYPE_HASH_EQ
#define LANG_HOOKS_TYPE_HASH_EQ gnat_type_hash_eq
#undef LANG_HOOKS_GETDECLS
-#define LANG_HOOKS_GETDECLS lhd_return_null_tree_v
+#define LANG_HOOKS_GETDECLS hook_tree_void_null
#undef LANG_HOOKS_PUSHDECL
#define LANG_HOOKS_PUSHDECL gnat_return_tree
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
+2016-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/77957
+ * c-objc-common.h (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
+ instead of lhd_return_null_tree_v.
+
2016-10-07 Bernd Schmidt <bschmidt@redhat.com>
PR c++/69733
This means it must also provide its own write_globals. */
#undef LANG_HOOKS_GETDECLS
-#define LANG_HOOKS_GETDECLS lhd_return_null_tree_v
+#define LANG_HOOKS_GETDECLS hook_tree_void_null
/* Hooks for tree gimplification. */
#undef LANG_HOOKS_GIMPLIFY_EXPR
rtx x, y;
x = expand_normal (crtl->stack_protect_guard);
- y = expand_normal (guard_decl);
+ if (guard_decl)
+ y = expand_normal (guard_decl);
+ else
+ y = const0_rtx;
/* Allow the target to copy from Y to X without leaking Y into a
register. */
}
}
+#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
#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
#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
#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
#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
#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
#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
rtx_insn *seq;
x = expand_normal (crtl->stack_protect_guard);
- y = expand_normal (guard_decl);
+ if (guard_decl)
+ y = expand_normal (guard_decl);
+ else
+ y = const0_rtx;
/* Allow the target to compare Y with X without leaking either into
a register. */
return NULL;
}
+/* Generic hook that takes no arguments and returns a NULL_TREE. */
+tree
+hook_tree_void_null (void)
+{
+ return NULL;
+}
+
/* Generic hook that takes a rtx_insn * and an int and returns a bool. */
bool
bool);
extern tree hook_tree_const_tree_null (const_tree);
+extern tree hook_tree_void_null (void);
extern tree hook_tree_tree_tree_null (tree, tree);
extern tree hook_tree_tree_tree_tree_null (tree, tree, tree);
extern tree lhd_pass_through_t (tree);
extern bool lhd_post_options (const char **);
extern alias_set_type lhd_get_alias_set (tree);
-extern tree lhd_return_null_tree_v (void);
extern tree lhd_return_null_tree (tree);
extern tree lhd_return_null_const_tree (const_tree);
extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
/* Do nothing (return NULL_TREE). */
-tree
-lhd_return_null_tree_v (void)
-{
- return NULL_TREE;
-}
-
-/* Do nothing (return NULL_TREE). */
-
tree
lhd_return_null_tree (tree ARG_UNUSED (t))
{