From d14415a4e62cad0d87a4e6529b50d48cd160003f Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 30 Aug 2026 08:12:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(compiler):=20asm=20=E7=BA=A6=E6=9D=9F?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E8=A1=A5=E5=85=A8=208=20=E4=BD=8D=E5=AF=84?= =?UTF-8?q?=E5=AD=98=E5=99=A8=20clobber=EF=BC=88AL/AH/BL/BH/CL/CH/DL/DH?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/Call/CallGenCBuiltin.vp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/App/lib/core/Gen/Call/CallGenCBuiltin.vp b/App/lib/core/Gen/Call/CallGenCBuiltin.vp index 30df6e4..a871083 100644 --- a/App/lib/core/Gen/Call/CallGenCBuiltin.vp +++ b/App/lib/core/Gen/Call/CallGenCBuiltin.vp @@ -844,6 +844,17 @@ class CallGenCBuiltin(CallGenBase.CallGenBase): if string.strcmp(attr_name, "CLOBBER_CX") == 0: return "cx" if string.strcmp(attr_name, "CLOBBER_SI") == 0: return "si" if string.strcmp(attr_name, "CLOBBER_DI") == 0: return "di" + # 8 位寄存器破坏描述符(对齐 t.py 标准常量集;缺 AL 曾致 AllocPage + # `rep stosb` 的 ~{al} 丢失——LLVM 不知 AL 被改,页地址 $0 可能被分配 + # 进 RAX 被 mov al,0 破坏,A7 根因) + if string.strcmp(attr_name, "CLOBBER_AL") == 0: return "al" + if string.strcmp(attr_name, "CLOBBER_AH") == 0: return "ah" + if string.strcmp(attr_name, "CLOBBER_BL") == 0: return "bl" + if string.strcmp(attr_name, "CLOBBER_BH") == 0: return "bh" + if string.strcmp(attr_name, "CLOBBER_CL") == 0: return "cl" + if string.strcmp(attr_name, "CLOBBER_CH") == 0: return "ch" + if string.strcmp(attr_name, "CLOBBER_DL") == 0: return "dl" + if string.strcmp(attr_name, "CLOBBER_DH") == 0: return "dh" # Output 输出约束 if string.strcmp(attr_name, "OUTPUT_REG") == 0: return "=r"