]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
m68k.c (m68k_save_reg): Also save A5 for non-leaf functions when -mid-shared-library...
authorAndrea Tarani <andrea.tarani@gilbarco.com>
Thu, 24 Feb 2005 01:51:30 +0000 (01:51 +0000)
committerBernardo Innocenti <bernie@gcc.gnu.org>
Thu, 24 Feb 2005 01:51:30 +0000 (02:51 +0100)
* config/m68k/m68k.c (m68k_save_reg): Also save A5 for non-leaf
functions when -mid-shared-library is being used.

From-SVN: r95487

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

index a7fb0dfed53ad4a88efeb1aa7cc6a90cebd58613..d2321110ade039ce52b7ddf31079308faa03a70d 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-24  Andrea Tarani  <andrea.tarani@gilbarco.com>
+
+       * config/m68k/m68k.c (m68k_save_reg): Also save A5 for non-leaf
+       functions when -mid-shared-library is being used.
+
 2005-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * doc/tm.texi (LINK_LIBGCC_SPECIAL): Remove.
index 1db78d93d21f7072050c518641809460ae2faf87..e3ac6fada8578960326f9137a022e071a72d5383 100644 (file)
@@ -371,9 +371,13 @@ m68k_initial_elimination_offset (int from, int to)
 static bool
 m68k_save_reg (unsigned int regno, bool interrupt_handler)
 {
-  if (flag_pic && current_function_uses_pic_offset_table
-      && regno == PIC_OFFSET_TABLE_REGNUM)
-    return true;
+  if (flag_pic && regno == PIC_OFFSET_TABLE_REGNUM)
+    {
+      if (current_function_uses_pic_offset_table)
+       return true;
+      if (!current_function_is_leaf && TARGET_ID_SHARED_LIBRARY)
+       return true;
+    }
 
   if (current_function_calls_eh_return)
     {