diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.c | 4 | ||||
-rw-r--r-- | gcc/except.c | 2 | ||||
-rw-r--r-- | gcc/function.h | 9 | ||||
-rw-r--r-- | gcc/reload1.c | 8 |
5 files changed, 23 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04922ebca13..ec6b104d014 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2007-09-07 Roman Zippel <zippel@linux-m68k.org> + + * function.h (struct function): Rename calls_unwind_init + to saves_all_registers. + (current_function_saves_all_registers): Renamed from + current_function_calls_unwind_init. + * reload1.c (reload): Set current_function_saves_all_registers. + * except.c (expand_builtin_unwind_init): Likewise. + * config/m68k/m68k.c (m68k_save_reg): Use + current_function_saves_all_registers to save pic register. + 2007-09-07 Janis Johnson <janis187@us.ibm.com> config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index cd7f493815c..8f7aa34f228 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -780,9 +780,7 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler) { if (flag_pic && regno == PIC_REG) { - /* A function that receives a nonlocal goto must save all call-saved - registers. */ - if (current_function_has_nonlocal_label) + if (current_function_saves_all_registers) return true; if (current_function_uses_pic_offset_table) return true; diff --git a/gcc/except.c b/gcc/except.c index 02131eeb0fe..f3204eb863a 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2867,7 +2867,7 @@ expand_builtin_unwind_init (void) { /* Set this so all the registers get saved in our frame; we need to be able to copy the saved values for any registers from frames we unwind. */ - current_function_calls_unwind_init = 1; + current_function_saves_all_registers = 1; #ifdef SETUP_FRAME_ADDRESSES SETUP_FRAME_ADDRESSES (); diff --git a/gcc/function.h b/gcc/function.h index 1317d81f4e6..27bde1c3bd0 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -387,9 +387,10 @@ struct function GTY(()) from nested functions. */ unsigned int has_nonlocal_label : 1; - /* Nonzero if function calls builtin_unwind_init. */ - unsigned int calls_unwind_init : 1; - + /* Nonzero if function saves all registers, e.g. if it has a nonlocal + label that can reach the exit block via non-exceptional paths. */ + unsigned int saves_all_registers : 1; + /* Nonzero if function being compiled has nonlocal gotos to parent function. */ unsigned int has_nonlocal_goto : 1; @@ -503,7 +504,7 @@ extern void pop_cfun (void); #define current_function_uses_const_pool (cfun->uses_const_pool) #define current_function_epilogue_delay_list (cfun->epilogue_delay_list) #define current_function_has_nonlocal_label (cfun->has_nonlocal_label) -#define current_function_calls_unwind_init (cfun->calls_unwind_init) +#define current_function_saves_all_registers (cfun->saves_all_registers) #define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto) #define current_function_has_asm_statement (cfun->has_asm_statement) diff --git a/gcc/reload1.c b/gcc/reload1.c index dada8921716..270ea0654cf 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -743,9 +743,11 @@ reload (rtx first, int global) /* A function that has a nonlocal label that can reach the exit block via non-exceptional paths must save all call-saved registers. */ - if (current_function_calls_unwind_init - || (current_function_has_nonlocal_label - && has_nonexceptional_receiver ())) + if (current_function_has_nonlocal_label + && has_nonexceptional_receiver ()) + current_function_saves_all_registers = 1; + + if (current_function_saves_all_registers) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i)) df_set_regs_ever_live (i, true); |