This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH,picochip] More conservative settings for fconseve-stack
- From: Hariharan <hariharans at picochip dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jan 2009 10:26:13 +0000
- Subject: [PATCH,picochip] More conservative settings for fconseve-stack
Hi,
This patch changes the settings for flag-conserve-stack on picochip to
be more conservative.
Committed to mainline.
Regards
Hari
ChangeLog:
* config/picochip/picochip.c (flag_conserve_stack): set
PARAM_LARGE_STACK_FRAME and PARAM_STACK_FRAME_GROWTH to zero
under fconserve-stack. Reduce call-overhead used by inliner.
Patch:
Index: gcc/config/picochip/picochip.c
===================================================================
--- gcc/config/picochip/picochip.c (revision 143783)
+++ gcc/config/picochip/picochip.c (working copy)
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.
#include "target-def.h"
#include "langhooks.h"
#include "reload.h"
+#include "params.h"
#include "picochip-protos.h"
@@ -303,6 +304,16 @@ picochip_return_in_memory(const_tree typ
void
picochip_override_options (void)
{
+ /* If we are optimizing for stack, dont let inliner to inline functions
+ that could potentially increase stack size.*/
+ if (flag_conserve_stack)
+ {
+ PARAM_VALUE (PARAM_LARGE_STACK_FRAME) = 0;
+ PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 0;
+ }
+ /* The function call overhead on picochip is not very high. Let the
+ inliner know so its heuristics become more reasonable. */
+ PARAM_VALUE (PARAM_INLINE_CALL_COST) = 2;
/* Turn off the elimination of unused types. The elaborator
generates various interesting types to represent constants,