summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-15 10:35:24 +0200
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-15 10:35:24 +0200
commitb0a92a75bb40c2dee30b7bf8813d82b1d8d5a7dc (patch)
tree3ce16208354ff445fc263f5000bbcdfa1f8b2027
parented184adaadbca465924b8ee3ddf1b7a367e60ae0 (diff)
Adds sanity check
-rw-r--r--gcc/ipa-escape-analysis.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ipa-escape-analysis.c b/gcc/ipa-escape-analysis.c
index 6c4e9105254..cdc249e55fb 100644
--- a/gcc/ipa-escape-analysis.c
+++ b/gcc/ipa-escape-analysis.c
@@ -787,14 +787,29 @@ collect_types(ptrset_t &types)
}
}
+static void
+sanity_check_ptr_xor_complement(ptrset_t &types)
+{
+ for (auto i = types.points_to_record.cbegin(); i != types.points_to_record.cend(); ++i)
+ {
+ for (auto j = types.complement.cbegin(); j != types.complement.cend(); ++j)
+ {
+ const_tree type_ptr = *i;
+ const_tree type_com = *j;
+ const bool valid_sets = !eq_type_compare(type_ptr, type_com);
+ gcc_assert(valid_sets);
+ }
+ }
+}
+
static unsigned int
iphw_execute()
{
//test_type_equality::run_tests();
//test_naming_types::run_tests();
ptrset_t types;
-
collect_types(types);
+ sanity_check_ptr_xor_complement(types);
filter_out_types_in_set(types);
compare_types_in_set(types);
return 0;