OSDN Git Service

gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2007 09:04:09 +0000 (09:04 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2007 09:04:09 +0000 (09:04 +0000)
* config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
functions that need a constant pool.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122610 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68k/m68k.c

index 69978a3..249d3e8 100644 (file)
@@ -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.
index b702f85..1d7b448 100644 (file)
@@ -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)