[llvm-bugs] [Bug 42201] New: clang accept wrong code after with -Ox

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 8 22:27:31 PDT 2019


            Bug ID: 42201
           Summary: clang accept wrong code after with -Ox
           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 main(void) {
 int value;
 __asm__("test" : "=l" (value));

clang rejects the code:
source>:3:10: error: unknown use of instruction mnemonic without a size suffix

 __asm__("test" : "=l" (value));


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



1 error generated.

Compiler returned: 1

However, it accepts the code, with the following parameters:
clang++ -O3 | clang++ -O2 | clang++ -O1

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/df88be6d/attachment.html>

More information about the llvm-bugs mailing list