c-semantics.c (add_scope_stmt): Don't call current_scope_stmt_stack multiple times.
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 24 Apr 2001 08:25:56 +0000 (08:25 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 24 Apr 2001 08:25:56 +0000 (08:25 +0000)
* c-semantics.c (add_scope_stmt): Don't call
current_scope_stmt_stack multiple times.

From-SVN: r41521

gcc/ChangeLog
gcc/c-semantics.c

index cd986491a4ed0161ea45eaafedd42b4c0c511d1c..c265a991ceb6fb47fdac2aac403c4a0514844943 100644 (file)
@@ -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>
 
index 13480480a4337e757f9d80a55d56da94eaad18c5..7f88e970acdebee05affaed30004243971cf7778 100644 (file)
@@ -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.  */