summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-14 11:04:43 +0200
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-06-03 16:05:57 +0200
commitc1c24a2e7c0618eac9e23355d5d91f110d87b479 (patch)
tree4c51ffaa4c341d2db661065ec6338615ddd94423
parent738039a9f3dd1b2874cefb41c8cc2f5d6a235833 (diff)
Adds fuzz mode
-rw-r--r--gcc/ipa-escape-analysis.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ipa-escape-analysis.c b/gcc/ipa-escape-analysis.c
index 5b0e878fb2c..ba0ae26c88e 100644
--- a/gcc/ipa-escape-analysis.c
+++ b/gcc/ipa-escape-analysis.c
@@ -36,6 +36,8 @@
#include "collect-types.h"
#include "name-types.h"
+#define FUZZ_MODE 0
+
namespace type_playground {
enum type_comparison_func_enum {
EQ_POINTER = 0,
@@ -177,6 +179,9 @@ collect_types_from_constructor_array(const_tree expr, typeset &types)
const_tree type = TREE_TYPE(expr);
assert_is_type(type, ARRAY_TYPE);
//TODO: Collect types from here
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
}
static void
@@ -191,6 +196,9 @@ collect_types_from_constructor_record_or_union(const_tree expr, typeset &types)
const bool is_valid_input = is_record || is_union || is_qual_union;
gcc_assert(is_valid_input);
//TODO: Collect types from here
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
}
static void
@@ -222,6 +230,9 @@ collect_types_from_constructor(const_tree expr, typeset &types)
break;
default:
// TODO: I should fuzz this, I got a constructor of an integer type?
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
return;
break;
}
@@ -252,6 +263,9 @@ static void
collect_types_from_bit_field_ref(const_tree expr, typeset &types)
{
// TODO: How to collect types from bit_field_ref?
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
}
static void
@@ -264,6 +278,9 @@ collect_types_from_view_convert_expr(const_tree expr, typeset &types)
// through an integer mode and an intermediate BIT_FIELD_REF.
// https://gcc.gnu.org/wiki/MemRef
//TODO: How to collect types from VIEW_CONVERT_EXPR?
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
}
static void
@@ -475,7 +492,7 @@ collect_types_from_stmt_return(gimple *stmt, typeset &types)
is_gimple_code(stmt, GIMPLE_RETURN);
const_tree retval = gimple_return_retval(stmt);
gcc_assert(retval);
- collect_types_from_expr(retval);
+ collect_types_from_expr(retval, types);
}
static void
@@ -498,6 +515,9 @@ collect_types_from_stmt(gimple *stmt, typeset &types)
break;
case GIMPLE_LABEL:
case GIMPLE_PREDICT:
+#ifdef FUZZ_MODE
+ gcc_unreachable();
+#endif
break;
default:
{
@@ -733,7 +753,6 @@ iphw_execute()
// We still need to collect types from
// the function signatures of functions without gimple bodies...
-
filter_out_types_in_set(types);
compare_types_in_set(types);
return 0;