aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow.h
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-07-19 03:36:15 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2005-07-19 03:36:15 +0000
commitb9d3348810a657d5b64e23cb6f098bd7d479191b (patch)
tree880e6bcccb700c5d4ffc320ff94104a03e895fc9 /gcc/tree-flow.h
parent9fa264571da0247ed1b0d0d0e64897f7b3731c50 (diff)
downloadgcc-b9d3348810a657d5b64e23cb6f098bd7d479191b.zip
gcc-b9d3348810a657d5b64e23cb6f098bd7d479191b.tar.gz
gcc-b9d3348810a657d5b64e23cb6f098bd7d479191b.tar.bz2
re PR tree-optimization/22483 (ICE : tree check: expected ssa_name, have var_decl in is_old_name, at tree-into-ssa.c:466)
2005-07-18 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/22483 * tree-complex.c (create_components): Use safe_referenced_var_iterator and FOR_EACH_REFERENCED_VAR_SAFE. * tree-flow-inline.h (fill_referenced_var_vec): New function. * tree-flow.h (safe_referenced_var_iterator): New structure. (FOR_EACH_REFERENCED_VAR_SAFE): New macro. * tree-ssa-alias.c (setup_pointers_and_addressables): Use safe_referenced_var iterator. (add_type_alias): Ditto. From-SVN: r102150
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r--gcc/tree-flow.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 2bf40df..da49ed1 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -389,11 +389,35 @@ typedef struct
} referenced_var_iterator;
+/* This macro loops over all the referenced vars, one at a time, putting the
+ current var in VAR. Note: You are not allowed to add referenced variables
+ to the hashtable while using this macro. Doing so may cause it to behave
+ erratically. */
+
#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
for ((VAR) = first_referenced_var (&(ITER)); \
!end_referenced_vars_p (&(ITER)); \
(VAR) = next_referenced_var (&(ITER)))
+
+typedef struct
+{
+ int i;
+} safe_referenced_var_iterator;
+
+/* This macro loops over all the referenced vars, one at a time, putting the
+ current var in VAR. You are allowed to add referenced variables during the
+ execution of this macro, however, the macro will not iterate over them. It
+ requires a temporary vector of trees, VEC, whose lifetime is controlled by
+ the caller. The purpose of the vector is to temporarily store the
+ referenced_variables hashtable so that adding referenced variables does not
+ affect the hashtable. */
+
+#define FOR_EACH_REFERENCED_VAR_SAFE(VAR, VEC, ITER) \
+ for ((ITER).i = 0, fill_referenced_var_vec (&(VEC)); \
+ VEC_iterate (tree, (VEC), (ITER).i, (VAR)); \
+ (ITER).i++)
+
/* Array of all variables referenced in the function. */
extern GTY((param_is (struct int_tree_map))) htab_t referenced_vars;