aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-05-19 09:33:27 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-05-19 09:33:27 +0000
commitd33606c30678cbccf0e95840e7dc48918ff1e21e (patch)
tree1a601dd44371c7e5dd197e955db6b56a8a9dd835 /gcc/builtins.c
parent76e048a8c04e282b8eca52dedf529073ce235f38 (diff)
downloadgcc-d33606c30678cbccf0e95840e7dc48918ff1e21e.zip
gcc-d33606c30678cbccf0e95840e7dc48918ff1e21e.tar.gz
gcc-d33606c30678cbccf0e95840e7dc48918ff1e21e.tar.bz2
insn-notes.def (UPDATE_SJLJ_CONTEXT): New note.
* insn-notes.def (UPDATE_SJLJ_CONTEXT): New note. * builtins.c (expand_builtin_update_setjmp_buf): Make global. (expand_stack_restore): Call record_new_stack_level. (expand_stack_save): Do not call do_pending_stack_adjust. * builtins.h (expand_builtin_update_setjmp_buf): Declare. * calls.c (expand_call): Call record_new_stack_level for alloca. * except.c (sjlj_mark_call_sites): Expand builtin_update_setjmp_buf wherever a NOTE_INSN_UPDATE_SJLJ_CONTEXT note is present. (update_sjlj_context): New global function. * except.h (update_sjlj_context): Declare. * explow.c (record_new_stack_level): New global function. (allocate_dynamic_stack_space): Call record_new_stack_level. * explow.h (record_new_stack_level): Declare. * final.c (final_scan_insn): Deal with NOTE_INSN_UPDATE_SJLJ_CONTEXT. * cfgrtl.c (duplicate_insn_chain): Likewise. Co-Authored-By: Tristan Gingold <gingold@adacore.com> From-SVN: r223348
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 9544524..030cc35 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -120,7 +120,6 @@ static int apply_result_size (void);
#if defined (HAVE_untyped_call) || defined (HAVE_untyped_return)
static rtx result_vector (int, rtx);
#endif
-static void expand_builtin_update_setjmp_buf (rtx);
static void expand_builtin_prefetch (tree);
static rtx expand_builtin_apply_args (void);
static rtx expand_builtin_apply_args_1 (void);
@@ -1213,10 +1212,10 @@ expand_builtin_nonlocal_goto (tree exp)
/* __builtin_update_setjmp_buf is passed a pointer to an array of five words
(not all will be used on all machines) that was passed to __builtin_setjmp.
- It updates the stack pointer in that block to correspond to the current
- stack pointer. */
+ It updates the stack pointer in that block to the current value. This is
+ also called directly by the SJLJ exception handling code. */
-static void
+void
expand_builtin_update_setjmp_buf (rtx buf_addr)
{
machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
@@ -5887,10 +5886,12 @@ expand_stack_restore (tree var)
prev = get_last_insn ();
emit_stack_restore (SAVE_BLOCK, sa);
+
+ record_new_stack_level ();
+
fixup_args_size_notes (prev, get_last_insn (), 0);
}
-
/* Emit code to save the current value of stack. */
static rtx
@@ -5898,7 +5899,6 @@ expand_stack_save (void)
{
rtx ret = NULL_RTX;
- do_pending_stack_adjust ();
emit_stack_save (SAVE_BLOCK, &ret);
return ret;
}