This is the mail archive of the
mailing list for the GCC project.
Re: [RFC][AArch64] function prologue analyzer in linux kernel
- From: AKASHI Takahiro <takahiro dot akashi at linaro dot org>
- To: Andrew Pinski <pinskia at gmail dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>, Will Deacon <will dot deacon at arm dot com>, "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- Date: Tue, 12 Jan 2016 17:55:19 +0900
- Subject: Re: [RFC][AArch64] function prologue analyzer in linux kernel
- Authentication-results: sourceware.org; auth=none
- References: <567BA582 dot 4060707 at linaro dot org> <56949911 dot 7000902 at linaro dot org> <CA+=Sn1k4sd9-pjxFBxQGO_dX+ABV7cG2amaxNCBDNG_y3C18RA at mail dot gmail dot com> <1513747 dot f6kUjzybvk at polaris> <CA+=Sn1=61wXs+KQ4X_-f8yeByRwfS02wDze+DAkH3V+M3v-9aw at mail dot gmail dot com>
On 01/12/2016 05:22 PM, Andrew Pinski wrote:
On Tue, Jan 12, 2016 at 12:18 AM, Eric Botcazou <email@example.com> wrote:
-fstack-usage does not work when there are VLAs or alloca's. So there
is no way to figure that part out without analysis of the actual
No, -fstack-usage always works, i.e. its output can always be relied upon;
when it cannot compute the maximum stack usage, it prints "unbounded".
Yes It works that way but that is not useful enough for what is needed
to do unwinding :).
In my analyzer (and stack tracer), the stack pointer is estimated as
(stack pointer) = (callee's frame pointer) - (callee's stack usage)
here, (callee's stack usage) means a size of memory which is initially
allocated on a stack in a function prologue.
So, as far as dynamic storage be allocated after a function prologue,
we don't have to care about it.
Then -fstack-usage is still as useful as my own analyzer is.