diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-05-25 11:00:14 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-05-25 11:00:14 +0000 |
commit | a11e0df4da7c987c9627724748fe727183e9379f (patch) | |
tree | 8f263f60484dabe77a13c389e9ce210b121dbc56 /gcc/doc | |
parent | e7cfe2413fe50e22eb2c013415cec9e154d3c391 (diff) | |
download | gcc-a11e0df4da7c987c9627724748fe727183e9379f.zip gcc-a11e0df4da7c987c9627724748fe727183e9379f.tar.gz gcc-a11e0df4da7c987c9627724748fe727183e9379f.tar.bz2 |
common.opt (flag_stack_usage_info): New variable.
* common.opt (flag_stack_usage_info): New variable.
(-Wstack-usage): New option.
* doc/invoke.texi (Warning options): Document -Wstack-usage.
* opts.c (common_handle_option) <OPT_Wstack_usage_>: New case.
<OPT_fstack_usage>: Likewise.
* toplev.c (output_stack_usage): Handle -Wstack-usage.
* calls.c (expand_call): Test flag_stack_usage_info variable instead
of flag_stack_usage.
(emit_library_call_value_1): Likewise.
* explow.c (allocate_dynamic_stack_space): Likewise.
* function.c (instantiate_virtual_regs ): Likewise.
(prepare_function_start): Likewise.
(rest_of_handle_thread_prologue_and_epilogue): Likewise.
* config/alpha/alpha.c (alpha_expand_prologue): Likewise.
* config/arm/arm.c (arm_expand_prologue): Likewise.
(thumb1_expand_prologue): Likewise.
* config/avr/avr.c (expand_prologue): Likewise.
* config/i386/i386.c (ix86_expand_prologue): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/m68k/m68k.c (m68k_expand_prologue): Likewise.
* config/mips/mips.c (mips_expand_prologue): Likewise.
* config/pa/pa.c (hppa_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
* config/s390/s390.c (s390_emit_prologue): Likewise.
* config/sh/sh.c (sh_expand_prologue): Likewise.
* config/sparc/sparc.c (sparc_expand_prologue): Likewise.
* config/spu/spu.c (spu_expand_prologue): Likewise.
From-SVN: r174182
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7de8fd0..f53d610 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -260,7 +260,7 @@ Objective-C and Objective-C++ Dialects}. -Wredundant-decls @gol -Wreturn-type -Wsequence-point -Wshadow @gol -Wsign-compare -Wsign-conversion -Wstack-protector @gol --Wstrict-aliasing -Wstrict-aliasing=n @gol +-Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol -Wswitch -Wswitch-default -Wswitch-enum -Wsync-nand @gol @@ -3924,6 +3924,37 @@ via @code{alloca}, variable-length arrays, or related constructs is not included by the compiler when determining whether or not to issue a warning. +@item -Wstack-usage=@var{len} +@opindex Wstack-usage +Warn if the stack usage of a function might be larger than @var{len} bytes. +The computation done to determine the stack usage is conservative. +Any space allocated via @code{alloca}, variable-length arrays, or related +constructs is included by the compiler when determining whether or not to +issue a warning. + +The message is in keeping with the output of @option{-fstack-usage}. + +@itemize +@item +If the stack usage is fully static but exceeds the specified amount, it's: + +@smallexample + warning: stack usage is 1120 bytes +@end smallexample +@item +If the stack usage is (partly) dynamic but bounded, it's: + +@smallexample + warning: stack usage might be 1648 bytes +@end smallexample +@item +If the stack usage is (partly) dynamic and not bounded, it's: + +@smallexample + warning: stack usage might be unbounded +@end smallexample +@end itemize + @item -Wunsafe-loop-optimizations @opindex Wunsafe-loop-optimizations @opindex Wno-unsafe-loop-optimizations |