diff options
| author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-24 08:25:56 +0000 |
|---|---|---|
| committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-24 08:25:56 +0000 |
| commit | dfb72f1fd5d29f65baef661fcdb76766692172e1 (patch) | |
| tree | df5da848317571f941c02ebee15f2e17d27a24fd | |
| parent | 65b7f83fcb833ccbead60bbb1533884ad0898486 (diff) | |
| download | ppe42-gcc-dfb72f1fd5d29f65baef661fcdb76766692172e1.tar.gz ppe42-gcc-dfb72f1fd5d29f65baef661fcdb76766692172e1.zip | |
* c-semantics.c (add_scope_stmt): Don't call
current_scope_stmt_stack multiple times.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41521 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/c-semantics.c | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd986491a4e..c265a991ceb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-04-24 Nathan Sidwell <nathan@codesourcery.com> + + * c-semantics.c (add_scope_stmt): Don't call + current_scope_stmt_stack multiple times. + 2001-04-24 Zack Weinberg <zackw@stanford.edu> Nathan Sidwell <nathan@codesourcery.com> diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 13480480a43..7f88e970acd 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -112,8 +112,9 @@ add_scope_stmt (begin_p, partial_p) int begin_p; int partial_p; { + tree *stack_ptr = current_scope_stmt_stack (); tree ss; - tree top; + tree top = *stack_ptr; /* Build the statement. */ ss = build_stmt (SCOPE_STMT, NULL_TREE); @@ -123,15 +124,13 @@ add_scope_stmt (begin_p, partial_p) /* Keep the scope stack up to date. */ if (begin_p) { - *current_scope_stmt_stack () - = tree_cons (ss, NULL_TREE, *current_scope_stmt_stack ()); - top = *current_scope_stmt_stack (); + top = tree_cons (ss, NULL_TREE, top); + *stack_ptr = top; } else { - top = *current_scope_stmt_stack (); TREE_VALUE (top) = ss; - *current_scope_stmt_stack () = TREE_CHAIN (top); + *stack_ptr = TREE_CHAIN (top); } /* Add the new statement to the statement-tree. */ |

