* [trans-mem] fix begin_transaction ABI on ia32
@ 2010-07-13 15:52 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2010-07-13 15:52 UTC (permalink / raw)
To: rth, gcc-patches
We were calling begin_transaction() with the arguments in the registers,
but the function was expecting them on the stack.
Richard said this was an oversight while converting into C++.
With this patch transactions are now working on ia32, though there are
still 2 distinct failures left on the testsuite. I will fix these next.
Applying as obvious.
* libitm.h: Add comment.
* libitm_i.h (begin_transaction): Add ITM_REGPARM.
Index: libitm.h
===================================================================
--- libitm.h (revision 161883)
+++ libitm.h (working copy)
@@ -37,6 +37,7 @@ extern "C" {
#endif
#ifdef __i386__
+/* Only for 32-bit x86. */
# define ITM_REGPARM __attribute__((regparm(2)))
#else
# define ITM_REGPARM
Index: libitm_i.h
===================================================================
--- libitm_i.h (revision 161512)
+++ libitm_i.h (working copy)
@@ -244,7 +244,7 @@ struct gtm_transaction
// Invoked from assembly language, thus the "asm" specifier on
// the name, avoiding complex name mangling.
static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *)
- __asm__("GTM_begin_transaction");
+ __asm__("GTM_begin_transaction") ITM_REGPARM;
// In eh_cpp.cc
void revert_cpp_exceptions ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-13 15:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-13 15:52 [trans-mem] fix begin_transaction ABI on ia32 Aldy Hernandez
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).