Re: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2021-01-14 Thread Thomas Schwinge
Hi!

On 2019-09-30T00:03:00-0700, Frederik Harwath  wrote:
> The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
> internal gstdint.h. The inclusion of gstdint.h has been
> introduced by GCC trunk r265930, presumably because this introduced uses of 
> uintptr_t. Since gstdint.h is not part of GCC's
> installation, several libgomp test cases fail to compile when running the 
> tests with the installed GCC.

This got into Subversion trunk in time for GCC 10, but is also necessary
for GCC 9; I've thus just pushed to releases/gcc-9 branch "libgomp_g.h:
Include stdint.h instead of gstdint.h" in commit
8d491db06a606f45d7c46e219fc075a3fea22e32, see attached.


Grüße
 Thomas


-
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter
>From 8d491db06a606f45d7c46e219fc075a3fea22e32 Mon Sep 17 00:00:00 2001
From: Kwok Cheung Yeung 
Date: Mon, 30 Sep 2019 14:16:34 +0000
Subject: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h.

2019-09-30  Kwok Cheung Yeung  

	* libgomp_g.h: Include stdint.h instead of gstdint.h.

(cherry picked from commit d7f9ee981f32bdbc6916cb8c6b9435cfc06f88a0, r276301)
---
 libgomp/libgomp_g.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/libgomp_g.h b/libgomp/libgomp_g.h
index 32a9d8aade9..dfb55fb66dc 100644
--- a/libgomp/libgomp_g.h
+++ b/libgomp/libgomp_g.h
@@ -31,7 +31,7 @@
 
 #include 
 #include 
-#include "gstdint.h"
+#include 
 
 /* barrier.c */
 
-- 
2.17.1



Re: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2019-09-30 Thread Jakub Jelinek
On Mon, Sep 30, 2019 at 03:45:51PM +0200, Jakub Jelinek wrote:
> > Am 30.09.2019 um 09:25 schrieb Jakub Jelinek:
> > > On Mon, Sep 30, 2019 at 12:03:00AM -0700, Frederik Harwath wrote:
> > >> The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
> > >> internal gstdint.h. [...]
> > > 
> > > That looks wrong, will make libgomp less portable. [...]
> > >   Jakub
> > 
> > We have discussed this issue with Joseph Myers. Let me quote what Joseph
> > wrote:
> > 
> > "I think including  is appropriate (and, more generally,
> > removing the special configure support for GCC_HEADER_STDINT for
> > anything built only for the target - note that libgcc/gstdint.h has a
> > comment saying it's about libdecnumber portability to *hosts*, not
> > targets, without stdint.h). On any target without stdint.h, GCC should
> > be providing its own; the only targets where GCC does not yet know about
> > target stdint.h types are SymbianOS, LynxOS, QNX, TPF (see GCC bug 448),
> > and I think it's pretty unlikely libgomp would do anything useful for
> > those (and if in fact they do provide stdint.h, there wouldn't be an
> > issue anyway)."
> > 
> > Hence, I think the change will not affect portability negatively.
> 
> Ok for trunk then, I'll test removal of the gstdint.h traces from libgomp as a
> follow-up.

Here is what I'll test on top of your patch.

2019-09-30  Jakub Jelinek  

* configure.ac: Remove GCC_HEADER_STDINT(gstdint.h).
* libgomp.h: Include  instead of "gstdint.h".
* oacc-parallel.c: Don't include "libgomp_g.h".
* plugin/plugin-hsa.c: Include  instead of "gstdint.h".
* plugin/plugin-nvptx.c: Don't include "gstdint.h".
* aclocal.m4: Regenerated.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.

--- libgomp/configure.ac.jj 2019-05-30 20:40:50.661683381 +0200
+++ libgomp/configure.ac2019-09-30 15:46:29.585952622 +0200
@@ -171,8 +171,6 @@ AC_HEADER_TIME
 ACX_HEADER_STRING
 AC_CHECK_HEADERS(pthread.h unistd.h semaphore.h sys/loadavg.h sys/sysctl.h 
sys/time.h)
 
-GCC_HEADER_STDINT(gstdint.h)
-
 XPCFLAGS=""
 case "$host" in
   *-*-rtems*)
--- libgomp/libgomp.h.jj2019-09-03 09:42:48.253602133 +0200
+++ libgomp/libgomp.h   2019-09-30 15:49:46.669007187 +0200
@@ -42,7 +42,7 @@
 #endif
 
 #include "config.h"
-#include "gstdint.h"
+#include 
 #include "libgomp-plugin.h"
 #include "gomp-constants.h"
 
--- libgomp/oacc-parallel.c.jj  2019-06-19 10:04:27.782549120 +0200
+++ libgomp/oacc-parallel.c 2019-09-30 15:52:01.894986975 +0200
@@ -28,7 +28,6 @@
 
 #include "openacc.h"
 #include "libgomp.h"
-#include "libgomp_g.h"
 #include "gomp-constants.h"
 #include "oacc-int.h"
 #ifdef HAVE_INTTYPES_H
--- libgomp/plugin/plugin-hsa.c.jj  2019-09-20 12:25:53.260308442 +0200
+++ libgomp/plugin/plugin-hsa.c 2019-09-30 15:52:29.690571715 +0200
@@ -28,7 +28,7 @@
.  */
 
 #include "config.h"
-#include "gstdint.h"
+#include 
 #include 
 #include 
 #include 
--- libgomp/plugin/plugin-nvptx.c.jj2019-05-24 10:59:15.974314095 +0200
+++ libgomp/plugin/plugin-nvptx.c   2019-09-30 15:53:07.609005239 +0200
@@ -34,7 +34,6 @@
 #define _GNU_SOURCE
 #include "openacc.h"
 #include "config.h"
-#include "gstdint.h"
 #include "libgomp-plugin.h"
 #include "oacc-plugin.h"
 #include "gomp-constants.h"
--- libgomp/aclocal.m4.jj   2019-05-30 20:40:50.849680298 +0200
+++ libgomp/aclocal.m4  2019-09-30 15:54:06.136130872 +0200
@@ -1176,7 +1176,6 @@ m4_include([../config/lead-dot.m4])
 m4_include([../config/lthostflags.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/override.m4])
-m4_include([../config/stdint.m4])
 m4_include([../config/tls.m4])
 m4_include([../ltoptions.m4])
 m4_include([../ltsugar.m4])
--- libgomp/config.h.in.jj  2019-05-23 10:43:19.458316966 +0200
+++ libgomp/config.h.in 2019-09-30 15:46:56.708546877 +0200
@@ -183,21 +183,6 @@
 /* Define if all infrastructure, needed for plugins, is supported. */
 #undef PLUGIN_SUPPORT
 
-/* The size of `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
-
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
-/* The size of `void *', as computed by sizeof. */
-#undef SIZEOF_VOID_P
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
--- libgomp/configure.jj2019-09-29 13:01:28.512867791 +0200
+++ libgomp/configure   2019-09-30 15:53:31.140653688 +0200
@@ -14916,408 +14916,6 @@ fi
 done
 
 
-
-
-inttype_headers=`echo inttypes.h sys/inttypes.h  | sed -e 's/,/ /g'`
-
-acx_cv_header_stdint=stddef.h
-acx_cv_header_stdint_kind="(already complete)"
-for i in stdint.h $inttype_headers; do
-  unset ac_cv_type_uintptr_t
-  unset ac_cv_type_uintmax_t
-  unset ac_cv_type_int_least32_t
-  unset ac_cv_type_int_fast32_t
- 

Re: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2019-09-30 Thread Jakub Jelinek
On Mon, Sep 30, 2019 at 03:42:34PM +0200, Harwath, Frederik wrote:
> 
> Hi Jakub,
> 
> Am 30.09.2019 um 09:25 schrieb Jakub Jelinek:
> > On Mon, Sep 30, 2019 at 12:03:00AM -0700, Frederik Harwath wrote:
> >> The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
> >> internal gstdint.h. [...]
> > 
> > That looks wrong, will make libgomp less portable. [...]
> > Jakub
> 
> We have discussed this issue with Joseph Myers. Let me quote what Joseph
> wrote:
> 
> "I think including  is appropriate (and, more generally,
> removing the special configure support for GCC_HEADER_STDINT for
> anything built only for the target - note that libgcc/gstdint.h has a
> comment saying it's about libdecnumber portability to *hosts*, not
> targets, without stdint.h). On any target without stdint.h, GCC should
> be providing its own; the only targets where GCC does not yet know about
> target stdint.h types are SymbianOS, LynxOS, QNX, TPF (see GCC bug 448),
> and I think it's pretty unlikely libgomp would do anything useful for
> those (and if in fact they do provide stdint.h, there wouldn't be an
> issue anyway)."
> 
> Hence, I think the change will not affect portability negatively.

Ok for trunk then, I'll test removal of the gstdint.h traces from libgomp as a
follow-up.

Jakub


Re: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2019-09-30 Thread Harwath, Frederik


Hi Jakub,

Am 30.09.2019 um 09:25 schrieb Jakub Jelinek:
> On Mon, Sep 30, 2019 at 12:03:00AM -0700, Frederik Harwath wrote:
>> The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
>> internal gstdint.h. [...]
> 
> That looks wrong, will make libgomp less portable. [...]
>   Jakub

We have discussed this issue with Joseph Myers. Let me quote what Joseph
wrote:

"I think including  is appropriate (and, more generally,
removing the special configure support for GCC_HEADER_STDINT for
anything built only for the target - note that libgcc/gstdint.h has a
comment saying it's about libdecnumber portability to *hosts*, not
targets, without stdint.h). On any target without stdint.h, GCC should
be providing its own; the only targets where GCC does not yet know about
target stdint.h types are SymbianOS, LynxOS, QNX, TPF (see GCC bug 448),
and I think it's pretty unlikely libgomp would do anything useful for
those (and if in fact they do provide stdint.h, there wouldn't be an
issue anyway)."

Hence, I think the change will not affect portability negatively.

Best regards,
Frederik



Re: [PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2019-09-30 Thread Jakub Jelinek
On Mon, Sep 30, 2019 at 12:03:00AM -0700, Frederik Harwath wrote:
> Hi,
> I am a new member of Mentor's Sourcery Tools Services group and this is the 
> first patch that I am submitting here.
> I do not have write access to the svn repository yet, hence someone would 
> have to merge this patch for me if it gets accepted.
> But I intend to apply for an account soon.
> 
> The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
> internal gstdint.h. The inclusion of gstdint.h has been
> introduced by GCC trunk r265930, presumably because this introduced uses of 
> uintptr_t. Since gstdint.h is not part of GCC's
> installation, several libgomp test cases fail to compile when running the 
> tests with the installed GCC.
> 
> I have tested the patch with "make check" on x86_64 GNU/Linux.

That looks wrong, will make libgomp less portable.
If anything, it should be something like:
#ifndef GCC_GENERATED_STDINT_H
#include 
#endif
so that if gstdint.h is available and has been included by libgomp.h
already, it doesn't try to include it.

Jakub


[PATCH] libgomp_g.h: Include stdint.h instead of gstdint.h

2019-09-30 Thread Frederik Harwath
Hi,
I am a new member of Mentor's Sourcery Tools Services group and this is the 
first patch that I am submitting here.
I do not have write access to the svn repository yet, hence someone would have 
to merge this patch for me if it gets accepted.
But I intend to apply for an account soon.

The patch changes libgomp/libgomp_g.h to include stdint.h instead of the 
internal gstdint.h. The inclusion of gstdint.h has been
introduced by GCC trunk r265930, presumably because this introduced uses of 
uintptr_t. Since gstdint.h is not part of GCC's
installation, several libgomp test cases fail to compile when running the tests 
with the installed GCC.

I have tested the patch with "make check" on x86_64 GNU/Linux.

Best regards,
Frederik

libgomp/ChangeLog:

2019-09-25  Kwok Cheung Yeung  

 * libgomp_g.h: Include stdint.h instead of gstdint.h.

diff --git a/libgomp/libgomp_g.h b/libgomp/libgomp_g.h
index 32a9d8a..dfb55fb 100644
--- a/libgomp/libgomp_g.h
+++ b/libgomp/libgomp_g.h
@@ -31,7 +31,7 @@
 
 #include 
 #include 
-#include "gstdint.h"
+#include 
 
 /* barrier.c */