LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 20216 - clang-cl error: instruction requires: 64-bit mode
Summary: clang-cl error: instruction requires: 64-bit mode
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-05 16:46 PDT by Ehsan Akhgari [:ehsan]
Modified: 2014-07-05 19:24 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ehsan Akhgari [:ehsan] 2014-07-05 16:46:06 PDT
$ cat test.c
void f() {
    char file[] = "";
    __asm lea eax, file
}

Ehsan Akhgari@WIN-LD01V6P651K /c/moz/src/obj-ff-clangcl/gfx/cairo/cairo/src
$ clang-cl -c test.c
<inline asm>(2,2) :  error: instruction requires: 64-bit mode
        lea eax, byte ptr file
        ^
1 error generated.
Comment 1 Ehsan Akhgari [:ehsan] 2014-07-05 19:24:39 PDT
The issue is that in Sema::LookupInlineAsmIdentifier, we look at the type of `file` and notice that it's an array type, so we set the size according to the size of the array (in this test case the size will be 1 which causes us to rewrite this and add a byte ptr.