diff mbox

[committed] Replace abort instruction with __builtin_trap() in config/pa/linux_atomic.c

Message ID BLU436-SMTP69FAF44A9414D0C5C80FC597720@phx.gbl
State New
Headers show

Commit Message

John David Anglin Nov. 24, 2014, 11:45 p.m. UTC
The attached change uses __builtin_trap() instead of an asm as the  
compiler can better
optimize code using __builtin_trap.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
--
John David Anglin	dave.anglin@bell.net
2014-11-24  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/linux-atomic.c (ABORT_INSTRUCTION): Use __builtin_trap()
	instead.
diff mbox

Patch

Index: config/pa/linux-atomic.c
===================================================================
--- config/pa/linux-atomic.c	(revision 217974)
+++ config/pa/linux-atomic.c	(working copy)
@@ -41,9 +41,6 @@ 
    using the kernel helper defined below.  There is no support for
    64-bit operations yet.  */
 
-/* A privileged instruction to crash a userspace program with SIGILL.  */
-#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%sr0, %r0)")
-
 /* Determine kernel LWS function call (0=32-bit, 1=64-bit userspace).  */
 #define LWS_CAS (sizeof(long) == 4 ? 0 : 1)
 
@@ -64,7 +61,7 @@ 
 	: "r1", "r20", "r22", "r23", "r29", "r31", "memory"
   );
   if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0))
-    ABORT_INSTRUCTION;
+    __builtin_trap ();
 
   /* If the kernel LWS call succeeded (lws_errno == 0), lws_ret contains
      the old value from memory.  If this value is equal to OLDVAL, the
@@ -91,7 +88,7 @@ 
 	: "r1", "r20", "r22", "r29", "r31", "fr4", "memory"
   );
   if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0))
-    ABORT_INSTRUCTION;
+    __builtin_trap ();
 
   /* If the kernel LWS call fails, retrun EBUSY */
   if (!lws_errno && lws_ret)