I noticed a minor tweak I could make to speed this up and figure I might
as well, even though it shouldn't be a significant component of compile
time.
Tested x86_64-pc-linux-gnu, applying to trunk and 4.6.
commit 4c3e6de3e988799dac490b6eb2b762674b5bb9f8
Author: Jason Merrill <ja...@redhat.com>
Date: Thu May 5 17:57:50 2011 -0400
* decl.c (stabilize_save_expr_r): Set *walk_subtrees as
appropriate.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c5184e0..b5d4cc2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;
}