]> granicus.if.org Git - llvm/commit
Revert "[COFF] Use comdat shared constants for MinGW as well"
authorMartin Storsjo <martin@martin.st>
Thu, 26 Jul 2018 10:48:20 +0000 (10:48 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 26 Jul 2018 10:48:20 +0000 (10:48 +0000)
commit078cc9c528cea6b1a0544cda99e53afdf25ea248
tree170d92f0f94a7a4c7d7d54d7e0f313a259a388ec
parenta0882e9c6c7bb534f852c4c77ee92737e88a4101
Revert "[COFF] Use comdat shared constants for MinGW as well"

This reverts commit r337951.

While that kind of shared constant generally works fine in a MinGW
setting, it broke some cases of inline assembly that worked before:

$ cat const-asm.c
int MULH(int a, int b) {
    int rt, dummy;
    __asm__ (
        "imull %3"
        :"=d"(rt), "=a"(dummy)
        :"a"(a), "rm"(b)
    );
    return rt;
}
int func(int a) {
    return MULH(a, 1);
}
$ clang -target x86_64-win32-gnu -c const-asm.c -O2
const-asm.c:4:9: error: invalid variant '00000001'
        "imull %3"
        ^
<inline asm>:1:15: note: instantiated into assembly here
        imull __real@00000001(%rip)
                     ^

A similar error is produced for i686 as well. The same test with a
target of x86_64-win32-msvc or i686-win32-msvc works fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338018 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCAsmInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/MC/MCAsmInfoCOFF.cpp
test/CodeGen/AArch64/win_cst_pool.ll
test/CodeGen/X86/win_cst_pool.ll