pengfei added a comment.
Sorry, I missed this patch. I think this is a wrong fix. The `buf[9]` doesn't
make sense to X86 registers. You can see GCC fails with it too.
https://godbolt.org/z/vPcfoG714
I think we just need to do sema check for it to emit error gracefully. BTW, I
have a patch D107
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf76d3b800f73: [clang][CGStmt] fix crash on invalid asm
statement (authored by ztong0001, committed by MaskRay).
Changed prior to commit:
https://r
ztong0001 added a comment.
Hi Fangrui @MaskRay,
Thanks for your review. Could you please also help me landing it since I don't
have write permission to the repo.
Please use Tong Zhang
Thanks and have a good one!
- Tong
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://
MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.
Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120596/new/
https://reviews.llvm.org/D120596
__
ztong0001 added inline comments.
Comment at: clang/lib/CodeGen/CGStmt.cpp:2517
+else if (OutputTy->isFloatingPointTy())
Arg = Builder.CreateFPExt(Arg, OutputTy);
}
MaskRay wrote:
> Shall we keep the assert (in a new `else` branch) just i
MaskRay added inline comments.
Comment at: clang/lib/CodeGen/CGStmt.cpp:2517
+else if (OutputTy->isFloatingPointTy())
Arg = Builder.CreateFPExt(Arg, OutputTy);
}
Shall we keep the assert (in a new `else` branch) just in case there are ot
ztong0001 updated this revision to Diff 411577.
ztong0001 added a comment.
reformat code
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120596/new/
https://reviews.llvm.org/D120596
Files:
clang/lib/CodeGen/CGStmt.cpp
clang/test/CodeGen/X86/x86_
ztong0001 updated this revision to Diff 411542.
ztong0001 added a comment.
reformat test code
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120596/new/
https://reviews.llvm.org/D120596
Files:
clang/lib/CodeGen/CGStmt.cpp
clang/test/CodeGen/X86
ztong0001 created this revision.
Herald added a subscriber: pengfei.
ztong0001 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Clang is crashing on the following statement
char var[9];
__asm__ ("" : "=r" (var) : "0" (var));
This is si