diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69978a31686..249d3e85dbd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-06 Richard Sandiford + + * config/m68k/m68k.c (m68k_save_reg): Save the PIC register in + functions that need a constant pool. + 2007-03-06 Richard Sandiford PR target/28181 diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index b702f85e47f..1d7b44864c1 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -749,6 +749,13 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler) { if (current_function_uses_pic_offset_table) return true; + /* Reload may introduce constant pool references into a function + that thitherto didn't need a PIC register. Note that the test + above will not catch that case because we will only set + current_function_uses_pic_offset_table when emitting + the address reloads. */ + if (current_function_uses_const_pool) + return true; } if (current_function_calls_eh_return)