summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-12-02 11:22:50 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-12-02 11:22:50 +0100
commita04e79625145e6cfcb804fff17db24a3910e1cba (patch)
tree39b99e550e6f5c2e9849ddb7fa2a263bb364ae3e
parent7b128993471814bab441d6e317451b37209d4a5f (diff)
recursion
-rw-r--r--gcc/ipa-type-escape-analysis.c15
-rw-r--r--gcc/ipa-type-escape-analysis.h6
2 files changed, 10 insertions, 11 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c
index 4c7c6d980a3..f465721d2bf 100644
--- a/gcc/ipa-type-escape-analysis.c
+++ b/gcc/ipa-type-escape-analysis.c
@@ -3450,15 +3450,14 @@ type_structural_equality::_equal (tree l, tree r)
if (!equal_codes)
return equal_codes;
- bool recurse_l = set_l.find (l) != set_l.end ();
- bool recurse_r = set_r.find (r) != set_r.end ();
- // Verify that this the case every time.
- bool recurse = recurse_l || recurse_r;
+ bool recurse2_l = set2_l.contains (l);
+ bool recurse2_r = set2_r.contains (r);
+ bool recurse = recurse2_l || recurse2_r;
if (recurse)
return recurse;
- set_l.insert (l);
- set_r.insert (r);
+ set2_l.add (l);
+ set2_r.add (r);
const enum tree_code code = TREE_CODE (l);
bool equal_children = false;
switch (code)
@@ -3493,8 +3492,8 @@ type_structural_equality::_equal (tree l, tree r)
break;
}
- set_l.erase (l);
- set_r.erase (r);
+ set2_l.remove (l);
+ set2_r.remove (r);
return equal_children;
}
diff --git a/gcc/ipa-type-escape-analysis.h b/gcc/ipa-type-escape-analysis.h
index b56e4ee7c9d..f552ebea598 100644
--- a/gcc/ipa-type-escape-analysis.h
+++ b/gcc/ipa-type-escape-analysis.h
@@ -969,13 +969,13 @@ protected:
private:
// Use to limit recursion if we are revisiting a node
- typedef std::set<tree> tset_t;
+ typedef hash_set<tree> tset2_t;
// Limit recursion for LHS
- tset_t set_l;
+ tset2_t set2_l;
// Limit recursion for RHS
- tset_t set_r;
+ tset2_t set2_r;
// Determine if the code is equal
bool _equal_code (tree a, tree b);