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: [ARM] Fix PR middle-end/65958


> I assume that this patch (and arm patch) will change the instruction
> sequences in prologue.  If so, do you have some examples about how
> prologue is changed with this patch?  I need to adapt GDB prologue
> analyser to these new instruction sequences.

Yes, it will generate either individual probes or a probing loop before the 
frame is established when -fstack-check is passed.  For aarch64, a probe is a 
store based on x9 of the form:

	str xzr, [x9, #offset]

with preceding instructions to compute x9 from sp, typically:

 	sub x9, sp, #16384

A probing loop uses both x9 and x10:

	sub	x9, sp, #12288
	sub	x10, sp, #36864
LPSRL0:
	sub	x9, x9, 4096
	str	xzr, [x9]
	cmp	x9, x10
	b.ne	LPSRL0

with an optional last probe:

	str	xzr, [x10,#-16]

For arm, it's more convoluted because the base register may vary but, in 
simple cases (in particular if the function is not nested), it's IP:

	str r0, [ip, #offset]

-- 
Eric Botcazou


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