summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bevarargs.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-09-27 14:54:07 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-09-27 16:02:39 +0200
commit391b4c3632a2b1035c9524d78dca429c60a8d361 (patch)
treeb1dd1780a068fbfd3939e13f5a299d58401b53fb /ir/be/bevarargs.c
parenta24eac8cdb7f3c2b851a6c5c321a9a311298a254 (diff)
sparc: Use the correct type for the load and offset calculation in vararg lowering.
When compound types are passed as pointer, then not only the mode, but also the type, needs to be adjusted to a pointer.
Diffstat (limited to 'ir/be/bevarargs.c')
-rw-r--r--ir/be/bevarargs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ir/be/bevarargs.c b/ir/be/bevarargs.c
index 1878bad..d73a43e 100644
--- a/ir/be/bevarargs.c
+++ b/ir/be/bevarargs.c
@@ -24,7 +24,7 @@ static void be_default_lower_va_arg(ir_node *const node, bool const compound_is_
dbg_info *dbgi = get_irn_dbg_info(node);
ir_graph *irg = get_irn_irg(node);
- ir_type *const aptype = get_method_res_type(get_Builtin_type(node), 0);
+ ir_type *aptype = get_method_res_type(get_Builtin_type(node), 0);
ir_node *const ap = get_irn_n(node, 1);
ir_node *const node_mem = get_Builtin_mem(node);
@@ -35,6 +35,7 @@ static void be_default_lower_va_arg(ir_node *const node, bool const compound_is_
goto load;
} else if (compound_is_ptr) {
apmode = mode_P;
+ aptype = get_type_for_mode(apmode);
load:;
ir_node *const load = new_rd_Load(dbgi, block, node_mem, ap, apmode, aptype, cons_none);
res = new_r_Proj(load, apmode, pn_Load_res);