* RFA: RL78: Add -fstack-usage support
@ 2012-04-04 10:21 Nick Clifton
2012-04-04 11:25 ` Eric Botcazou
0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2012-04-04 10:21 UTC (permalink / raw)
To: dj; +Cc: gcc-patches
Hi DJ,
Please could I apply the patch below to the RL78 port ? It adds
support for generating stack use info with the -fstack-usage option.
Also - may I apply this patch to the 4.7 branch as well please ?
Cheers
Nick
gcc/ChangeLog
2012-04-04 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_expand_prologue): Set stack use
information, if requested.
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c (revision 186130)
+++ gcc/config/rl78/rl78.c (working copy)
@@ -827,6 +827,9 @@
if (!cfun->machine->computed)
rl78_compute_frame_info ();
+ if (flag_stack_usage)
+ current_function_static_stack_size = cfun->machine->framesize;
+
for (i = 0; i < 16; i++)
if (cfun->machine->need_to_push [i])
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: RL78: Add -fstack-usage support
2012-04-04 10:21 RFA: RL78: Add -fstack-usage support Nick Clifton
@ 2012-04-04 11:25 ` Eric Botcazou
2012-04-04 13:47 ` nick clifton
0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2012-04-04 11:25 UTC (permalink / raw)
To: Nick Clifton; +Cc: gcc-patches, dj
> Please could I apply the patch below to the RL78 port ? It adds
> support for generating stack use info with the -fstack-usage option.
You probably need to adjust gcc.dg/stack-usage-1.c too.
> Index: gcc/config/rl78/rl78.c
> ===================================================================
> --- gcc/config/rl78/rl78.c (revision 186130)
> +++ gcc/config/rl78/rl78.c (working copy)
> @@ -827,6 +827,9 @@
> if (!cfun->machine->computed)
> rl78_compute_frame_info ();
>
> + if (flag_stack_usage)
> + current_function_static_stack_size = cfun->machine->framesize;
> +
> for (i = 0; i < 16; i++)
> if (cfun->machine->need_to_push [i])
> {
s/flag_stack_usage/flag_stack_usage_info/
--
Eric Botcazou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: RL78: Add -fstack-usage support
2012-04-04 11:25 ` Eric Botcazou
@ 2012-04-04 13:47 ` nick clifton
2012-04-05 17:04 ` DJ Delorie
0 siblings, 1 reply; 4+ messages in thread
From: nick clifton @ 2012-04-04 13:47 UTC (permalink / raw)
To: Eric Botcazou, dj; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Hi Eric,
> On 04/04/12 12:24, Eric Botcazou wrote:
> You probably need to adjust gcc.dg/stack-usage-1.c too.
> s/flag_stack_usage/flag_stack_usage_info/
Thanks for the corrections. Revised patch attached.
OK for mainline/4.7 branch ?
Cheers
Nick
gcc/ChangeLog
2012-04-04 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_expand_prologue): Set stack use
information, if requested.
gcc/testsuite/ChangeLog
2012-04-04 Nick Clifton <nickc@redhat.com>
* gcc.dg/stack-usage-1.c (SIZE): Define for the RL78.
[-- Attachment #2: rl78.stack-use.patch --]
[-- Type: text/x-patch, Size: 878 bytes --]
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c (revision 186130)
+++ gcc/config/rl78/rl78.c (working copy)
@@ -827,6 +827,9 @@
if (!cfun->machine->computed)
rl78_compute_frame_info ();
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = cfun->machine->framesize;
+
for (i = 0; i < 16; i++)
if (cfun->machine->need_to_push [i])
{
Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
--- gcc/testsuite/gcc.dg/stack-usage-1.c (revision 186130)
+++ gcc/testsuite/gcc.dg/stack-usage-1.c (working copy)
@@ -58,6 +58,8 @@
# define SIZE 224
#elif defined (__epiphany__)
# define SIZE (256 - __EPIPHANY_STACK_OFFSET__)
+#elif defined (__RL78__)
+# define SIZE 254
#else
# define SIZE 256
#endif
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: RL78: Add -fstack-usage support
2012-04-04 13:47 ` nick clifton
@ 2012-04-05 17:04 ` DJ Delorie
0 siblings, 0 replies; 4+ messages in thread
From: DJ Delorie @ 2012-04-05 17:04 UTC (permalink / raw)
To: nick clifton; +Cc: ebotcazou, gcc-patches
> OK for mainline/4.7 branch ?
Ok with me
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-05 17:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04 10:21 RFA: RL78: Add -fstack-usage support Nick Clifton
2012-04-04 11:25 ` Eric Botcazou
2012-04-04 13:47 ` nick clifton
2012-04-05 17:04 ` DJ Delorie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).