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]

Re: [split] Add CFI ops, fix call/return prediction, other changes


+	# Note that %esp is exactly 32 bytes below the CFA -- perfect for
+	# a 16-byte aligned stack.  That said, we still ought to compile
+	# generic-morestack.c with -mpreferred-stack-boundary=2.  FIXME.

Without the ecx push this isn't true. Not that it really matters; if the cfa were properly aligned on entry to our caller, we pushed 12 bytes to get to __morestack, which means our cfa is not aligned.


+	movl	-4(%ebp),%eax		# Restore registers.
+	movl	-8(%ebp),%edx

+	movl	4(%ebp),%ecx		# Increment the return address
+	inc	%ecx			# to skip the ret instruction;
+					# see above.

call *%ecx # Call our caller!

How about using some of that extra space we've got in the frame:


	movl	-12(%ebp), %ecx		# Restore 2 registers
	movl	-8(%ebp), %edx

	movl	4(%ebp), %eax		# Increment return address
	inc	%eax
	movl	%eax, -8(%ebp)		# Store it in an unused slot

movl -4(%ebp), %eax # Restore 3rd register

call *-8(%ebp) # Call our caller via slot


r~



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