summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-07-26 10:48:20 +0000
committerMartin Storsjo <martin@martin.st>2018-07-26 10:48:20 +0000
commit9dafd6f6d93ca67f63c09aa091b28ddf88ddfc14 (patch)
treea2f14c53c1e849702c27d0b31cc051bc8662bcdd /llvm/lib/MC
parentbea258d3d7ce297807671d493619065a68366347 (diff)
downloadbcm5719-llvm-9dafd6f6d93ca67f63c09aa091b28ddf88ddfc14.tar.gz
bcm5719-llvm-9dafd6f6d93ca67f63c09aa091b28ddf88ddfc14.zip
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. llvm-svn: 338018
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAsmInfoCOFF.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp
index 8bb02c3f649..d8fb875b67c 100644
--- a/llvm/lib/MC/MCAsmInfoCOFF.cpp
+++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp
@@ -45,6 +45,11 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
// If this is a COFF target, assume that it supports associative comdats. It's
// part of the spec.
HasCOFFAssociativeComdats = true;
+
+ // We can generate constants in comdat sections that can be shared,
+ // but in order not to create null typed symbols, we actually need to
+ // make them global symbols as well.
+ HasCOFFComdatConstants = true;
}
void MCAsmInfoMicrosoft::anchor() {}
@@ -58,4 +63,7 @@ MCAsmInfoGNUCOFF::MCAsmInfoGNUCOFF() {
// comdats for jump tables, unwind information, and other data associated with
// a function.
HasCOFFAssociativeComdats = false;
+
+ // We don't create constants in comdat sections for MinGW.
+ HasCOFFComdatConstants = false;
}
OpenPOWER on IntegriCloud