decl.c (stabilize_save_expr_r): Set *walk_subtrees as appropriate.
authorJason Merrill <jason@redhat.com>
Fri, 6 May 2011 21:57:56 +0000 (17:57 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 6 May 2011 21:57:56 +0000 (17:57 -0400)
* decl.c (stabilize_save_expr_r): Set *walk_subtrees as
appropriate.

From-SVN: r173512

gcc/cp/ChangeLog
gcc/cp/decl.c

index af5e6d05544462133d16bd074d946d10a36d087f..70c7f3e31a34d96962bcefb0367f878d2537c06a 100644 (file)
@@ -1,5 +1,8 @@
 2011-05-06  Jason Merrill  <jason@redhat.com>
 
+       * decl.c (stabilize_save_expr_r): Set *walk_subtrees as
+       appropriate.
+
        PR c++/48909
        * semantics.c (cxx_eval_conditional_expression): Check
        integer_zerop instead.
index e766503b82039e916525c7e1d50fffe723f4d417..764d5dffb179cfe59ed5f1e5488e9ea1da4d3fca 100644 (file)
@@ -7615,8 +7615,9 @@ stabilize_save_expr_r (tree *expr_p, int *walk_subtrees, void *data)
       cp_walk_tree (&op, stabilize_save_expr_r, data, pset);
       if (TREE_SIDE_EFFECTS (op))
        TREE_OPERAND (expr, 0) = get_temp_regvar (TREE_TYPE (op), op);
+      *walk_subtrees = 0;
     }
-  else if (!EXPR_P (expr))
+  else if (!EXPR_P (expr) || !TREE_SIDE_EFFECTS (expr))
     *walk_subtrees = 0;
   return NULL;
 }