diff options
author | Nick Clifton <nickc@redhat.com> | 2015-06-25 12:33:14 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2015-06-25 12:33:14 +0000 |
commit | ed1332ee11848c7d2ded43f143f4fdb05b0645eb (patch) | |
tree | 27202676cf7d947ed2645eea121293263fb264d9 | |
parent | b092fe39d0163b45c9ff4ac7754a544bb0892d68 (diff) | |
download | gcc-ed1332ee11848c7d2ded43f143f4fdb05b0645eb.zip gcc-ed1332ee11848c7d2ded43f143f4fdb05b0645eb.tar.gz gcc-ed1332ee11848c7d2ded43f143f4fdb05b0645eb.tar.bz2 |
bfin.c (bfin_expand_prologue): Set current_function_static_stack_size if flag_stack_usage_info is set.
* config/bfin/bfin.c (bfin_expand_prologue): Set
current_function_static_stack_size if flag_stack_usage_info is
set.
* config/ft32/ft32.c (ft32_expand_prologue): Likewise.
* config/h8300/h8300.c (h8300_expand_prologue): Likewise.
* config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise.
* config/m32c/m32c.c (m32c_emit_prologue): Likewise.
test * gcc.dg/stack-usage-1.c: Add SIZE values for V850, MN10300,
H8300 and M32R targets.
From-SVN: r224937
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.c | 3 | ||||
-rw-r--r-- | gcc/config/ft32/ft32.c | 7 | ||||
-rw-r--r-- | gcc/config/ft32/ft32.h | 2 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 6 | ||||
-rw-r--r-- | gcc/config/iq2000/iq2000.c | 3 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.c | 3 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/stack-usage-1.c | 8 |
10 files changed, 47 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e8c7f8..f519310 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-06-25 Nick Clifton <nickc@redhat.com> + + * config/bfin/bfin.c (bfin_expand_prologue): Set + current_function_static_stack_size if flag_stack_usage_info is + set. + * config/ft32/ft32.c (ft32_expand_prologue): Likewise. + * config/h8300/h8300.c (h8300_expand_prologue): Likewise. + * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. + * config/m32c/m32c.c (m32c_emit_prologue): Likewise. + 2015-06-25 Tom de Vries <tom@codesourcery.com> * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Don't claim in header diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 594272f..dade478 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -1090,6 +1090,9 @@ bfin_expand_prologue (void) tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)); bool all = lookup_attribute ("saveall", attrs) != NULL_TREE; + if (flag_stack_usage_info) + current_function_static_stack_size = frame_size; + if (fkind != SUBROUTINE) { expand_interrupt_handler_prologue (spreg, fkind, all); diff --git a/gcc/config/ft32/ft32.c b/gcc/config/ft32/ft32.c index bc18c23..1630c9c 100644 --- a/gcc/config/ft32/ft32.c +++ b/gcc/config/ft32/ft32.c @@ -59,7 +59,7 @@ #include "basic-block.h" #include "df.h" #include "builtins.h" - +#include "emit-rtl.h" #include <stdint.h> @@ -199,7 +199,7 @@ ft32_print_operand (FILE * file, rtx x, int code) return; case 'm': - fprintf (file, "%d", -INTVAL(x)); + fprintf (file, "%ld", (long) (- INTVAL(x))); return; case 'd': // a DW spec, from an integer alignment (for BLKmode insns) @@ -456,6 +456,9 @@ ft32_expand_prologue (void) ft32_compute_frame (); + if (flag_stack_usage_info) + current_function_static_stack_size = cfun->machine->size_for_adjusting_sp; + if (!must_link () && (cfun->machine->callee_saved_reg_size == 4)) { insn = diff --git a/gcc/config/ft32/ft32.h b/gcc/config/ft32/ft32.h index 0835aae..a1722a8 100644 --- a/gcc/config/ft32/ft32.h +++ b/gcc/config/ft32/ft32.h @@ -248,7 +248,7 @@ enum reg_class /* Define this macro if pushing a word onto the stack moves the stack pointer to a smaller address. */ -#define STACK_GROWS_DOWNWARD +#define STACK_GROWS_DOWNWARD 1 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0 diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 8a8ff53..4c7828a 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -896,6 +896,12 @@ h8300_expand_prologue (void) /* Leave room for locals. */ h8300_emit_stack_adjustment (-1, round_frame_size (get_frame_size ()), true); + + if (flag_stack_usage_info) + current_function_static_stack_size + = round_frame_size (get_frame_size ()) + + (__builtin_popcount (saved_regs) * UNITS_PER_WORD) + + (frame_pointer_needed ? UNITS_PER_WORD : 0); } /* Return nonzero if we can use "rts" for the function currently being diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 518a6da..a16add7 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -2072,6 +2072,9 @@ iq2000_expand_prologue (void) } } + if (flag_stack_usage_info) + current_function_static_stack_size = cfun->machine->total_size; + emit_insn (gen_blockage ()); } diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 10e53e4..83209aa 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -4123,6 +4123,9 @@ m32c_emit_prologue (void) && !m32c_function_needs_enter ()) cfun->machine->use_rts = 1; + if (flag_stack_usage_info) + current_function_static_stack_size = frame_size; + if (frame_size > 254) { extra_frame_size = frame_size - 254; diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index bf88ef2..cc40b45 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1665,6 +1665,9 @@ m32r_expand_prologue (void) if (! current_frame_info.initialized) m32r_compute_frame_size (get_frame_size ()); + if (flag_stack_usage_info) + current_function_static_stack_size = current_frame_info.total_size; + gmask = current_frame_info.gmask; /* These cases shouldn't happen. Catch them now. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 699e70c..cb0c5bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-25 Nick Clifton <nickc@redhat.com> + + * gcc.dg/stack-usage-1.c: Add SIZE values for V850, MN10300, + H8300 and M32R targets. + 2015-06-24 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/66528 diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c index 05e3df7..55edc7e 100644 --- a/gcc/testsuite/gcc.dg/stack-usage-1.c +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c @@ -81,6 +81,14 @@ # define SIZE 254 #elif defined (__nios2__) # define SIZE 252 +#elif defined (__v850__) +#define SIZE 260 +#elif defined (__mn10300__) +#define SIZE 252 +#elif defined (__H8300SX__) || defined (__H8300S__) || defined (__H8300H__) || defined (__H8300__) +#define SIZE 252 +#elif defined (__M32R__) +#define SIZE 252 #else # define SIZE 256 #endif |