summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-12-30 23:13:21 +0100
committerMatthias Braun <matze@braunis.de>2016-12-30 23:28:33 +0100
commit88814e321f931710e356caee15d890b53bbf8fb8 (patch)
tree5202169e15fd975577bb993e2e130c0a82f19fa9 /src
parent456bee552059c3c828728f9fe4c7d35e8481e6f4 (diff)
Do not create Pin nodes in the const_code irg
Diffstat (limited to 'src')
-rw-r--r--src/firm/ast2firm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c
index 280e9f7..7933f13 100644
--- a/src/firm/ast2firm.c
+++ b/src/firm/ast2firm.c
@@ -1687,11 +1687,17 @@ typedef ir_node *(*create_div_func)(dbg_info *dbgi, ir_node *memory,
static ir_node *create_divmod(create_div_func cons, unsigned pn_res,
dbg_info *dbgi, ir_node *left, ir_node *right)
{
- ir_node *memory = get_store();
- ir_node *pin = new_Pin(memory);
- set_store(pin);
- ir_node *op = cons(dbgi, pin, left, right, false);
- ir_mode *mode = get_irn_mode(left);
+ ir_node *mem;
+ if (current_ir_graph == get_const_code_irg()) {
+ mem = new_NoMem();
+ } else {
+ ir_node *memory = get_store();
+ ir_node *pin = new_Pin(memory);
+ set_store(pin);
+ mem = pin;
+ }
+ ir_node *op = cons(dbgi, mem, left, right, false);
+ ir_mode *mode = get_irn_mode(left);
return new_d_Proj(dbgi, op, mode, pn_res);
}