This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[trans-mem] remove unused argument to GTM_longjmp


Howdy!

On x86, the library is clobbering the third argument to GTM_longjmp
(properties).  For example, on x86-64 the properties (3rd arg) get
passed on DX which gets clobbered right at the beginning:

	GTM_longjmp:
		.cfi_startproc
	#ifdef __LP64__
		movq	(%rdi), %rcx
		movq	8(%rdi), %rdx		<-- clobber
		...

On x86-32 we just ignore it, since the third argument comes in the stack
and we don't even bother looking at the stack:

	xchgl	%eax, %edx
	movl	(%edx), %ecx
	movl	4(%edx), %ebx
	movl	8(%edx), %esi
	movl	12(%edx), %edi
	movl	16(%edx), %ebp
	movl	20(%edx), %edx
	.cfi_def_cfa %ecx, 0
	.cfi_register %eip, %edx
	movl	%ecx, %esp			<-- ignore stack

I didn't look at the alpha port, as I don't speak alpheese.

Were you planning on using the properties argument, or can we remove it
as with the patch below?

Aldy

	* beginend.cc (_ITM_abortTransaction): Remove last argument to
	GTM_longjmp.
	(GTM::gtm_transaction::restart): Same.
	* libitm_i.h (GTM_longjmp): Same.

Index: beginend.cc
===================================================================
--- beginend.cc	(revision 156783)
+++ beginend.cc	(working copy)
@@ -187,7 +187,7 @@ _ITM_abortTransaction (_ITM_abortReason 
   set_gtm_tx (tx->prev);
   free_tx (tx);
 
-  GTM_longjmp (&tx->jb, a_abortTransaction | a_restoreLiveVariables, tx->prop);
+  GTM_longjmp (&tx->jb, a_abortTransaction | a_restoreLiveVariables);
 }
 
 bool
@@ -238,7 +238,7 @@ GTM::gtm_transaction::restart (gtm_resta
       && (this->state & gtm_transaction::STATE_IRREVOCABLE))
     actions = a_runUninstrumentedCode | a_restoreLiveVariables;
 
-  GTM_longjmp (&this->jb, actions, this->prop);
+  GTM_longjmp (&this->jb, actions);
 }
 
 void ITM_REGPARM
Index: libitm_i.h
===================================================================
--- libitm_i.h	(revision 156783)
+++ libitm_i.h	(working copy)
@@ -264,7 +264,7 @@ namespace GTM HIDDEN {
 // are used.
 extern uint64_t gtm_spin_count_var;
 
-extern "C" uint32_t GTM_longjmp (const gtm_jmpbuf *, uint32_t, uint32_t)
+extern "C" uint32_t GTM_longjmp (const gtm_jmpbuf *, uint32_t)
 	ITM_NORETURN;
 
 extern "C" void GTM_LB (const void *, size_t) ITM_REGPARM;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]