public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, alpha]: Fix PR 71145: Error: No lda !gpdisp!278 was found
@ 2016-05-18 19:32 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2016-05-18 19:32 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

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  <ubizjak@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.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 623 bytes --]

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)";
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-18 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18 19:32 [PATCH, alpha]: Fix PR 71145: Error: No lda !gpdisp!278 was found Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).