summaryrefslogtreecommitdiffhomepage
path: root/ir/lower
diff options
context:
space:
mode:
authorPhilipp Serrer <philipp@serrer.de>2017-11-28 19:23:10 +0100
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2017-12-13 17:59:20 +0100
commit05e3419ad15dd55e62ddcc0ac1dcad4e6830dba1 (patch)
tree5e08edb34d38188afcd59a756b6d7147632f3467 /ir/lower
parent14051cd7aa1606045c317580699f6f37f050d822 (diff)
Fix float values in small structs passed by value
Diffstat (limited to 'ir/lower')
-rw-r--r--ir/lower/lower_calls.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c
index 38bebfc..72c3ab8 100644
--- a/ir/lower/lower_calls.c
+++ b/ir/lower/lower_calls.c
@@ -1218,7 +1218,22 @@ static ir_node *build_compound_from_arguments(ir_node *irn, wlk_env *env, unsign
}
ir_mode *small_mode = reduce_mode(arg_mode, tp_size - offset);
- value = new_rd_Conv(dbgi, block, value, small_mode);
+ if (mode_is_float(arg_mode)) {
+ switch (get_mode_size_bytes(small_mode)) {
+ case 4:
+ small_mode = mode_F;
+ break;
+ case 8:
+ small_mode = mode_D;
+ break;
+ default:
+ panic("Cannot handle float modes unequal to 4 or 8 bytes.");
+ }
+ }
+
+ if (small_mode != arg_mode) {
+ value = new_rd_Conv(dbgi, block, value, small_mode);
+ }
ir_node *store = new_rd_Store(dbgi, block, mem, ptr, value,
tp, cons_none);