aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-09-14 19:05:39 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-09-14 17:05:39 +0000
commit6a78eaa3e613a48336cdfc9f153bc05be14d436e (patch)
tree0b6d13660bdd349f3d66247ef7668022716afb70
parent138b9ed9aafe702a5bc841536a5d739b1451ac0d (diff)
downloadgcc-6a78eaa3e613a48336cdfc9f153bc05be14d436e.zip
gcc-6a78eaa3e613a48336cdfc9f153bc05be14d436e.tar.gz
gcc-6a78eaa3e613a48336cdfc9f153bc05be14d436e.tar.bz2
invoke.texi (-fconserve-stack): Document.
* invoke.texi (-fconserve-stack): Document. * opts.c (decode_options): Handle conserve_stack. * common.opt (fconvserve_stack): New. From-SVN: r140362
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/opts.c8
4 files changed, 27 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 006c3f7..532c1b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-14 Jan Hubicka <jh@suse.cz>
+
+ * invoke.texi (-fconserve-stack): Document.
+ * opts.c (decode_options): Handle conserve_stack.
+ * common.opt (fconvserve_stack): New.
+
2008-09-14 David Edelsohn <edelsohn@gnu.org>
* config.host: Add x-aix to host_xmake_file.
diff --git a/gcc/common.opt b/gcc/common.opt
index e7f8159..6f09dfd 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -385,6 +385,10 @@ fcommon
Common Report Var(flag_no_common,0) Optimization
Do not put uninitialized globals in the common section
+fconserve-stack
+Common Var(flag_conserve_stack,0) Optimization
+Do not perform optimizations increasing noticeably stack usage
+
fcprop-registers
Common Report Var(flag_cprop_registers) Optimization
Perform a register copy-propagation optimization pass
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index eb9ecd5..dda7d85 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -323,8 +323,8 @@ Objective-C and Objective-C++ Dialects}.
-falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
-fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
-fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
--fcheck-data-deps -fcprop-registers -fcrossjumping -fcse-follow-jumps @gol
--fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
+-fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
+-fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
-fdata-sections -fdce -fdce @gol
-fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
-fearly-inlining -fexpensive-optimizations -ffast-math @gol
@@ -5871,6 +5871,13 @@ those which have no call-preserved registers to use instead.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+@item -fconserve-stack
+@opindex fconserve-stack
+Attempt to minimize stack usage. The compiler will attempt to use less
+stack space, even if that makes the program slower. This option
+implies setting the @option{large-stack-frame} parameter to 100
+and the @option{large-stack-frame-growth} parameter to 400.
+
@item -ftree-reassoc
@opindex ftree-reassoc
Perform reassociation on trees. This flag is enabled by default
diff --git a/gcc/opts.c b/gcc/opts.c
index 5e97bdd..b45c0c5 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1112,6 +1112,14 @@ decode_options (unsigned int argc, const char **argv)
optimization_current_node = optimization_default_node;
first_time_p = false;
}
+ if (flag_conserve_stack)
+ {
+ if (!PARAM_SET_P (PARAM_LARGE_STACK_FRAME))
+ PARAM_VALUE (PARAM_LARGE_STACK_FRAME) = 100;
+ if (!PARAM_SET_P (PARAM_STACK_FRAME_GROWTH))
+ PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40;
+ }
+
}
#define LEFT_COLUMN 27