+ }
+
+ /* Beware: currently Alloc nodes without a result might happen,
+ only escape analysis kills them and this phase runs only for object
+ oriented source. We kill the Alloc here. */
+ if (alloc_res == NULL && alloc_mem) {
+ exchange(alloc_mem, get_Alloc_mem(alloc));
+ return curr_sp;
+ }
+
+ /* we might need to multiply the size with the element size */
+ if(type != get_unknown_type() && get_type_size_bytes(type) != 1) {
+ tarval *tv = new_tarval_from_long(get_type_size_bytes(type), mode_Iu);
+ ir_node *cnst = new_rd_Const(NULL, irg, block, mode_Iu, tv);
+ ir_node *mul = new_rd_Mul(NULL, irg, block, get_Alloc_size(alloc),
+ cnst, mode_Iu);
+ size = mul;
+ } else {
+ size = get_Alloc_size(alloc);
+ }
+
+ /* The stack pointer will be modified in an unknown manner.
+ We cannot omit it. */
+ env->call->flags.bits.try_omit_fp = 0;
+ new_alloc = be_new_AddSP(env->isa->sp, irg, block, curr_sp, size);
+
+ if(alloc_mem != NULL) {
+ ir_node *addsp_mem;
+ ir_node *sync;
+
+ addsp_mem = new_r_Proj(irg, block, new_alloc, mode_M, pn_be_AddSP_M);
+
+ // We need to sync the output mem of the AddSP with the input mem
+ // edge into the alloc node
+ ins[0] = get_Alloc_mem(alloc);
+ ins[1] = addsp_mem;
+ sync = new_r_Sync(irg, block, 2, ins);
+
+ exchange(alloc_mem, sync);
+ }
+
+ exchange(alloc, new_alloc);