From e049bdb1bf525af3dc9d813940e6f4fa92c04b77 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 14 Sep 2021 14:19:32 -0700 Subject: qbe: Support more aligned types in funccopy We don't have any of these currently, but it's easier to support than to error out. --- qbe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qbe.c b/qbe.c index b255d93..df6a74d 100644 --- a/qbe.c +++ b/qbe.c @@ -303,14 +303,13 @@ funccopy(struct func *f, struct value *dst, struct value *src, uint64_t size, in struct value *tmp, *inc; uint64_t off; + assert((align & align - 1) == 0); class = 'w'; switch (align) { case 1: load = ILOADUB, store = ISTOREB; break; case 2: load = ILOADUH, store = ISTOREH; break; case 4: load = ILOADW, store = ISTOREW; break; - case 8: load = ILOADL, store = ISTOREL, class = 'l'; break; - default: - fatal("internal error; invalid alignment %d", align); + default: load = ILOADL, store = ISTOREL, align = 8, class = 'l'; break; } inc = mkintconst(align); off = 0; -- cgit v1.2.3