diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-03-06 09:04:09 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-03-06 09:04:09 +0000 |
commit | 6357eb0da4207f2c0ff0672ee206582b5405f98a (patch) | |
tree | dcbc17fd73cab87dbdc78d39c5c82584d3889e57 | |
parent | ffa2596e3aae16e6bc2254c954b52ea504a612b6 (diff) | |
download | gcc-6357eb0da4207f2c0ff0672ee206582b5405f98a.zip gcc-6357eb0da4207f2c0ff0672ee206582b5405f98a.tar.gz gcc-6357eb0da4207f2c0ff0672ee206582b5405f98a.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69978a3..249d3e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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 * config/m68k/m68k-protos.h (m68k_secondary_reload_class): Declare. (m68k_preferred_reload_class): Likewise. diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index b702f85..1d7b448 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) |