Index: gcc/gcc/config/picochip/picochip.c |
diff --git a/gcc/gcc/config/picochip/picochip.c b/gcc/gcc/config/picochip/picochip.c |
index e9b6156315303259ec09a37d325680e752f979c4..bf6d263994c0695b3b79b2bb4fdadbe97432428d 100644 |
--- a/gcc/gcc/config/picochip/picochip.c |
+++ b/gcc/gcc/config/picochip/picochip.c |
@@ -95,6 +95,7 @@ rtx picochip_expand_builtin (tree, rtx, rtx, enum machine_mode, int); |
bool picochip_rtx_costs (rtx x, int code, int outer_code, int* total); |
bool picochip_return_in_memory(const_tree type, |
const_tree fntype ATTRIBUTE_UNUSED); |
+bool picochip_legitimate_address_p (enum machine_mode, rtx, bool); |
rtx picochip_struct_value_rtx(tree fntype ATTRIBUTE_UNUSED, int incoming ATTRIBUTE_UNUSED); |
rtx picochip_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, |
@@ -110,6 +111,8 @@ picochip_asm_named_section (const char *name, |
unsigned int flags ATTRIBUTE_UNUSED, |
tree decl ATTRIBUTE_UNUSED); |
+static rtx picochip_static_chain (const_tree, bool); |
+ |
/* Lookup table mapping a register number to the earliest containing |
class. Used by REGNO_REG_CLASS. */ |
const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER] = |
@@ -253,10 +256,8 @@ static char picochip_get_vliw_alu_id (void); |
#undef TARGET_ARG_PARTIAL_BYTES |
#define TARGET_ARG_PARTIAL_BYTES picochip_arg_partial_bytes |
-#undef TARGET_PROMOTE_FUNCTION_ARGS |
-#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_const_tree_true |
-#undef TARGET_PROMOTE_FUNCTION_RETURN |
-#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_const_tree_true |
+#undef TARGET_PROMOTE_FUNCTION_MODE |
+#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote |
#undef TARGET_PROMOTE_PROTOTYPES |
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true |
@@ -275,6 +276,9 @@ static char picochip_get_vliw_alu_id (void); |
#define TARGET_LIBGCC_CMP_RETURN_MODE picochip_libgcc_cmp_return_mode |
*/ |
+#undef TARGET_LEGITIMATE_ADDRESS_P |
+#define TARGET_LEGITIMATE_ADDRESS_P picochip_legitimate_address_p |
+ |
/* Loading and storing QImode values to and from memory |
usually requires a scratch register. */ |
#undef TARGET_SECONDARY_RELOAD |
@@ -287,6 +291,9 @@ static char picochip_get_vliw_alu_id (void); |
#undef TARGET_RETURN_IN_MEMORY |
#define TARGET_RETURN_IN_MEMORY picochip_return_in_memory |
+#undef TARGET_STATIC_CHAIN |
+#define TARGET_STATIC_CHAIN picochip_static_chain |
+ |
struct gcc_target targetm = TARGET_INITIALIZER; |
@@ -311,9 +318,6 @@ picochip_override_options (void) |
PARAM_VALUE (PARAM_LARGE_STACK_FRAME) = 0; |
PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 0; |
} |
- /* The function call overhead on picochip is not very high. Let the |
- inliner know so its heuristics become more reasonable. */ |
- PARAM_VALUE (PARAM_INLINE_CALL_COST) = 2; |
/* Turn off the elimination of unused types. The elaborator |
generates various interesting types to represent constants, |
@@ -1249,8 +1253,8 @@ picochip_const_ok_for_base (enum machine_mode mode, int regno, int offset) |
/* Determine whether a given rtx is a legitimate address for machine_mode |
MODE. STRICT is non-zero if we're being strict - any pseudo that |
is not a hard register must be a memory reference. */ |
-int |
-picochip_legitimate_address_p (int mode, rtx x, unsigned strict) |
+bool |
+picochip_legitimate_address_p (enum machine_mode mode, rtx x, bool strict) |
{ |
int valid = 0; |
@@ -2921,7 +2925,7 @@ reorder_var_tracking_notes (void) |
{ |
next = NEXT_INSN (insn); |
- if (INSN_P (insn)) |
+ if (NONDEBUG_INSN_P (insn)) |
{ |
/* Emit queued up notes before the first instruction of a bundle. */ |
if (GET_MODE (insn) == TImode) |
@@ -3017,7 +3021,7 @@ picochip_reorg (void) |
INSN_LOCATOR (insn1) = vliw_insn_location; |
} |
/* Tag subsequent instructions with the same location. */ |
- if (INSN_P (insn)) |
+ if (NONDEBUG_INSN_P (insn)) |
INSN_LOCATOR (insn) = vliw_insn_location; |
} |
} |
@@ -3161,7 +3165,7 @@ picochip_reset_vliw (rtx insn) |
local_insn = insn; |
do |
{ |
- if (NOTE_P (local_insn)) |
+ if (NOTE_P (local_insn) || DEBUG_INSN_P(local_insn)) |
{ |
local_insn = NEXT_INSN (local_insn); |
continue; |
@@ -3600,7 +3604,7 @@ picochip_final_prescan_insn (rtx insn, rtx * opvec ATTRIBUTE_UNUSED, |
for (local_insn = NEXT_INSN (local_insn); local_insn; |
local_insn = NEXT_INSN (local_insn)) |
{ |
- if (NOTE_P (local_insn)) |
+ if (NOTE_P (local_insn) || DEBUG_INSN_P(local_insn)) |
continue; |
else if (!INSN_P (local_insn)) |
break; |
@@ -3612,7 +3616,7 @@ picochip_final_prescan_insn (rtx insn, rtx * opvec ATTRIBUTE_UNUSED, |
/* Set the continuation flag if the next instruction can be packed |
with the current instruction (i.e., the next instruction is |
valid, and isn't the start of a new cycle). */ |
- picochip_vliw_continuation = (local_insn && INSN_P (local_insn) && |
+ picochip_vliw_continuation = (local_insn && NONDEBUG_INSN_P (local_insn) && |
(GET_MODE (local_insn) != TImode)); |
} |
@@ -4143,7 +4147,7 @@ warn_of_byte_access (void) |
} |
rtx |
-picochip_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, |
+picochip_function_value (const_tree valtype, const_tree func, |
bool outgoing ATTRIBUTE_UNUSED) |
{ |
enum machine_mode mode = TYPE_MODE (valtype); |
@@ -4151,7 +4155,7 @@ picochip_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, |
/* Since we define PROMOTE_FUNCTION_RETURN, we must promote the mode |
just as PROMOTE_MODE does. */ |
- mode = promote_mode (valtype, mode, &unsignedp, 1); |
+ mode = promote_function_mode (valtype, mode, &unsignedp, func, 1); |
return gen_rtx_REG (mode, 0); |
@@ -4403,3 +4407,14 @@ picochip_check_conditional_copy (rtx * operands) |
} |
+ |
+static rtx |
+picochip_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p) |
+{ |
+ rtx addr; |
+ if (incoming_p) |
+ addr = arg_pointer_rtx; |
+ else |
+ addr = plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD); |
+ return gen_frame_mem (Pmode, addr); |
+} |