[PATCH] D107141: [Inline-asm] Add semacheck for unsupported constraint

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 2 11:45:41 PDT 2021


jyu2 added a comment.

First I did not say "code doesn't make much sense to me".  This is copy form your description.

Okay, thank for explanation.   So if I understand right, both gcc and icc generated code is not making sense to you.  So instead, you want clang give error for this when output size greater than input size.
A question:
What about input size greater than output size?  It seems the error already emit for that case in Sema.   Should also handle the same with your case in Sema?



================
Comment at: clang/lib/Sema/SemaStmtAsm.cpp:670
+        OutputConstraintInfos[TiedTo].allowsRegister() &&
+        (OutputDomain != AD_Other || OutSize <= InSize))
       continue;
----------------
Why not emit error in here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107141/new/

https://reviews.llvm.org/D107141



More information about the cfe-commits mailing list