m68k.c (m68k_save_reg): Save the PIC register in functions that call eh_return.
authorRichard Sandiford <richard@codesourcery.com>
Tue, 6 Mar 2007 09:04:27 +0000 (09:04 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 6 Mar 2007 09:04:27 +0000 (09:04 +0000)
gcc/
* config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
functions that call eh_return.

From-SVN: r122611

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

index 249d3e85dbd672492d228dcd3a8c3f3ed1b8754d..e97479851729830eb2bf813edc505680522d7664 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-06  Richard Sandiford  <richard@codesourcery.com>
+
+       * config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
+       functions that call eh_return.
+
 2007-03-06  Richard Sandiford  <richard@codesourcery.com>
 
        * config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
index 1d7b44864c14c28daa705ffca01db51c8ac8743d..642927e7d824aba477cf5cde1cdd7470d449a6c3 100644 (file)
@@ -747,6 +747,10 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler)
 {
   if (flag_pic && regno == PIC_OFFSET_TABLE_REGNUM)
     {
+      /* A function that receives a nonlocal goto must save all call-saved
+        registers.  */
+      if (current_function_has_nonlocal_label)
+       return true;
       if (current_function_uses_pic_offset_table)
        return true;
       /* Reload may introduce constant pool references into a function