[llvm-bugs] [Bug 42200] New: -emit-llvm accepts wrong code

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 8 19:20:01 PDT 2019


            Bug ID: 42200
           Summary: -emit-llvm accepts wrong code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

My clang is 9.0.0, and my code is:

int pixels;
void test() {
 asm volatile("%0 %1" : "+r" (pixels) : : "%eax");

With other parameters, clang rejects the code:

source>:3:15: error: unexpected token at start of statement

 asm volatile("%0 %1" : "+r" (pixels) : : "%eax");


<inline asm>:1:2: note: instantiated into assembly here

        %ecx %ecx


1 error generated.

Compiler returned: 1

However, with -emit-llvm, it accepts the code. It seems to be incorrect?

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190609/34341a1a/attachment.html>

More information about the llvm-bugs mailing list