Commit 6357eb0d by Richard Sandiford Committed by Richard Sandiford

m68k.c (m68k_save_reg): Save the PIC register in functions that need a constant pool.

gcc/
	* config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
	functions that need a constant pool.

From-SVN: r122610
parent ffa2596e
2007-03-06 Richard Sandiford <richard@codesourcery.com> 2007-03-06 Richard Sandiford <richard@codesourcery.com>
* config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
functions that need a constant pool.
2007-03-06 Richard Sandiford <richard@codesourcery.com>
PR target/28181 PR target/28181
* config/m68k/m68k-protos.h (m68k_secondary_reload_class): Declare. * config/m68k/m68k-protos.h (m68k_secondary_reload_class): Declare.
(m68k_preferred_reload_class): Likewise. (m68k_preferred_reload_class): Likewise.
......
...@@ -749,6 +749,13 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler) ...@@ -749,6 +749,13 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler)
{ {
if (current_function_uses_pic_offset_table) if (current_function_uses_pic_offset_table)
return true; 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) if (current_function_calls_eh_return)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment