From 5a1c68c319e09fab3a9288938bc1844bd19f8f66 Mon Sep 17 00:00:00 2001 From: aesok Date: Mon, 29 Jun 2009 22:51:04 +0000 Subject: * target.h (struct gcc_target): Add frame_pointer_required field. * target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149065 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 989f823df92..9672dfa718a 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -4259,6 +4259,13 @@ m32c_output_compare (rtx insn, rtx *operands) #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m32c_encode_section_info +/* If the frame pointer isn't used, we detect it manually. But the + stack pointer doesn't have as flexible addressing as the frame + pointer, so we always assume we have it. */ + +#undef TARGET_FRAME_POINTER_REQUIRED +#define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true + /* The Global `targetm' Variable. */ struct gcc_target targetm = TARGET_INITIALIZER; -- cgit v1.2.1 From f32697329ff3669ae2a16d90bfa4d0ebe53906a4 Mon Sep 17 00:00:00 2001 From: dj Date: Thu, 16 Jul 2009 20:07:46 +0000 Subject: * config/m32c/m32c.c (m32c_compare_redundant): Avoid removing compares that may be indirectly affected by previous instructions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149719 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 9672dfa718a..46dc4dc6639 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -4167,6 +4167,40 @@ m32c_compare_redundant (rtx cmp, rtx *operands) #endif return false; } + + /* Check for comparisons against memory - between volatiles and + aliases, we just can't risk this one. */ + if (GET_CODE (operands[0]) == MEM + || GET_CODE (operands[0]) == MEM) + { +#if DEBUG_CMP + fprintf(stderr, "comparisons with memory:\n"); + debug_rtx(prev); +#endif + return false; + } + + /* Check for PREV changing a register that's used to compute a + value in CMP, even if it doesn't otherwise change flags. */ + if (GET_CODE (operands[0]) == REG + && rtx_referenced_p (SET_DEST (PATTERN (prev)), operands[0])) + { +#if DEBUG_CMP + fprintf(stderr, "sub-value affected, op0:\n"); + debug_rtx(prev); +#endif + return false; + } + if (GET_CODE (operands[1]) == REG + && rtx_referenced_p (SET_DEST (PATTERN (prev)), operands[1])) + { +#if DEBUG_CMP + fprintf(stderr, "sub-value affected, op1:\n"); + debug_rtx(prev); +#endif + return false; + } + } while (pflags == FLAGS_N); #if DEBUG_CMP fprintf(stderr, "previous flag-setting insn:\n"); @@ -4251,7 +4285,7 @@ m32c_output_compare (rtx insn, rtx *operands) } #if DEBUG_CMP - fprintf(stderr, "cbranch: cmp needed: `%s'\n", templ); + fprintf(stderr, "cbranch: cmp needed: `%s'\n", templ + 1); #endif return templ + 1; } -- cgit v1.2.1 From cc24427cdc2401f499a19df7550138f8911ec05e Mon Sep 17 00:00:00 2001 From: dj Date: Mon, 17 Aug 2009 22:25:06 +0000 Subject: * config/m32c/m32c.md (UNS_FSETB, UNS_FREIT): New. * config/m32c/prologue.md (epilogue_freit): New. (fset_b): New. * config/m32c/m32c.c (m32c_function_needs_enter): Add prototype. (bank_switch_p): Likewise. (fast_interrupt_p): Likewise. (interrupt_p): Likewise. (m32c_conditional_register_usage): Round memregs size up. (need_to_save): We only need to save $a0 when we use ENTER. (interrupt_p): Check for fast_interrupt too. (bank_switch_p): New. (fast_interrupt_p): New. (m32c_attribute_table): Add bank_switch and fast_interrupt. (m32c_emit_prolog): Support bank switching and fast interrupts. * doc/extend.texi (Function Attributes): Add bank_switch and fast_interrupt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150862 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 85 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 14 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 46dc4dc6639..ae4c8973dea 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -60,9 +60,13 @@ typedef enum PP_justcount } Push_Pop_Type; +static bool m32c_function_needs_enter (void); static tree interrupt_handler (tree *, tree, tree, int, bool *); static tree function_vector_handler (tree *, tree, tree, int, bool *); static int interrupt_p (tree node); +static int bank_switch_p (tree node); +static int fast_interrupt_p (tree node); +static int interrupt_p (tree node); static bool m32c_asm_integer (rtx, unsigned int, int); static int m32c_comp_type_attributes (const_tree, const_tree); static bool m32c_fixed_condition_code_regs (unsigned int *, unsigned int *); @@ -493,7 +497,7 @@ m32c_conditional_register_usage (void) { /* The command line option is bytes, but our "registers" are 16-bit words. */ - for (i = target_memregs/2; i < 8; i++) + for (i = (target_memregs+1)/2; i < 8; i++) { fixed_regs[MEM0_REGNO + i] = 1; CLEAR_HARD_REG_BIT (reg_class_contents[MEM_REGS], MEM0_REGNO + i); @@ -1255,7 +1259,10 @@ need_to_save (int regno) if (regno == FP_REGNO) return 0; if (cfun->machine->is_interrupt - && (!cfun->machine->is_leaf || regno == A0_REGNO)) + && (!cfun->machine->is_leaf + || (regno == A0_REGNO + && m32c_function_needs_enter ()) + )) return 1; if (df_regs_ever_live_p (regno) && (!call_used_regs[regno] || cfun->machine->is_interrupt)) @@ -2733,6 +2740,34 @@ interrupt_p (tree node ATTRIBUTE_UNUSED) return 1; list = TREE_CHAIN (list); } + return fast_interrupt_p (node); +} + +/* Returns TRUE if the given tree has the "bank_switch" attribute. */ +static int +bank_switch_p (tree node ATTRIBUTE_UNUSED) +{ + tree list = M32C_ATTRIBUTES (node); + while (list) + { + if (is_attribute_p ("bank_switch", TREE_PURPOSE (list))) + return 1; + list = TREE_CHAIN (list); + } + return 0; +} + +/* Returns TRUE if the given tree has the "fast_interrupt" attribute. */ +static int +fast_interrupt_p (tree node ATTRIBUTE_UNUSED) +{ + tree list = M32C_ATTRIBUTES (node); + while (list) + { + if (is_attribute_p ("fast_interrupt", TREE_PURPOSE (list))) + return 1; + list = TREE_CHAIN (list); + } return 0; } @@ -2846,6 +2881,8 @@ current_function_special_page_vector (rtx x) #define TARGET_ATTRIBUTE_TABLE m32c_attribute_table static const struct attribute_spec m32c_attribute_table[] = { {"interrupt", 0, 0, false, false, false, interrupt_handler}, + {"bank_switch", 0, 0, false, false, false, interrupt_handler}, + {"fast_interrupt", 0, 0, false, false, false, interrupt_handler}, {"function_vector", 1, 1, true, false, false, function_vector_handler}, {0, 0, 0, 0, 0, 0, 0} }; @@ -3928,16 +3965,23 @@ m32c_emit_prologue (void) cfun->machine->is_interrupt = 1; complex_prologue = 1; } + else if (bank_switch_p (cfun->decl)) + warning (OPT_Wattributes, + "% has no effect on non-interrupt functions"); reg_save_size = m32c_pushm_popm (PP_justcount); if (interrupt_p (cfun->decl)) - emit_insn (gen_pushm (GEN_INT (cfun->machine->intr_pushm))); + { + if (bank_switch_p (cfun->decl)) + emit_insn (gen_fset_b ()); + else if (cfun->machine->intr_pushm) + emit_insn (gen_pushm (GEN_INT (cfun->machine->intr_pushm))); + } frame_size = m32c_initial_elimination_offset (FB_REGNO, SP_REGNO) - reg_save_size; if (frame_size == 0 - && !cfun->machine->is_interrupt && !m32c_function_needs_enter ()) cfun->machine->use_rts = 1; @@ -3988,16 +4032,29 @@ m32c_emit_epilogue (void) { enum machine_mode spmode = TARGET_A16 ? HImode : PSImode; - emit_move_insn (gen_rtx_REG (spmode, A0_REGNO), - gen_rtx_REG (spmode, FP_REGNO)); - emit_move_insn (gen_rtx_REG (spmode, SP_REGNO), - gen_rtx_REG (spmode, A0_REGNO)); - if (TARGET_A16) - emit_insn (gen_pophi_16 (gen_rtx_REG (HImode, FP_REGNO))); - else - emit_insn (gen_poppsi (gen_rtx_REG (PSImode, FP_REGNO))); - emit_insn (gen_popm (GEN_INT (cfun->machine->intr_pushm))); - if (TARGET_A16) + /* REIT clears B flag and restores $fp for us, but we still + have to fix up the stack. USE_RTS just means we didn't + emit ENTER. */ + if (!cfun->machine->use_rts) + { + emit_move_insn (gen_rtx_REG (spmode, A0_REGNO), + gen_rtx_REG (spmode, FP_REGNO)); + emit_move_insn (gen_rtx_REG (spmode, SP_REGNO), + gen_rtx_REG (spmode, A0_REGNO)); + /* We can't just add this to the POPM because it would be in + the wrong order, and wouldn't fix the stack if we're bank + switching. */ + if (TARGET_A16) + emit_insn (gen_pophi_16 (gen_rtx_REG (HImode, FP_REGNO))); + else + emit_insn (gen_poppsi (gen_rtx_REG (PSImode, FP_REGNO))); + } + if (!bank_switch_p (cfun->decl) && cfun->machine->intr_pushm) + emit_insn (gen_popm (GEN_INT (cfun->machine->intr_pushm))); + + if (fast_interrupt_p (cfun->decl)) + emit_jump_insn (gen_epilogue_freit ()); + else if (TARGET_A16) emit_jump_insn (gen_epilogue_reit_16 ()); else emit_jump_insn (gen_epilogue_reit_24 ()); -- cgit v1.2.1 From bd2fe2f170f478b53aebfe89a9de2bb8a1c83f50 Mon Sep 17 00:00:00 2001 From: dj Date: Wed, 16 Sep 2009 22:18:30 +0000 Subject: * config/m32c/m32c.c (m32c_emit_epilogue): Check for R8C or M16C chip and ignore the "fast_interrupt" attribute if so. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151780 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index ae4c8973dea..1bf3d1bcb2f 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -4052,8 +4052,26 @@ m32c_emit_epilogue (void) if (!bank_switch_p (cfun->decl) && cfun->machine->intr_pushm) emit_insn (gen_popm (GEN_INT (cfun->machine->intr_pushm))); + /* The FREIT (Fast REturn from InTerrupt) instruction should be + generated only for M32C/M32CM targets (generate the REIT + instruction otherwise). */ if (fast_interrupt_p (cfun->decl)) - emit_jump_insn (gen_epilogue_freit ()); + { + /* Check if fast_attribute is set for M32C or M32CM. */ + if (TARGET_A24) + { + emit_jump_insn (gen_epilogue_freit ()); + } + /* If fast_interrupt attribute is set for an R8C or M16C + target ignore this attribute and generated REIT + instruction. */ + else + { + warning (OPT_Wattributes, + "% attribute directive ignored"); + emit_jump_insn (gen_epilogue_reit_16 ()); + } + } else if (TARGET_A16) emit_jump_insn (gen_epilogue_reit_16 ()); else -- cgit v1.2.1 From 557e8bdb0ab7a4143142fb22d96903ad29d67203 Mon Sep 17 00:00:00 2001 From: rth Date: Tue, 22 Sep 2009 15:13:24 +0000 Subject: * config/m32c/m32c-protos.h (m32c_initialize_trampoline): Remove. * config/m32c/m32c.c (TARGET_TRAMPOLINE_INIT): New. (m32c_trampoline_init): Rename from m32c_initialize_trampoline; adjust for hook parameters. * config/m32c/m32c.h (INITIALIZE_TRAMPOLINE): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151996 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 1bf3d1bcb2f..a0689495aa0 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -1717,11 +1717,16 @@ m32c_trampoline_alignment (void) return 2; } -/* Implements INITIALIZE_TRAMPOLINE. */ -void -m32c_initialize_trampoline (rtx tramp, rtx function, rtx chainval) +/* Implements TARGET_TRAMPOLINE_INIT. */ + +#undef TARGET_TRAMPOLINE_INIT +#define TARGET_TRAMPOLINE_INIT m32c_trampoline_init +static void +m32c_trampoline_init (rtx m_tramp, tree fndecl, rtx chainval) { -#define A0(m,i) gen_rtx_MEM (m, plus_constant (tramp, i)) + rtx function = XEXP (DECL_RTL (fndecl), 0); + +#define A0(m,i) adjust_address (m_tramp, m, i) if (TARGET_A16) { /* Note: we subtract a "word" because the moves want signed -- cgit v1.2.1 From f8e7cebd1294cf9a424e36027401c4f394a44ccc Mon Sep 17 00:00:00 2001 From: dj Date: Thu, 24 Sep 2009 20:40:36 +0000 Subject: PR target/41456 * config/m32c/m32c.h (REG_CLASS_CONTENTS): Add R13. (reg_class): Likewise. (REG_CLASS_NAMES): Likewise. * config/m32c/m32c.c (m32c_reg_class_from_constraint): Likewise. * config/m32c/m32c.c (m32c_override_options): Disable -fivopts for M32C. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152144 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index a0689495aa0..4eeedb183e7 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -422,6 +422,9 @@ m32c_override_options (void) } else target_memregs = 16; + + if (TARGET_A24) + flag_ivopts = 0; } /* Defining data structures for per-function information */ @@ -638,6 +641,8 @@ m32c_reg_class_from_constraint (char c ATTRIBUTE_UNUSED, const char *s) return R3_REGS; if (memcmp (s, "R02", 3) == 0) return R02_REGS; + if (memcmp (s, "R13", 3) == 0) + return R13_REGS; if (memcmp (s, "R03", 3) == 0) return R03_REGS; if (memcmp (s, "Rdi", 3) == 0) -- cgit v1.2.1 From f57d8b490bef60249b6079e395efed6d92bef847 Mon Sep 17 00:00:00 2001 From: aesok Date: Thu, 22 Oct 2009 19:46:26 +0000 Subject: * config/m32c/m32c.c (m32c_function_value_regno_p): New function. (m32c_function_value): Make static, add new 'outgoing' argument. (m32c_libcall_value): Make static, add new 'fun' argument. (TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare. * config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove. (FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p. * config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare. (m32c_function_value, m32c_libcall_value): Delete declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153473 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 4eeedb183e7..1085aa7c25a 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -81,6 +81,9 @@ static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *); static rtx m32c_struct_value_rtx (tree, int); static rtx m32c_subreg (enum machine_mode, rtx, enum machine_mode, int); static int need_to_save (int); +static rtx m32c_function_value (const_tree, const_tree, bool); +static rtx m32c_libcall_value (enum machine_mode, const_rtx); + int current_function_special_page_vector (rtx); #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) @@ -1591,15 +1594,19 @@ m32c_valid_pointer_mode (enum machine_mode mode) /* How Scalar Function Values Are Returned */ -/* Implements LIBCALL_VALUE. Most values are returned in $r0, or some +/* Implements TARGET_LIBCALL_VALUE. Most values are returned in $r0, or some combination of registers starting there (r2r0 for longs, r3r1r2r0 for long long, r3r2r1r0 for doubles), except that that ABI currently doesn't work because it ends up using all available general registers and gcc often can't compile it. So, instead, we return anything bigger than 16 bits in "mem0" (effectively, a memory location). */ -rtx -m32c_libcall_value (enum machine_mode mode) + +#undef TARGET_LIBCALL_VALUE +#define TARGET_LIBCALL_VALUE m32c_libcall_value + +static rtx +m32c_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED) { /* return reg or parallel */ #if 0 @@ -1649,14 +1656,28 @@ m32c_libcall_value (enum machine_mode mode) return gen_rtx_REG (mode, R0_REGNO); } -/* Implements FUNCTION_VALUE. Functions and libcalls have the same +/* Implements TARGET_FUNCTION_VALUE. Functions and libcalls have the same conventions. */ -rtx -m32c_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED) + +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE m32c_function_value + +static rtx +m32c_function_value (const_tree valtype, + const_tree fn_decl_or_type ATTRIBUTE_UNUSED, + bool outgoing ATTRIBUTE_UNUSED) { /* return reg or parallel */ const enum machine_mode mode = TYPE_MODE (valtype); - return m32c_libcall_value (mode); + return m32c_libcall_value (mode, NULL_RTX); +} + +/* Implements FUNCTION_VALUE_REGNO_P. */ + +bool +m32c_function_value_regno_p (const unsigned int regno) +{ + return (regno == R0_REGNO || regno == MEM0_REGNO); } /* How Large Values Are Returned */ -- cgit v1.2.1 From a7a4626828090600459358ca745c4482cf9551a1 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 21 May 2010 13:53:22 +0000 Subject: gcc/ChangeLog: * tree.h: Include real.h and fixed-value.h as basic datatypes. * dfp.c, convert.c, reload1.c, reginfo.c, tree-flow.h, tree-ssa-threadedge.c, tree-ssanames.c, tree-loop-linear.c, tree-into-ssa.c, tree-vect-generic.c, tree-ssa-structalias.c, tree-ssa-loop-im.c, tree-dump.c, tree-complex.c, tree-ssa-uninit.c, genrecog.c, tree-ssa-threadupdate.c, tree-ssa-loop-niter.c, tree-pretty-print.c, tree-loop-distribution.c, tree-ssa-loop-unswitch.c, c-lex.c, optabs.c, postreload-gcse.c, tree-ssa-loop-manip.c, postreload.c, tree-ssa-loop-ch.c, tree-tailcall.c, tree.c, reload.c, tree-scalar-evolution.c, rtlanal.c, tree-phinodes.c, builtins.c, final.c, genoutput.c, fold-const.c, tree-ssa-dse.c, genautomata.c, tree-ssa-uncprop.c, toplev.c, tree-chrec.c, genemit.c, c-cppbuiltin.c, tree-ssa-sccvn.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, mode-switching.c, tree-call-cdce.c, cse.c, genpeep.c, tree-ssa-math-opts.c, tree-ssa-dom.c, tree-nrv.c, tree-ssa-propagate.c, tree-ssa-alias.c, tree-ssa-sink.c, jump.c, ifcvt.c, dwarf2out.c, expr.c, genattrtab.c, genconditions.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop.c, tree-parloops.c, recog.c, tree-ssa-address.c, lcm.c, tree-eh.c, gimple-pretty-print.c, c-pretty-print.c, print-rtl.c, gcse.c, tree-if-conv.c, tree-data-ref.c, tree-affine.c, gimplify.c, tree-ssa-phiopt.c, implicit-zee.c, expmed.c, tree-dfa.c, emit-rtl.c, store-motion.c, cselib.c, tree-cfgcleanup.c, simplify-rtx.c, tree-ssa-pre.c, genpreds.c, tree-mudflap.c, print-tree.c, tree-ssa-copy.c, tree-ssa-forwprop.c, tree-ssa-dce.c, varasm.c, tree-nested.c, tree-ssa.c, tree-ssa-loop-prefetch.c, rtl.c, tree-inline.c, integrate.c, tree-optimize.c, tree-ssa-phiprop.c, fixed-value.c, combine.c, tree-profile.c, c-common.c, sched-vis.c, tree-cfg.c, passes.c, tree-ssa-reassoc.c, config/alpha/alpha.c, config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c, config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c, config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c, config/sh/sh.c, config/pdp11/pdp11.c, config/avr/avr.c, config/crx/crx.c, config/xtensa/xtensa.c, config/stormy16/stormy16.c, config/fr30/fr30.c, config/lm32/lm32.c, config/moxie/moxie.c, config/m68hc11/m68hc11.c, config/cris/cris.c, config/iq2000/iq2000.c, config/mn10300/mn10300.c, config/ia64/ia64.c, config/m68k/m68k.c, config/rs6000/rs6000.c, config/picochip/picochip.c, config/darwin.c, config/arc/arc.c, config/mcore/mcore.c, config/score/score3.c, config/score/score7.c, config/score/score.c, config/arm/arm.c, config/pa/pa.c, config/mips/mips.c, config/vax/vax.c, config/h8300/h8300.c, config/v850/v850.c, config/mmix/mmix.c, config/bfin/bfin.c: Clean up redundant includes. * Makefile.in: Update accordingly. java/ChangeLog: * typeck.c, decl.c, jcf-parse.c, except.c, expr.c: cp/Changelog: * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c: Clean up redundant includes. fortran/ChangeLog: * trans-const.c, trans-types.c, trans-intrinsic.c: Clean up redundant includes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159663 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 1085aa7c25a..cfc4a1593b6 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -26,7 +26,6 @@ #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" -#include "real.h" #include "insn-config.h" #include "conditions.h" #include "insn-flags.h" -- cgit v1.2.1 From ba72912a012b97cad825eebee3f5f22253d0afe4 Mon Sep 17 00:00:00 2001 From: lauras Date: Tue, 8 Jun 2010 07:25:24 +0000 Subject: gcc/ada: 2010-06-08 Laurynas Biveinis * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160425 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index cfc4a1593b6..3280d14e78e 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -435,11 +435,7 @@ m32c_override_options (void) static struct machine_function * m32c_init_machine_status (void) { - struct machine_function *machine; - machine = - (machine_function *) ggc_alloc_cleared (sizeof (machine_function)); - - return machine; + return ggc_alloc_cleared_machine_function (); } /* Implements INIT_EXPANDERS. We just set up to call the above -- cgit v1.2.1 From e3d4e41e4c241bb6f214d5accb492d393afb8da8 Mon Sep 17 00:00:00 2001 From: dj Date: Sat, 26 Jun 2010 03:30:19 +0000 Subject: * config/m32c/m32c-protos.h (m32c_note_pragma_address): Declare. (m32c_output_aligned_common): Likewise. * config/m32c/m32c.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): New. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): New. * config/m32c/m32c-pragma.c (m32c_pragma_address): New. (m32c_register_pragmas): Register it. * config/m32c/m32c.c (m32c_get_pragma_address): New. (m32c_insert_attributes): Set #pragma address decls volatile. (pragma_entry_eq): New. (pragma_entry_hash): New. (m32c_note_pragma_address): New. (m32c_get_pragma_address): New. (m32c_output_aligned_common): New. * doc/extend.texi: Document the new pragma. * config/m32c/m32c.c (m32c_illegal_subreg_p): Reject illegal MEMs also. * config/m32c/predicates.md (m32c_any_operand): Check the code instead of memory_operand so as to allow matching volatile MEMs. (m32c_nonimmediate_operand): Likewise. (mra_operand): Allow volatiles. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161425 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 3280d14e78e..443325f8dd9 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -83,6 +83,9 @@ static int need_to_save (int); static rtx m32c_function_value (const_tree, const_tree, bool); static rtx m32c_libcall_value (enum machine_mode, const_rtx); +/* Returns true if an address is specified, else false. */ +static bool m32c_get_pragma_address (const char *varname, unsigned *addr); + int current_function_special_page_vector (rtx); #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) @@ -2929,7 +2932,107 @@ static void m32c_insert_attributes (tree node ATTRIBUTE_UNUSED, tree * attr_ptr ATTRIBUTE_UNUSED) { - /* Nothing to do here. */ + unsigned addr; + /* See if we need to make #pragma address variables volatile. */ + + if (TREE_CODE (node) == VAR_DECL) + { + char *name = IDENTIFIER_POINTER (DECL_NAME (node)); + if (m32c_get_pragma_address (name, &addr)) + { + TREE_THIS_VOLATILE (node) = true; + } + } +} + + +struct GTY(()) pragma_entry { + const char *varname; + unsigned address; +}; +typedef struct pragma_entry pragma_entry; + +/* Hash table of pragma info. */ +static GTY((param_is (pragma_entry))) htab_t pragma_htab; + +static int +pragma_entry_eq (const void *p1, const void *p2) +{ + const pragma_entry *old = (const pragma_entry *) p1; + const char *new_name = (const char *) p2; + + return strcmp (old->varname, new_name) == 0; +} + +static hashval_t +pragma_entry_hash (const void *p) +{ + const pragma_entry *old = (const pragma_entry *) p; + return htab_hash_string (old->varname); +} + +void +m32c_note_pragma_address (const char *varname, unsigned address) +{ + pragma_entry **slot; + + if (!pragma_htab) + pragma_htab = htab_create_ggc (31, pragma_entry_hash, + pragma_entry_eq, NULL); + + slot = (pragma_entry **) + htab_find_slot_with_hash (pragma_htab, varname, + htab_hash_string (varname), INSERT); + + if (!*slot) + { + *slot = ggc_alloc_pragma_entry (); + (*slot)->varname = ggc_strdup (varname); + } + (*slot)->address = address; +} + +static bool +m32c_get_pragma_address (const char *varname, unsigned *address) +{ + pragma_entry **slot; + + if (!pragma_htab) + return false; + + slot = (pragma_entry **) + htab_find_slot_with_hash (pragma_htab, varname, + htab_hash_string (varname), NO_INSERT); + if (slot && *slot) + { + *address = (*slot)->address; + return true; + } + return false; +} + +void +m32c_output_aligned_common (FILE *stream, tree decl, const char *name, + int size, int align, int global) +{ + unsigned address; + + if (m32c_get_pragma_address (name, &address)) + { + /* We never output these as global. */ + assemble_name (stream, name); + fprintf (stream, " = 0x%04x\n", address); + return; + } + if (!global) + { + fprintf (stream, "\t.local\t"); + assemble_name (stream, name); + fprintf (stream, "\n"); + } + fprintf (stream, "\t.comm\t"); + assemble_name (stream, name); + fprintf (stream, ",%u,%u\n", size, align / BITS_PER_UNIT); } /* Predicates */ @@ -2960,7 +3063,7 @@ static const struct { }; /* Returns TRUE if OP is a subreg of a hard reg which we don't - support. */ + support. We also bail on MEMs with illegal addresses. */ bool m32c_illegal_subreg_p (rtx op) { @@ -2968,6 +3071,12 @@ m32c_illegal_subreg_p (rtx op) unsigned int i; int src_mode, dest_mode; + if (GET_CODE (op) == MEM + && ! m32c_legitimate_address_p (Pmode, XEXP (op, 0), false)) + { + return true; + } + if (GET_CODE (op) != SUBREG) return false; -- cgit v1.2.1 From d6bf3b142da7fb201b42a7ca49a1a27c04df4bb0 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Sun, 4 Jul 2010 22:13:09 +0000 Subject: gcc/ * optabs.h (optab_handler, convert_optab_handler): Turn into inline functions that return an insn code. (set_optab_handler, set_convert_optab_handler): New functions. * builtins.c: Replace optab_handler(X)->insn_code with optab_handler or set_optab_handler thoughout. Likewise convert_optab_handler(X)->insn_code with convert_optab_handler and set_convert_optab_handler. * expmed.c, expr.c, genopinit.c, ifcvt.c, optabs.c, reload.c, reload1.c, stmt.c, targhooks.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, config/m32c/m32c.c, config/rs6000/rs6000.c, config/spu/spu.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161808 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 443325f8dd9..d7a047a8b57 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -1789,9 +1789,9 @@ m32c_init_libfuncs (void) the right modes are found. */ if (TARGET_A24) { - optab_handler (cstore_optab, QImode)->insn_code = CODE_FOR_cstoreqi4_24; - optab_handler (cstore_optab, HImode)->insn_code = CODE_FOR_cstorehi4_24; - optab_handler (cstore_optab, PSImode)->insn_code = CODE_FOR_cstorepsi4_24; + set_optab_handler (cstore_optab, QImode, CODE_FOR_cstoreqi4_24); + set_optab_handler (cstore_optab, HImode, CODE_FOR_cstorehi4_24); + set_optab_handler (cstore_optab, PSImode, CODE_FOR_cstorepsi4_24); } } -- cgit v1.2.1 From 0b205f4ca112a643f4f1b9c9886648b569e0b380 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 8 Jul 2010 04:22:54 +0000 Subject: =?UTF-8?q?2010-07-08=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index d7a047a8b57..3b32a7afb36 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -34,6 +34,7 @@ #include "flags.h" #include "recog.h" #include "reload.h" +#include "diagnostic-core.h" #include "toplev.h" #include "obstack.h" #include "tree.h" -- cgit v1.2.1 From 1af17d44fddd5f5189c2ff063d63f30bbbb9a435 Mon Sep 17 00:00:00 2001 From: dj Date: Tue, 13 Jul 2010 19:43:30 +0000 Subject: * config/h8300/h8300.c (h8300_init_once): Default to -fstrict_volatile_bitfields. * config/sh/sh.c (sh_override_options): Default to -fstrict_volatile_bitfields. * config/rx/rx.c (rx_option_override): New. * config/m32c/m32c.c (m32c_override_options): Default to -fstrict_volatile_bitfields. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162149 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m32c/m32c.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/config/m32c/m32c.c') diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 3b32a7afb36..7ffd146b2df 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -431,6 +431,10 @@ m32c_override_options (void) if (TARGET_A24) flag_ivopts = 0; + + /* This target defaults to strict volatile bitfields. */ + if (flag_strict_volatile_bitfields < 0) + flag_strict_volatile_bitfields = 1; } /* Defining data structures for per-function information */ -- cgit v1.2.1