|
|
77a21d |
From 0ff89f236b9cc11662cf4f288cfd3254410d8243 Mon Sep 17 00:00:00 2001
|
|
|
5034ee |
From: Nikita Popov <npopov@redhat.com>
|
|
|
5034ee |
Date: Thu, 3 Feb 2022 10:34:44 +0100
|
|
|
77a21d |
Subject: Work around gcc miscompile
|
|
|
5034ee |
|
|
|
5034ee |
This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104334,
|
|
|
5034ee |
which miscompiles clang on s390x and ppc64le. The issue is already
|
|
|
5034ee |
fixed on the gcc side, but including this as a temporary workaround
|
|
|
5034ee |
to get a working build.
|
|
|
5034ee |
---
|
|
|
5034ee |
clang/lib/Sema/DeclSpec.cpp | 5 +++--
|
|
|
5034ee |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
5034ee |
|
|
|
5034ee |
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
|
|
|
5034ee |
index d4dc790c008a..77a1e6c32c6f 100644
|
|
|
5034ee |
--- a/clang/lib/Sema/DeclSpec.cpp
|
|
|
5034ee |
+++ b/clang/lib/Sema/DeclSpec.cpp
|
|
|
5034ee |
@@ -1203,8 +1203,9 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
|
|
|
5034ee |
} else if (TypeSpecType == TST_double) {
|
|
|
5034ee |
// vector long double and vector long long double are never allowed.
|
|
|
5034ee |
// vector double is OK for Power7 and later, and ZVector.
|
|
|
5034ee |
- if (getTypeSpecWidth() == TypeSpecifierWidth::Long ||
|
|
|
5034ee |
- getTypeSpecWidth() == TypeSpecifierWidth::LongLong)
|
|
|
5034ee |
+ TypeSpecifierWidth TypeSpecWidth = getTypeSpecWidth();
|
|
|
5034ee |
+ if (TypeSpecWidth == TypeSpecifierWidth::Long ||
|
|
|
5034ee |
+ TypeSpecWidth == TypeSpecifierWidth::LongLong)
|
|
|
5034ee |
S.Diag(TSWRange.getBegin(),
|
|
|
5034ee |
diag::err_invalid_vector_long_double_decl_spec);
|
|
|
5034ee |
else if (!S.Context.getTargetInfo().hasFeature("vsx") &&
|
|
|
77a21d |
--
|
|
|
77a21d |
2.37.1
|
|
|
5034ee |
|