summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-06 01:04:22 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-06 01:04:22 +0000
commit02114c9576ea6dec329292dfda0568029c0210ba (patch)
tree23c342a3de8e01fa8b6546969fa6002664b39812 /gcc/function.c
parentf1d90c89e06c64dca9c301b1b47c475658972c18 (diff)
downloadgcc-02114c9576ea6dec329292dfda0568029c0210ba.tar.gz
PR target/61300
* doc/tm.texi.in (INCOMING_REG_PARM_STACK_SPACE): Document. * doc/tm.texi: Regenerate. * function.c (INCOMING_REG_PARM_STACK_SPACE): Provide default. Use throughout in place of REG_PARM_STACK_SPACE. * config/rs6000/rs6000.c (rs6000_reg_parm_stack_space): Add "incoming" param. Pass to rs6000_function_parms_need_stack. (rs6000_function_parms_need_stack): Add "incoming" param, ignore prototype_p when incoming. Use function decl when incoming to handle K&R style functions. * config/rs6000/rs6000.h (REG_PARM_STACK_SPACE): Adjust. (INCOMING_REG_PARM_STACK_SPACE): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211296 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 922f567734e..a85ad462a7d 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1348,9 +1348,13 @@ static int cfa_offset;
#define STACK_POINTER_OFFSET 0
#endif
+#if defined (REG_PARM_STACK_SPACE) && !defined (INCOMING_REG_PARM_STACK_SPACE)
+#define INCOMING_REG_PARM_STACK_SPACE REG_PARM_STACK_SPACE
+#endif
+
/* If not defined, pick an appropriate default for the offset of dynamically
allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS,
- REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
+ INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE. */
#ifndef STACK_DYNAMIC_OFFSET
@@ -1362,12 +1366,12 @@ static int cfa_offset;
`crtl->outgoing_args_size'. Nevertheless, we must allow
for it when allocating stack dynamic objects. */
-#if defined(REG_PARM_STACK_SPACE)
+#ifdef INCOMING_REG_PARM_STACK_SPACE
#define STACK_DYNAMIC_OFFSET(FNDECL) \
((ACCUMULATE_OUTGOING_ARGS \
? (crtl->outgoing_args_size \
+ (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
- : REG_PARM_STACK_SPACE (FNDECL))) \
+ : INCOMING_REG_PARM_STACK_SPACE (FNDECL))) \
: 0) + (STACK_POINTER_OFFSET))
#else
#define STACK_DYNAMIC_OFFSET(FNDECL) \
@@ -2224,8 +2228,9 @@ assign_parms_initialize_all (struct assign_parm_data_all *all)
#endif
all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
-#ifdef REG_PARM_STACK_SPACE
- all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
+#ifdef INCOMING_REG_PARM_STACK_SPACE
+ all->reg_parm_stack_space
+ = INCOMING_REG_PARM_STACK_SPACE (current_function_decl);
#endif
}