summaryrefslogtreecommitdiff
path: root/gcc/config/cris/cris.c
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-29 22:51:04 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-29 22:51:04 +0000
commit5a1c68c319e09fab3a9288938bc1844bd19f8f66 (patch)
tree0f2937085f496ccc9d16a12f644463d2113bf657 /gcc/config/cris/cris.c
parent275b769bf477e9dd3d9b7a9855a8919c40d503bb (diff)
downloadgcc-5a1c68c319e09fab3a9288938bc1844bd19f8f66.tar.gz
* target.h (struct gcc_target): Add frame_pointer_required field.
* target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/cris/cris.c')
-rw-r--r--gcc/config/cris/cris.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index bc634ddbf3e..66fc05d0f6e 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1,6 +1,6 @@
/* Definitions for GCC. Part of the machine description for CRIS.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008 Free Software Foundation, Inc.
+ 2008, 2009 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
@@ -122,6 +122,8 @@ static tree cris_md_asm_clobbers (tree, tree, tree);
static bool cris_handle_option (size_t, const char *, int);
+static bool cris_frame_pointer_required (void);
+
/* This is the parsed result of the "-max-stack-stackframe=" option. If
it (still) is zero, then there was no such option given. */
int cris_max_stackframe = 0;
@@ -180,6 +182,8 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION cris_handle_option
+#undef TARGET_FRAME_POINTER_REQUIRED
+#define TARGET_FRAME_POINTER_REQUIRED cris_frame_pointer_required
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -3814,6 +3818,18 @@ cris_md_asm_clobbers (tree outputs, tree inputs, tree in_clobbers)
clobbers);
}
+/* Implement TARGET_FRAME_POINTER_REQUIRED.
+
+ Really only needed if the stack frame has variable length (alloca
+ or variable sized local arguments (GNU C extension). See PR39499 and
+ PR38609 for the reason this isn't just 0. */
+
+bool
+cris_frame_pointer_required (void)
+{
+ return !current_function_sp_is_unchanging;
+}
+
#if 0
/* Various small functions to replace macros. Only called from a
debugger. They might collide with gcc functions or system functions,