diff options
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 0e860b6d3cc..d84eb9b5595 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1,6 +1,7 @@ /* Subroutines used for MIPS code generation. Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by A. Lichnewsky, lich@inria.inria.fr. Changes by Michael Meissner, meissner@osf.org. 64-bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and @@ -6337,7 +6338,7 @@ mips_global_pointer (void) In cases like these, reload will have added the constant to the pool but no instruction will yet refer to it. */ - if (!regs_ever_live[GLOBAL_POINTER_REGNUM] + if (!df_regs_ever_live_p (GLOBAL_POINTER_REGNUM) && !current_function_uses_const_pool && !mips_function_has_gp_insn ()) return 0; @@ -6346,7 +6347,7 @@ mips_global_pointer (void) register instead of $gp. */ if (TARGET_CALL_SAVED_GP && current_function_is_leaf) for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) - if (!regs_ever_live[regno] + if (!df_regs_ever_live_p (regno) && call_used_regs[regno] && !fixed_regs[regno] && regno != PIC_FUNCTION_ADDR_REGNUM) @@ -6412,15 +6413,15 @@ mips_save_reg_p (unsigned int regno) return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno; /* Check call-saved registers. */ - if (regs_ever_live[regno] && !call_used_regs[regno]) + if (df_regs_ever_live_p (regno) && !call_used_regs[regno]) return true; /* Save both registers in an FPR pair if either one is used. This is needed for the case when MIN_FPRS_PER_FMT == 1, which allows the odd register to be used without the even register. */ if (FP_REG_P (regno) - && MAX_FPRS_PER_FMT == 2 - && regs_ever_live[regno + 1] + && MAX_FPRS_PER_FMT == 2 + && df_regs_ever_live_p (regno + 1) && !call_used_regs[regno + 1]) return true; @@ -6430,7 +6431,7 @@ mips_save_reg_p (unsigned int regno) /* We need to save the incoming return address if it is ever clobbered within the function. */ - if (regno == GP_REG_FIRST + 31 && regs_ever_live[regno]) + if (regno == GP_REG_FIRST + 31 && df_regs_ever_live_p (regno)) return true; if (TARGET_MIPS16) @@ -6438,7 +6439,7 @@ mips_save_reg_p (unsigned int regno) /* $18 is a special case in mips16 code. It may be used to call a function which returns a floating point value, but it is marked in call_used_regs. */ - if (regno == GP_REG_FIRST + 18 && regs_ever_live[regno]) + if (regno == GP_REG_FIRST + 18 && df_regs_ever_live_p (regno)) return true; /* $31 is also a special case. It will be used to copy a return @@ -6990,7 +6991,7 @@ mips_expand_prologue (void) HOST_WIDE_INT size; if (cfun->machine->global_pointer > 0) - REGNO (pic_offset_table_rtx) = cfun->machine->global_pointer; + SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer); size = compute_frame_size (get_frame_size ()); @@ -7099,7 +7100,7 @@ mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* Reinstate the normal $gp. */ - REGNO (pic_offset_table_rtx) = GLOBAL_POINTER_REGNUM; + SET_REGNO (pic_offset_table_rtx, GLOBAL_POINTER_REGNUM); mips_output_cplocal (); if (cfun->machine->all_noreorder_p) @@ -7296,7 +7297,7 @@ mips_can_use_return_insn (void) if (! reload_completed) return 0; - if (regs_ever_live[31] || current_function_profile) + if (df_regs_ever_live_p (31) || current_function_profile) return 0; /* In mips16 mode, a function that returns a floating point value @@ -7331,9 +7332,13 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, /* Pick a global pointer. Use a call-clobbered register if TARGET_CALL_SAVED_GP, so that we can use a sibcall. */ if (TARGET_USE_GOT) - cfun->machine->global_pointer - = REGNO (pic_offset_table_rtx) - = TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM; + { + cfun->machine->global_pointer = + TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM; + + SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer); + + } /* Set up the global pointer for n32 or n64 abicalls. If LOADGP_ABSOLUTE then the thunk does not use the gp and there is @@ -8387,7 +8392,7 @@ build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code) /* If we are handling a floating point return value, we need to save $18 in the function prologue. Putting a note on the - call will mean that regs_ever_live[$18] will be true if the + call will mean that df_regs_ever_live_p ($18) will be true if the call is not eliminated, and we can check that in the prologue code. */ if (fpret) |