* [Patch] libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661]
@ 2021-09-28 13:00 Tobias Burnus
2021-09-28 13:03 ` Jakub Jelinek
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Burnus @ 2021-09-28 13:00 UTC (permalink / raw)
To: Jakub Jelinek, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 870 bytes --]
Found this one lurking around in one of my trees.
It does not solve the actual issue of John that hppa64-hp-hpux11.11 does
not have an __int128 alias integer(kind=16) type. The latter is required for
OpenMP's omp_depend_kind as per implementation choice is has to be large
enough to store two pointers (2*sizeof(void*)).
However, when thinking about the check again: It does not make sense to
break the build if only C/C++ is enabled and Fortran disabled.
While that probably has no real-world impact, I still think it makes
sense to fix it.
OK for mainline and GCC 11?
Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Attachment #2: libgomp-no-fortran.diff --]
[-- Type: text/x-patch, Size: 2726 bytes --]
libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661]
The depend type is a struct with two pointer members for C/C++ - but for
Fortran OpenMP requires an integer type with kind = omp_depend_kind. Thus,
libgomp's configure checks that an integer type/kind with size 2*sizeof(void*)
is available. However, this integer type/kind is not needed when building without
Fortran support. Thus, only check this when Fortran is enabled.
libgomp/
PR libgomp/96661
* configure.ac: Only check for int-type = 2*size_t support when
building with Fortran support.
* configure: Regenerate.
diff --git a/libgomp/configure b/libgomp/configure
index 6161da579c0..4bc9b381c5c 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -17007,13 +17007,15 @@ fi
if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
OMP_NEST_LOCK_25_KIND=8
fi
-if test $OMP_DEPEND_KIND -eq 16; then
- if test $OMP_INT128_SIZE -ne 16; then
- as_fn_error $? "unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind" "$LINENO" 5
- fi
-else
- if test $OMP_DEPEND_KIND -ne 8; then
- as_fn_error $? "unsupported system, cannot find Fortran integer kind for omp_depend_kind" "$LINENO" 5
+if test "$ac_cv_fc_compiler_gnu" = yes; then
+ if test $OMP_DEPEND_KIND -eq 16; then
+ if test $OMP_INT128_SIZE -ne 16; then
+ as_fn_error $? "unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind" "$LINENO" 5
+ fi
+ else
+ if test $OMP_DEPEND_KIND -ne 8; then
+ as_fn_error $? "unsupported system, cannot find Fortran integer kind for omp_depend_kind" "$LINENO" 5
+ fi
fi
fi
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index 7df80a32765..bfb613b91f0 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -438,13 +438,15 @@ fi
if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
OMP_NEST_LOCK_25_KIND=8
fi
-if test $OMP_DEPEND_KIND -eq 16; then
- if test $OMP_INT128_SIZE -ne 16; then
- AC_MSG_ERROR([unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind])
- fi
-else
- if test $OMP_DEPEND_KIND -ne 8; then
- AC_MSG_ERROR([unsupported system, cannot find Fortran integer kind for omp_depend_kind])
+if test "$ac_cv_fc_compiler_gnu" = yes; then
+ if test $OMP_DEPEND_KIND -eq 16; then
+ if test $OMP_INT128_SIZE -ne 16; then
+ AC_MSG_ERROR([unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind])
+ fi
+ else
+ if test $OMP_DEPEND_KIND -ne 8; then
+ AC_MSG_ERROR([unsupported system, cannot find Fortran integer kind for omp_depend_kind])
+ fi
fi
fi
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch] libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661]
2021-09-28 13:00 [Patch] libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] Tobias Burnus
@ 2021-09-28 13:03 ` Jakub Jelinek
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2021-09-28 13:03 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gcc-patches
On Tue, Sep 28, 2021 at 03:00:56PM +0200, Tobias Burnus wrote:
> The depend type is a struct with two pointer members for C/C++ - but for
> Fortran OpenMP requires an integer type with kind = omp_depend_kind. Thus,
> libgomp's configure checks that an integer type/kind with size 2*sizeof(void*)
> is available. However, this integer type/kind is not needed when building without
> Fortran support. Thus, only check this when Fortran is enabled.
>
> libgomp/
> PR libgomp/96661
> * configure.ac: Only check for int-type = 2*size_t support when
> building with Fortran support.
> * configure: Regenerate.
Ok, thanks.
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-28 13:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 13:00 [Patch] libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] Tobias Burnus
2021-09-28 13:03 ` Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).