aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.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/explow.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/explow.c')
-rw-r--r--gcc/explow.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index de446a9..e7768ae 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1096,8 +1096,8 @@ emit_stack_restore (enum save_level save_level, rtx sa)
}
/* Invoke emit_stack_save on the nonlocal_goto_save_area for the current
- function. This function should be called whenever we allocate or
- deallocate dynamic stack space. */
+ function. This should be called whenever we allocate or deallocate
+ dynamic stack space. */
void
update_nonlocal_goto_save_area (void)
@@ -1117,6 +1117,21 @@ update_nonlocal_goto_save_area (void)
emit_stack_save (SAVE_NONLOCAL, &r_save);
}
+
+/* Record a new stack level for the current function. This should be called
+ whenever we allocate or deallocate dynamic stack space. */
+
+void
+record_new_stack_level (void)
+{
+ /* Record the new stack level for nonlocal gotos. */
+ if (cfun->nonlocal_goto_save_area)
+ update_nonlocal_goto_save_area ();
+
+ /* Record the new stack level for SJLJ exceptions. */
+ if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
+ update_sjlj_context ();
+}
/* Return an rtx representing the address of an area of memory dynamically
pushed on the stack.
@@ -1479,9 +1494,8 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
/* Now that we've committed to a return value, mark its alignment. */
mark_reg_pointer (target, required_align);
- /* Record the new stack level for nonlocal gotos. */
- if (cfun->nonlocal_goto_save_area != 0)
- update_nonlocal_goto_save_area ();
+ /* Record the new stack level. */
+ record_new_stack_level ();
return target;
}