Browse Source

Change local variable alignment to 16 bytes for the time being

gingerBill 7 years ago
parent
commit
001b48a5c6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/ir.cpp

+ 3 - 1
src/ir.cpp

@@ -905,7 +905,9 @@ irValue *ir_instr_local(irProcedure *p, Entity *e, bool zero_initialized) {
 	i->Local.entity = e;
 	i->Local.entity = e;
 	i->Local.type = make_type_pointer(p->module->allocator, e->type);
 	i->Local.type = make_type_pointer(p->module->allocator, e->type);
 	i->Local.zero_initialized = zero_initialized;
 	i->Local.zero_initialized = zero_initialized;
-	i->Local.alignment = type_align_of(p->module->allocator, e->type);
+	// i->Local.alignment = type_align_of(p->module->allocator, e->type);
+	// TODO(bill): determine the correct alignment
+	i->Local.alignment = gb_max(16, type_align_of(p->module->allocator, e->type));
 	array_init(&i->Local.referrers, heap_allocator()); // TODO(bill): Replace heap allocator here
 	array_init(&i->Local.referrers, heap_allocator()); // TODO(bill): Replace heap allocator here
 	ir_module_add_value(p->module, e, v);
 	ir_module_add_value(p->module, e, v);
 	return v;
 	return v;