Skip to content

Commit 8179b9e

Browse files
committed
[flang] Disabling REAL kinds must also disable their COMPLEX
When disabling kinds of REAL in the TargetCharacteristics, one must also disable the corresponding kinds of COMPLEX. Fixes #131088.
1 parent 688d7a5 commit 8179b9e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

flang/include/flang/Tools/TargetSetup.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ namespace Fortran::tools {
4949
default:
5050
targetCharacteristics.DisableType(
5151
Fortran::common::TypeCategory::Real, /*kind=*/10);
52+
targetCharacteristics.DisableType(
53+
Fortran::common::TypeCategory::Complex, /*kind=*/10);
5254
break;
5355
}
5456

@@ -62,11 +64,16 @@ namespace Fortran::tools {
6264
constexpr bool f128Support = false;
6365
#endif
6466

65-
if constexpr (!f128Support)
67+
if constexpr (!f128Support) {
6668
targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 16);
69+
targetCharacteristics.DisableType(
70+
Fortran::common::TypeCategory::Complex, 16);
71+
}
6772

68-
for (auto realKind : targetOptions.disabledRealKinds)
73+
for (auto realKind : targetOptions.disabledRealKinds) {
6974
targetCharacteristics.DisableType(common::TypeCategory::Real, realKind);
75+
targetCharacteristics.DisableType(common::TypeCategory::Complex, realKind);
76+
}
7077

7178
for (auto intKind : targetOptions.disabledIntegerKinds)
7279
targetCharacteristics.DisableType(common::TypeCategory::Integer, intKind);

0 commit comments

Comments
 (0)