aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-08-24 06:11:02 +0000
committerRichard Stallman <rms@gnu.org>1992-08-24 06:11:02 +0000
commitc7d2d61d20c859ef2a9796c03b573204e7f2ae8c (patch)
treece73ac98ae25549b4faa5469a937c1af60271358 /gcc
parent7343f784c87806b0bae4be3d780b8d8a62e1144c (diff)
downloadgcc-c7d2d61d20c859ef2a9796c03b573204e7f2ae8c.zip
gcc-c7d2d61d20c859ef2a9796c03b573204e7f2ae8c.tar.gz
gcc-c7d2d61d20c859ef2a9796c03b573204e7f2ae8c.tar.bz2
(expand_end_bindings): Generation of NOTE_INSN_BLOCK_END
moved down so that it occurs after call to `expand_cleanups'. From-SVN: r1937
Diffstat (limited to 'gcc')
-rw-r--r--gcc/stmt.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 71f15dd..ee4e0e6 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2481,14 +2481,6 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
&& ! DECL_IN_SYSTEM_HEADER (decl))
warning_with_decl (decl, "unused variable `%s'");
- /* Mark the beginning and end of the scope if requested. */
-
- if (mark_ends)
- emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
- else
- /* Get rid of the beginning-mark if we don't make an end-mark. */
- NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
-
if (thisblock->exit_label)
{
do_pending_stack_adjust ();
@@ -2670,6 +2662,16 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
dont_jump_in);
}
+ /* Mark the beginning and end of the scope if requested.
+ We do this now, after running cleanups on the variables
+ just going out of scope, so they are in scope for their cleanups. */
+
+ if (mark_ends)
+ emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
+ else
+ /* Get rid of the beginning-mark if we don't make an end-mark. */
+ NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
+
/* If doing stupid register allocation, make sure lives of all
register variables declared here extend thru end of scope. */