Align global variables

This commit is contained in:
Rui Ueyama 2019-08-20 21:37:13 +09:00
parent 5c6e15506a
commit 342e5b8b13
1 changed files with 2 additions and 0 deletions

View File

@ -520,6 +520,7 @@ static void emit_data(Program *prog) {
if (var->initializer)
continue;
printf(".align %d\n", var->ty->align);
printf("%s:\n", var->name);
printf(" .zero %d\n", var->ty->size);
}
@ -531,6 +532,7 @@ static void emit_data(Program *prog) {
if (!var->initializer)
continue;
printf(".align %d\n", var->ty->align);
printf("%s:\n", var->name);
for (Initializer *init = var->initializer; init; init = init->next) {