summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhilipp Serrer <philipp@serrer.de>2017-11-28 19:21:20 +0100
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2017-12-13 17:59:20 +0100
commit14051cd7aa1606045c317580699f6f37f050d822 (patch)
tree8cdad30009e5c0036e49d9db636f120fd937691b
parentfc3f78377afd63f76533e2830eab352ac2ab7aed (diff)
Fix empty structs as return type and param
-rw-r--r--ir/lower/lower_calls.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c
index 54d77b0..38bebfc 100644
--- a/ir/lower/lower_calls.c
+++ b/ir/lower/lower_calls.c
@@ -838,7 +838,11 @@ static void fix_int_return(cl_entry const *const entry,
}
}
- ir_node *const sync = new_r_Sync(block, sync_index, sync_in);
+ ir_node *sync = proj_mem;
+ if (sync_index > 0) {
+ sync = new_r_Sync(block, sync_index, sync_in);
+ }
+
edges_reroute(dummy, sync);
}
@@ -972,7 +976,7 @@ static void fix_call_compound_params(const cl_entry *entry, const ir_type *ctp)
DEBUG_ONLY(size_t max_input = PARAM_TO_INPUT(n_params_lower));
for (size_t h = 0; h < n_params; ++h) {
- assert(i < max_input);
+ assert(i <= max_input);
ir_type *arg_type = get_method_param_type(ctp, h);
ir_node *arg = get_Call_param(call, h);
@@ -1092,7 +1096,10 @@ static void transform_return(ir_node *ret, size_t n_ret_com, wlk_env *env)
new_in[n_in++] = new_r_Proj(load, mode, pn_Load_res);
offset += get_mode_size_bytes(mode);
}
- mem = new_r_Sync(block, length, sync_in);
+
+ if (length > 0) {
+ mem = new_r_Sync(block, length, sync_in);
+ }
}
continue;
}