Mercurial > hg > CbC > CbC_gcc
diff gcc/config/picochip/picochip.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
line wrap: on
line diff
--- a/gcc/config/picochip/picochip.c Sun Feb 07 18:28:00 2010 +0900 +++ b/gcc/config/picochip/picochip.c Fri Feb 12 23:39:51 2010 +0900 @@ -95,6 +95,7 @@ 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 @@ 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 @@ #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 @@ #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 @@ #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 @@ 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 @@ /* 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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ /* 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 @@ } 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 @@ /* 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 @@ } + +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); +}