]> gcc.gnu.org Git - gcc.git/commitdiff
alpha.c (alpha_pad_noreturn): New static function.
authorUros Bizjak <uros@gcc.gnu.org>
Sun, 21 Dec 2008 11:50:59 +0000 (12:50 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 21 Dec 2008 11:50:59 +0000 (12:50 +0100)
* config/alpha/alpha.c (alpha_pad_noreturn): New static function.
(alpha_reorg): Call alpha_pad_noreturn.

From-SVN: r142858

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 65faf39f5dd3a06a12c00e0f33e6b8c7d027975a..98b4531d23085ad3d4bffceb7f717a45fff085b1 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/alpha/alpha.c (alpha_pad_noreturn): New static function.
+       (alpha_reorg): Call alpha_pad_noreturn.
+
 2008-12-21  Denis Chertykov  <denisc@overta.ru>
 
        * config/avr/avr.md ("andsi3"): Fix wrong cc attribute.
 
 2008-12-17  Sebastian Pop  <sebastian.pop@amd.com>
 
-        * doc/install.texi (Prerequisites): Document PPL and CLooG-PPL
-        dependences and the configure options.
-        (Configuration): Document --with-cloog, --with-ppl, --with-cloog-lib,
-         --with-ppl-lib, --with-cloog-incude, --with-ppl-include.
+       * doc/install.texi (Prerequisites): Document PPL and CLooG-PPL
+       dependences and the configure options.
+       (Configuration): Document --with-cloog, --with-ppl, --with-cloog-lib,
+       --with-ppl-lib, --with-cloog-incude, --with-ppl-include.
 
 2008-12-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        for the milli.a library.
 
 2008-12-12  Andrew Pinski  <andrew_pinskia@playstation.sony.com>
-            Peter Bergner <bergner@vnet.ibm.com>
+           Peter Bergner <bergner@vnet.ibm.com>
 
        PR target/24779
        * config/rs6000/rs6000.md (call_indirect_aix32): Move the load of the
index 52ae122f6eda28644707e205383f1e9ab819bc33..d9ed21fba497270e81dc0f01e9b1c550ba0e8ace 100644 (file)
@@ -9299,12 +9299,66 @@ alpha_align_insns (unsigned int max_align,
       i = next;
     }
 }
+
+/* Insert an unop between a noreturn function call and GP load.  */
+
+static void
+alpha_pad_noreturn (void)
+{
+  rtx insn, next;
+
+  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+    {
+      if (!CALL_P (insn)
+         || !find_reg_note (insn, REG_NORETURN, NULL_RTX))
+        continue;
+
+      next = next_active_insn (insn);
+
+      if (next)
+       {
+         rtx pat = PATTERN (next);
+
+         if (GET_CODE (pat) == SET
+             && GET_CODE (SET_SRC (pat)) == UNSPEC_VOLATILE
+             && XINT (SET_SRC (pat), 1) == UNSPECV_LDGP1)
+           emit_insn_after (gen_unop (), insn);
+       }
+    }
+}
 \f
 /* Machine dependent reorg pass.  */
 
 static void
 alpha_reorg (void)
 {
+  /* Workaround for a linker error that triggers when an
+     exception handler immediatelly follows a noreturn function.
+
+     The instruction stream from an object file:
+
+  54:   00 40 5b 6b     jsr     ra,(t12),58 <__func+0x58>
+  58:   00 00 ba 27     ldah    gp,0(ra)
+  5c:   00 00 bd 23     lda     gp,0(gp)
+  60:   00 00 7d a7     ldq     t12,0(gp)
+  64:   00 40 5b 6b     jsr     ra,(t12),68 <__func+0x68>
+
+     was converted in the final link pass to:
+
+   fdb24:       a0 03 40 d3     bsr     ra,fe9a8 <_called_func+0x8>
+   fdb28:       00 00 fe 2f     unop
+   fdb2c:       00 00 fe 2f     unop
+   fdb30:       30 82 7d a7     ldq     t12,-32208(gp)
+   fdb34:       00 40 5b 6b     jsr     ra,(t12),fdb38 <__func+0x68>
+
+     GP load instructions were wrongly cleared by the linker relaxation
+     pass.  This workaround prevents removal of GP loads by inserting
+     an unop instruction between a noreturn function call and
+     exception handler prologue.  */
+
+  if (current_function_has_exception_handlers ())
+    alpha_pad_noreturn ();
+
   if (alpha_tp != ALPHA_TP_PROG || flag_exceptions)
     alpha_handle_trap_shadows ();
 
This page took 0.097143 seconds and 5 git commands to generate.