From f680436bce1d4ed0317f16586476cbd59e70c674 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Tue, 20 May 2008 12:24:43 +0200 Subject: [PATCH] Finally reverted parts of my escaped patch. (quilt sucks). From-SVN: r135607 --- gcc/config/i386/i386-protos.h | 3 --- gcc/config/i386/i386.c | 37 ++++++++++++++--------------------- gcc/config/i386/i386.h | 19 ------------------ 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 5e3a5caf352..aee90eb65bd 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -134,10 +134,7 @@ extern rtx ix86_libcall_value (enum machine_mode); extern bool ix86_function_value_regno_p (int); extern bool ix86_function_arg_regno_p (int); extern int ix86_function_arg_boundary (enum machine_mode, tree); -extern bool ix86_return_in_memory (const_tree, const_tree); extern bool ix86_sol10_return_in_memory (const_tree,const_tree); -extern bool ix86_i386elf_return_in_memory (const_tree,const_tree); -extern bool ix86_i386interix_return_in_memory (const_tree,const_tree); extern rtx ix86_force_to_memory (enum machine_mode, rtx); extern void ix86_free_from_memory (enum machine_mode); extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index af4dc3caca7..5dc79afa414 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4901,17 +4901,21 @@ return_in_memory_ms_64 (const_tree type, enum machine_mode mode) return (size != 1 && size != 2 && size != 4 && size != 8); } -bool +static bool ix86_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) { - const enum machine_mode mode = type_natural_mode (type); - +#ifdef SUBTARGET_RETURN_IN_MEMORY + return SUBTARGET_RETURN_IN_MEMORY (type, fntype); +#else + const enum machine_mode mode = type_natural_mode (type); + if (TARGET_64BIT_MS_ABI) - return return_in_memory_ms_64 (type, mode); - else if (TARGET_64BIT) - return return_in_memory_64 (type, mode); - else - return return_in_memory_32 (type, mode); + return return_in_memory_ms_64 (type, mode); + else if (TARGET_64BIT) + return return_in_memory_64 (type, mode); + else + return return_in_memory_32 (type, mode); +#endif } /* Return false iff TYPE is returned in memory. This version is used @@ -4951,20 +4955,6 @@ ix86_sol10_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED return size > 12; } -bool -ix86_i386elf_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) -{ - return (TYPE_MODE (type) == BLKmode - || (VECTOR_MODE_P (TYPE_MODE (type)) && int_size_in_bytes (type) == 8)); -} - -bool -ix86_i386interix_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) -{ - return (TYPE_MODE (type) == BLKmode - || (AGGREGATE_TYPE_P (type) && int_size_in_bytes(type) > 8 )); -} - /* When returning SSE vector types, we have a choice of either (1) being abi incompatible with a -march switch, or (2) generating an error. @@ -25795,6 +25785,9 @@ x86_builtin_vectorization_cost (bool runtime_test) } /* Initialize the GCC target structure. */ +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY ix86_return_in_memory + #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE ix86_attribute_table #if TARGET_DLLIMPORT_DECL_ATTRIBUTES diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index f259d74d9d7..9d36a1ff49f 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1261,25 +1261,6 @@ do { \ #define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_" -/* A C expression which can inhibit the returning of certain function - values in registers, based on the type of value. A nonzero value - says to return the function value in memory, just as large - structures are always returned. Here TYPE will be a C expression - of type `tree', representing the data type of the value. - - Note that values of mode `BLKmode' must be explicitly handled by - this macro. Also, the option `-fpcc-struct-return' takes effect - regardless of this macro. On most systems, it is possible to - leave the macro undefined; this causes a default definition to be - used, whose value is the constant 1 for `BLKmode' values, and 0 - otherwise. - - Do not use this macro to indicate that structures and unions - should always be returned in memory. You should instead use - `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */ - -#define TARGET_RETURN_IN_MEMORY ix86_return_in_memory - /* This is overridden by . */ #define MS_AGGREGATE_RETURN 0 -- 2.30.2