Add static size report when using -fstack-usage for ARM targets

2010-11-21 Thread Thomas Klein

Hello

With GCC 4.6 a new switch -fstack-usage has been added.
Some target architectures have support for this.
To give ARM targets support for this feature only a few lines of code 
are missing.

Is it possible to add this or something similar?

regards
  Thomas


2010-11-21  Thomas Klein 

* config/arm/arm.c (arm_expand_prologue): Report the static  ..
* config/arm/arm.c (thumb1_expand_prologue): .. stack size if 
-fstack-usage is used.


Index: gcc/config/arm/arm.c
===
--- gcc/config/arm/arm.c(revision 167002)
+++ gcc/config/arm/arm.c(working copy)
@@ -15722,6 +15722,13 @@ arm_expand_prologue (void)
}
 }

+  if (flag_stack_usage)
+{
+  HOST_WIDE_INT stack_size = saved_regs;
Hello

With GCC 4.6 a new switch -fstack-usage has been added.
Some target architectures have support for this.
To give ARM targets support for this feature only a few lines of code 
are missing.

Is it possible to add this or something similar?

Regards
  Thomas


2010-11-21  Thomas Klein 

* config/arm/arm.c (arm_expand_prologue): Report the static  ..
* config/arm/arm.c (thumb1_expand_prologue): .. stack size if 
-fstack-usage is used.


Index: gcc/config/arm/arm.c
===
--- gcc/config/arm/arm.c(revision 167002)
+++ gcc/config/arm/arm.c(working copy)
@@ -15722,6 +15722,13 @@ arm_expand_prologue (void)
}
 }

+  if (flag_stack_usage)
+{
+  HOST_WIDE_INT stack_size = saved_regs;
+  current_function_static_stack_size = stack_size;
+}
+
+
   if (offsets->outgoing_args != offsets->saved_args + saved_regs)
 {
   /* This add can produce multiple insns for a large constant, so we
@@ -15733,6 +15740,12 @@ arm_expand_prologue (void)

   insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
amount));
+  if (flag_stack_usage)
+{
+   HOST_WIDE_INT stack_size = offsets->outgoing_args - 
(offsets->saved_args + saved_regs);

+   current_function_static_stack_size += stack_size;
+}
+
   do
{
  last = last ? NEXT_INSN (last) : get_insns ();
@@ -20535,6 +20548,10 @@ thumb1_expand_prologue (void)
stack_pointer_rtx);

   amount = offsets->outgoing_args - offsets->saved_regs;
+  if (flag_stack_usage)
+{
+   current_function_static_stack_size = amount;
+}
   amount -= 4 * thumb1_extra_regs_pushed (offsets, true);
   if (amount)
 {
+  current_function_static_stack_size = stack_size;
+}
+
+
   if (offsets->outgoing_args != offsets->saved_args + saved_regs)
 {
   /* This add can produce multiple insns for a large constant, so we
@@ -15733,6 +15740,12 @@ arm_expand_prologue (void)

   insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
amount));
+  if (flag_stack_usage)
+{
+   HOST_WIDE_INT stack_size = offsets->outgoing_args - 
(offsets->saved_args + saved_regs);

+   current_function_static_stack_size += stack_size;
+}
+
   do
{
  last = last ? NEXT_INSN (last) : get_insns ();
@@ -20535,6 +20548,10 @@ thumb1_expand_prologue (void)
stack_pointer_rtx);

   amount = offsets->outgoing_args - offsets->saved_regs;
+  if (flag_stack_usage)
+{
+   current_function_static_stack_size = amount;
+}
   amount -= 4 * thumb1_extra_regs_pushed (offsets, true);
   if (amount)
 {



gcc-4.3-20101121 is now available

2010-11-21 Thread gccadmin
Snapshot gcc-4.3-20101121 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20101121/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.3 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch 
revision 167010

You'll find:

 gcc-4.3-20101121.tar.bz2 Complete GCC (includes all of below)

  MD5=3c11d81eed17c4acc41c689375271065
  SHA1=751565b0eb3aeda8e3aff8dbe0ba7294854f6419

 gcc-core-4.3-20101121.tar.bz2C front end and core compiler

  MD5=9bb8d30179f6e23c42c649570073d59c
  SHA1=838280e30c1f71b9184bb885ead9c2fefa44c1c8

 gcc-ada-4.3-20101121.tar.bz2 Ada front end and runtime

  MD5=259c6b2c163d0f96e801a8eb0e2054e2
  SHA1=8e83948783c3ea407fe20c12523e96bb22a27bd7

 gcc-fortran-4.3-20101121.tar.bz2 Fortran front end and runtime

  MD5=35b0838d03178cdf7361b80e56daaa68
  SHA1=6d7ff47dd00856a0b30558e2a34439c30f3bc1d2

 gcc-g++-4.3-20101121.tar.bz2 C++ front end and runtime

  MD5=6ff89863be5af92198efa8e0516a7359
  SHA1=d4359482ae12ccff0a14928046c86376900ef14e

 gcc-java-4.3-20101121.tar.bz2Java front end and runtime

  MD5=143b8816c3e58a8b19b8492ba2442f60
  SHA1=8a0313b81e76b59cc614b33d4cb8c621a8bf1bcd

 gcc-objc-4.3-20101121.tar.bz2Objective-C front end and runtime

  MD5=934f5339dd5d8fcc85c38267a392fdcc
  SHA1=a62969fb02fabd33e2fa1f31572d848af33159a9

 gcc-testsuite-4.3-20101121.tar.bz2   The GCC testsuite

  MD5=b1c76585812e172c2fe5aa2d7a798d8c
  SHA1=f1e04b919dda500b807c877631f26c340661f56d

Diffs from 4.3-20101114 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.3
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.