From 57b87322ab4fd0033902938dbe00fd93e153cf78 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Fri, 30 Aug 2019 08:58:46 +0000 Subject: [CodeGen]: fix error message for "=r" asm constraint Summary: Nico Weber reported that the following code: char buf[9]; asm("" : "=r" (buf)); yields the "impossible constraint in asm: can't store struct into a register" error message, although |buf| is not a struct (see http://crbug.com/999160). Make the error message more generic and add a test for it. Also make sure other tests in x86_64-PR42672.c check for the full error message. Reviewers: eli.friedman, thakis Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66948 llvm-svn: 370444 --- clang/lib/CodeGen/CGStmt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 90974345bc3..707db04a892 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -2326,7 +2326,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { const Expr *OutExpr = S.getOutputExpr(i); CGM.Error( OutExpr->getExprLoc(), - "impossible constraint in asm: can't store struct into a register"); + "impossible constraint in asm: can't store value into a register"); return; } Dest = MakeAddrLValue(A, Ty); -- cgit v1.2.3