aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-09-03 13:50:33 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-09-03 13:50:33 -0700
commit964be02f4434ee0244a69dcaf345e46ab36100d2 (patch)
tree43ae3eece8ab71f90e9d2f0742e9cff0f9bfe0f3 /gcc
parent72ea47b1646534dd612dc98abe57a9607a6044c2 (diff)
downloadgcc-964be02f4434ee0244a69dcaf345e46ab36100d2.zip
gcc-964be02f4434ee0244a69dcaf345e46ab36100d2.tar.gz
gcc-964be02f4434ee0244a69dcaf345e46ab36100d2.tar.bz2
function.h (struct function): Add arg_pointer_save_area_init.
* function.h (struct function): Add arg_pointer_save_area_init. * function.c (expand_function_end): Init arg_pointer_save_area. (get_arg_pointer_save_area): Do not init arg_pointer_save_area when called from a nested function. From-SVN: r45362
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/function.c25
-rw-r--r--gcc/function.h3
3 files changed, 24 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91868b7..312b2e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2001-09-03 Richard Henderson <rth@redhat.com>
+
+ * function.h (struct function): Add arg_pointer_save_area_init.
+ * function.c (expand_function_end): Init arg_pointer_save_area.
+ (get_arg_pointer_save_area): Do not init arg_pointer_save_area
+ when called from a nested function.
+
2001-09-02 Angela Marie Thomas <angela@cygnus.com>
* fixinc/Makefile.in: Regenerate fixincl.x only if maintainer-mode
diff --git a/gcc/function.c b/gcc/function.c
index 07f9960..ae19e07a 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6681,6 +6681,11 @@ expand_function_end (filename, line, end_bindings)
finish_expr_for_function ();
+ /* If arg_pointer_save_area was referenced only from a nested
+ function, we will not have initialized it yet. Do that now. */
+ if (arg_pointer_save_area && ! cfun->arg_pointer_save_area_init)
+ get_arg_pointer_save_area (cfun);
+
#ifdef NON_SAVING_SETJMP
/* Don't put any variables in registers if we call setjmp
on a machine that fails to restore the registers. */
@@ -6998,27 +7003,25 @@ get_arg_pointer_save_area (f)
if (! ret)
{
- rtx seq;
-
ret = assign_stack_local_1 (Pmode, GET_MODE_SIZE (Pmode), 0, f);
f->x_arg_pointer_save_area = ret;
+ }
+
+ if (f == cfun && ! f->arg_pointer_save_area_init)
+ {
+ rtx seq;
/* Save the arg pointer at the beginning of the function. The
- generated stack slot may not be a valid memory address, so w
+ generated stack slot may not be a valid memory address, so we
have to check it and fix it if necessary. */
start_sequence ();
emit_move_insn (validize_mem (ret), virtual_incoming_args_rtx);
seq = gen_sequence ();
end_sequence ();
- if (f == cfun)
- {
- push_topmost_sequence ();
- emit_insn_after (seq, get_insns ());
- pop_topmost_sequence ();
- }
- else
- emit_insn_before (seq, f->x_tail_recursion_reentry);
+ push_topmost_sequence ();
+ emit_insn_after (seq, get_insns ());
+ pop_topmost_sequence ();
}
return ret;
diff --git a/gcc/function.h b/gcc/function.h
index ff8aeb9..8eeda3a 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -477,6 +477,9 @@ struct function
/* Nonzero if the current function needs an lsda for exception handling. */
unsigned int uses_eh_lsda : 1;
+
+ /* Nonzero if code to initialize arg_pointer_save_area has been emited. */
+ unsigned int arg_pointer_save_area_init : 1;
};
/* The function currently being compiled. */