public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Straying #endif in ppc_closure.S
@ 2013-11-17  3:17 Alan Modra
  2013-11-18 11:38 ` Anthony Green
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2013-11-17  3:17 UTC (permalink / raw)
  To: libffi-discuss

An #endif in the wrong place would cause compile failure on powerpcle.
Using bl instead of b doesn't cause runtime failures as you might think,
but does mess the processor branch prediction.

	* src/powerpc/ppc_closure.S: Move errant #endif to where it belongs.
	Don't bl .Luint128.

diff --git a/src/powerpc/ppc_closure.S b/src/powerpc/ppc_closure.S
index 3eefe7e..1f72340 100644
--- a/src/powerpc/ppc_closure.S
+++ b/src/powerpc/ppc_closure.S
@@ -238,7 +238,7 @@ ENTRY(ffi_closure_SYSV)
 	lwz %r3,112+0(%r1)
 	lwz %r4,112+4(%r1)
 	lwz %r5,112+8(%r1)
-	bl .Luint128
+	b .Luint128
 
 # The return types below are only used when the ABI type is FFI_SYSV.
 # case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct.
@@ -320,13 +320,13 @@ ENTRY(ffi_closure_SYSV)
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
+#endif
 
 .Luint128:
 	lwz %r6,112+12(%r1)
 	mtlr %r0
 	addi %r1,%r1,144
 	blr
-#endif
 	
 END(ffi_closure_SYSV)
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-30  5:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-17  3:17 Straying #endif in ppc_closure.S Alan Modra
2013-11-18 11:38 ` Anthony Green
2013-11-19  0:14   ` Alan Modra
2013-11-20  7:35     ` PowerPC64 ELFv2 fix 2 of 2 Alan Modra
2013-11-20  7:38     ` Tidy powerpc*-linux support Alan Modra
2014-05-30  5:10       ` Ryan Hill

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).