diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-19 09:33:27 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-19 09:33:27 +0000 |
commit | 97354ae4d5a266ad985277a02cbc65638e517156 (patch) | |
tree | 1a601dd44371c7e5dd197e955db6b56a8a9dd835 /gcc/explow.c | |
parent | a8b58ffbf5223484ebd033c8239ad6cd66f316a9 (diff) | |
download | gcc-97354ae4d5a266ad985277a02cbc65638e517156.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223348 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index de446a903fd..e7768aeb77d 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; } |