diff options
| author | 2025-11-22 09:50:14 +0100 | |
|---|---|---|
| committer | 2025-11-22 09:50:14 +0100 | |
| commit | e471cfe5d94f47b7bcd95ce37e7d5c75997a7a67 (patch) | |
| tree | d8082d30d1036ebafcd2e73789fa80940335a7ab /c | |
| parent | fd74f66379b45e2ce29fd83a00f4cbebb2214269 (diff) | |
amd64/emit: fix REX-requiring 8-bit GPR encoding checking wrong reg
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3227,6 +3227,8 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) case EPLUS: r = compileexpr(fn, sub, discard); if (discard) return NOREF; + if (isscalar(ex->ty) && typesize(ex->ty) < typesize(sub->ty)) + return narrow(fn, type2cls[scalartypet(ex->ty)], ex->ty, r, 0); return cvt(fn, ex->ty, sub->ty, r); case ENEG: op = Oneg; |