===================================================================
@@ -806,6 +806,10 @@ typedef struct
correctly. */
#define TRAMPOLINE_SECTION text_section
+/* Use custom descriptors instead of trampolines when possible, but
+ TARGET_PTRMEMFUNC_VBIT_LOCATION is defined so use bit #1. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2
+
/* To start with. */
#define BRANCH_COST(SPEED_P, PREDICTABLE_P) \
(aarch64_branch_cost (SPEED_P, PREDICTABLE_P))
===================================================================
@@ -996,3 +996,6 @@ extern long alpha_auto_offset;
#define NO_IMPLICIT_EXTERN_C
#define TARGET_SUPPORTS_WIDE_INT 1
+
+/* Use custom descriptors instead of trampolines when possible if not VMS. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS (TARGET_ABI_OPEN_VMS ? 0 : 1)
===================================================================
@@ -6818,6 +6818,29 @@ arm_function_ok_for_sibcall (tree decl, tree exp)
&& DECL_WEAK (decl))
return false;
+ /* We cannot do a tailcall for an indirect call by descriptor if all the
+ argument registers are used because the only register left to load the
+ address is IP and it will already contain the static chain. */
+ if (!decl && CALL_EXPR_BY_DESCRIPTOR (exp) && !flag_trampolines)
+ {
+ tree fntype = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (exp)));
+ CUMULATIVE_ARGS cum;
+ cumulative_args_t cum_v;
+
+ arm_init_cumulative_args (&cum, fntype, NULL_RTX, NULL_TREE);
+ cum_v = pack_cumulative_args (&cum);
+
+ for (tree t = TYPE_ARG_TYPES (fntype); t; t = TREE_CHAIN (t))
+ {
+ tree type = TREE_VALUE (t);
+ if (!VOID_TYPE_P (type))
+ arm_function_arg_advance (cum_v, TYPE_MODE (type), type, true);
+ }
+
+ if (!arm_function_arg (cum_v, SImode, integer_type_node, true))
+ return false;
+ }
+
/* Everything else is ok. */
return true;
}
@@ -30187,7 +30210,9 @@ arm_relayout_function (tree fndecl)
callee_tree = target_option_default_node;
struct cl_target_option *opts = TREE_TARGET_OPTION (callee_tree);
- SET_DECL_ALIGN (fndecl, FUNCTION_BOUNDARY_P (opts->x_target_flags));
+ SET_DECL_ALIGN (fndecl,
+ FUNCTION_ALIGNMENT
+ (FUNCTION_BOUNDARY_P (opts->x_target_flags)));
}
/* Inner function to process the attribute((target(...))), take an argument and
===================================================================
@@ -1645,6 +1645,10 @@ typedef struct
/* Alignment required for a trampoline in bits. */
#define TRAMPOLINE_ALIGNMENT 32
+
+/* Use custom descriptors instead of trampolines when possible, but
+ TARGET_PTRMEMFUNC_VBIT_LOCATION is defined so use bit #1. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
===================================================================
@@ -2670,6 +2670,9 @@ extern void debug_dispatch_window (int);
#define TARGET_SUPPORTS_WIDE_INT 1
+/* Use custom descriptors instead of trampolines when possible. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 1
+
/*
Local variables:
version-control: t
===================================================================
@@ -1714,4 +1714,7 @@ struct GTY(()) machine_function
/* Switch on code for querying unit reservations. */
#define CPU_UNITS_QUERY 1
+/* IA-64 already uses descriptors for its standard calling sequence. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 0
+
/* End of ia64.h */
===================================================================
@@ -3413,3 +3413,7 @@ struct GTY(()) machine_function {
#define ENABLE_LD_ST_PAIRS \
(TARGET_LOAD_STORE_PAIRS && (TUNE_P5600 || TUNE_I6400) \
&& !TARGET_MICROMIPS && !TARGET_FIX_24K)
+
+/* Use custom descriptors instead of trampolines when possible, but
+ TARGET_PTRMEMFUNC_VBIT_LOCATION is defined so use bit #1. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2
===================================================================
@@ -1313,3 +1313,6 @@ do { \
seven and four instructions, respectively. */
#define MAX_PCREL17F_OFFSET \
(flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)
+
+/* HP-PA already uses descriptors for its standard calling sequence. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 0
===================================================================
@@ -2914,3 +2914,6 @@ extern GTY(()) tree rs6000_builtin_types[RS6000_BT
extern GTY(()) tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT];
#define TARGET_SUPPORTS_WIDE_INT 1
+
+/* Use custom descriptors instead of trampolines when possible if not AIX. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS (DEFAULT_ABI == ABI_AIX ? 0 : 1)
===================================================================
@@ -1817,3 +1817,6 @@ extern int sparc_indent_opcode;
#define SPARC_LOW_FE_EXCEPT_VALUES 0
#define TARGET_SUPPORTS_WIDE_INT 1
+
+/* Use custom descriptors instead of trampolines when possible. */
+#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 1