Hello!

Alpha assembler requires that matching "lda $29,0($29)
!gpdisp!NNN" always follow "ldah $29,0($26)        !gpdisp!NNN".
However, when the compiler inserts trap insn, it (correctly) figures
out that $29 is unused, and removes "lda" from insn stream. Since ldah
is defined as unspec_volatile, it remains present.

The solution is to make trap insn dependent on register $29.

2016-05-18  Uros Bizjak  <ubiz...@gmail.com>

    PR target/71145
    * config/alpha/alpha.md (trap): Add (use (reg:DI 29)).
    (*exception_receiver_1): Return "#" for TARGET_EXPLICIT_RELOCS.

Patch was bootstrapped and regression tested on alpha-linux-gnu.

Commited to mainline and all release branches.

Uros.
Index: alpha.md
===================================================================
--- alpha.md    (revision 236296)
+++ alpha.md    (working copy)
@@ -3738,7 +3738,8 @@
 
 ;; BUGCHK is documented common to OSF/1 and VMS PALcode.
 (define_insn "trap"
-  [(trap_if (const_int 1) (const_int 0))]
+  [(trap_if (const_int 1) (const_int 0))
+   (use (reg:DI 29))]
   ""
   "call_pal 0x81"
   [(set_attr "type" "callpal")])
@@ -5157,7 +5158,7 @@
   "TARGET_ABI_OSF"
 {
   if (TARGET_EXPLICIT_RELOCS)
-    return "ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*";
+    return "#";
   else
     return "ldgp $29,0($26)";
 }

Reply via email to