xtensa: report stack usage
diff mbox

Message ID 1472194954-32602-1-git-send-email-jcmvbkbc@gmail.com
State New
Headers show

Commit Message

Max Filippov Aug. 26, 2016, 7:02 a.m. UTC
This enables options -fstack-usage and -Wstack-usage.

2016-08-21  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.c (xtensa_expand_prologue): Update
	current_function_static_stack_size variable with the static
	stack frame size of the current function when
	flag_stack_usage_info is enabled.
---
 gcc/config/xtensa/xtensa.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

augustine.sterling@gmail.com Aug. 26, 2016, 4:24 p.m. UTC | #1
On Fri, Aug 26, 2016 at 12:02 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> This enables options -fstack-usage and -Wstack-usage.
>
> 2016-08-21  Max Filippov  <jcmvbkbc@gmail.com>
> gcc/
>         * config/xtensa/xtensa.c (xtensa_expand_prologue): Update
>         current_function_static_stack_size variable with the static
>         stack frame size of the current function when
>         flag_stack_usage_info is enabled.
> ---

This is OK for xtensa. Please check in.
Max Filippov Aug. 26, 2016, 5:33 p.m. UTC | #2
On Fri, Aug 26, 2016 at 9:24 AM, augustine.sterling@gmail.com
<augustine.sterling@gmail.com> wrote:
> On Fri, Aug 26, 2016 at 12:02 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> This enables options -fstack-usage and -Wstack-usage.
>>
>> 2016-08-21  Max Filippov  <jcmvbkbc@gmail.com>
>> gcc/
>>         * config/xtensa/xtensa.c (xtensa_expand_prologue): Update
>>         current_function_static_stack_size variable with the static
>>         stack frame size of the current function when
>>         flag_stack_usage_info is enabled.
>> ---
>
> This is OK for xtensa. Please check in.

Applied to trunk. Thank you!

-- Max

Patch
diff mbox

diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 527fe88..f4504bf 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2679,6 +2679,9 @@  xtensa_expand_prologue (void)
 
   total_size = compute_frame_size (get_frame_size ());
 
+  if (flag_stack_usage_info)
+    current_function_static_stack_size = total_size;
+
   if (TARGET_WINDOWED_ABI)
     {
       if (total_size < (1 << (12+3)))