Skip to content

Commit aee0963

Browse files
committed
Merge 83391 from mainline.
Fix PR5112, a miscompilation on gcc-4.0.3. llvm-svn: 83858
1 parent 43012b0 commit aee0963

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Support/Triple.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ void Triple::setOS(OSType Kind) {
326326
}
327327

328328
void Triple::setArchName(const StringRef &Str) {
329-
setTriple(Str + "-" + getVendorName() + "-" + getOSAndEnvironmentName());
329+
// Work around a miscompilation bug in gcc 4.0.3.
330+
Twine a = getVendorName() + "-" + getOSAndEnvironmentName();
331+
Twine b = Str + "-" + a;
332+
setTriple(b);
330333
}
331334

332335
void Triple::setVendorName(const StringRef &Str) {

0 commit comments

Comments
 (0)