mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-08 16:21:32 +00:00
make gcc_plugin compilable for gcc 3.6.0
This commit is contained in:
parent
6ed40d5a08
commit
ed54532f29
@ -243,8 +243,8 @@ struct afl_cmplog_pass : afl_base_pass {
|
|||||||
|
|
||||||
tree t = build_nonstandard_integer_type(sz, 1);
|
tree t = build_nonstandard_integer_type(sz, 1);
|
||||||
|
|
||||||
tree s = make_ssa_name(t);
|
tree s = make_ssa_name(t);
|
||||||
gimple *g = gimple_build_assign(s, VIEW_CONVERT_EXPR,
|
gimple g = gimple_build_assign(s, VIEW_CONVERT_EXPR,
|
||||||
build1(VIEW_CONVERT_EXPR, t, lhs));
|
build1(VIEW_CONVERT_EXPR, t, lhs));
|
||||||
lhs = s;
|
lhs = s;
|
||||||
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
||||||
@ -263,8 +263,8 @@ struct afl_cmplog_pass : afl_base_pass {
|
|||||||
lhs = fold_convert_loc(UNKNOWN_LOCATION, t, lhs);
|
lhs = fold_convert_loc(UNKNOWN_LOCATION, t, lhs);
|
||||||
if (!is_gimple_val(lhs)) {
|
if (!is_gimple_val(lhs)) {
|
||||||
|
|
||||||
tree s = make_ssa_name(t);
|
tree s = make_ssa_name(t);
|
||||||
gimple *g = gimple_build_assign(s, lhs);
|
gimple g = gimple_build_assign(s, lhs);
|
||||||
lhs = s;
|
lhs = s;
|
||||||
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
||||||
|
|
||||||
@ -273,8 +273,8 @@ struct afl_cmplog_pass : afl_base_pass {
|
|||||||
rhs = fold_convert_loc(UNKNOWN_LOCATION, t, rhs);
|
rhs = fold_convert_loc(UNKNOWN_LOCATION, t, rhs);
|
||||||
if (!is_gimple_val(rhs)) {
|
if (!is_gimple_val(rhs)) {
|
||||||
|
|
||||||
tree s = make_ssa_name(t);
|
tree s = make_ssa_name(t);
|
||||||
gimple *g = gimple_build_assign(s, rhs);
|
gimple g = gimple_build_assign(s, rhs);
|
||||||
rhs = s;
|
rhs = s;
|
||||||
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ struct afl_cmplog_pass : afl_base_pass {
|
|||||||
|
|
||||||
/* Insert the call. */
|
/* Insert the call. */
|
||||||
tree att = build_int_cst(t8u, attr);
|
tree att = build_int_cst(t8u, attr);
|
||||||
gimple *call;
|
gimple call;
|
||||||
if (pass_n)
|
if (pass_n)
|
||||||
call = gimple_build_call(fn, 4, lhs, rhs, att,
|
call = gimple_build_call(fn, 4, lhs, rhs, att,
|
||||||
build_int_cst(t8u, sz / 8 - 1));
|
build_int_cst(t8u, sz / 8 - 1));
|
||||||
@ -305,7 +305,7 @@ struct afl_cmplog_pass : afl_base_pass {
|
|||||||
gimple_stmt_iterator gsi = gsi_last_bb(bb);
|
gimple_stmt_iterator gsi = gsi_last_bb(bb);
|
||||||
if (gsi_end_p(gsi)) continue;
|
if (gsi_end_p(gsi)) continue;
|
||||||
|
|
||||||
gimple *stmt = gsi_stmt(gsi);
|
gimple stmt = gsi_stmt(gsi);
|
||||||
|
|
||||||
if (gimple_code(stmt) == GIMPLE_COND) {
|
if (gimple_code(stmt) == GIMPLE_COND) {
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ struct afl_cmptrs_pass : afl_base_pass {
|
|||||||
for (gimple_stmt_iterator gsi = gsi_after_labels(bb); !gsi_end_p(gsi);
|
for (gimple_stmt_iterator gsi = gsi_after_labels(bb); !gsi_end_p(gsi);
|
||||||
gsi_next(&gsi)) {
|
gsi_next(&gsi)) {
|
||||||
|
|
||||||
gimple *stmt = gsi_stmt(gsi);
|
gimple stmt = gsi_stmt(gsi);
|
||||||
|
|
||||||
/* We're only interested in GIMPLE_CALLs. */
|
/* We're only interested in GIMPLE_CALLs. */
|
||||||
if (gimple_code(stmt) != GIMPLE_CALL) continue;
|
if (gimple_code(stmt) != GIMPLE_CALL) continue;
|
||||||
@ -291,8 +291,8 @@ struct afl_cmptrs_pass : afl_base_pass {
|
|||||||
tree c = fold_convert_loc(UNKNOWN_LOCATION, tp8u, arg[i]);
|
tree c = fold_convert_loc(UNKNOWN_LOCATION, tp8u, arg[i]);
|
||||||
if (!is_gimple_val(c)) {
|
if (!is_gimple_val(c)) {
|
||||||
|
|
||||||
tree s = make_ssa_name(tp8u);
|
tree s = make_ssa_name(tp8u);
|
||||||
gimple *g = gimple_build_assign(s, c);
|
gimple g = gimple_build_assign(s, c);
|
||||||
c = s;
|
c = s;
|
||||||
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ struct afl_cmptrs_pass : afl_base_pass {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gimple *call = gimple_build_call(fn, 2, arg[0], arg[1]);
|
gimple call = gimple_build_call(fn, 2, arg[0], arg[1]);
|
||||||
gsi_insert_before(&gsi, call, GSI_SAME_STMT);
|
gsi_insert_before(&gsi, call, GSI_SAME_STMT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -498,3 +498,10 @@ struct afl_base_pass : gimple_opt_pass {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
// compatibility for older gcc versions
|
||||||
|
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
|
||||||
|
60200 /* >= version 6.2.0 */
|
||||||
|
#define gimple gimple *
|
||||||
|
#else
|
||||||
|
#define gimple gimple
|
||||||
|
#endif
|
||||||
|
@ -125,7 +125,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "afl-gcc-common.h"
|
#include "afl-gcc-common.h"
|
||||||
|
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
|
||||||
|
60200 /* >= version 6.2.0 */
|
||||||
#include "memmodel.h"
|
#include "memmodel.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This plugin, being under the same license as GCC, satisfies the
|
/* This plugin, being under the same license as GCC, satisfies the
|
||||||
"GPL-compatible Software" definition in the GCC RUNTIME LIBRARY
|
"GPL-compatible Software" definition in the GCC RUNTIME LIBRARY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user