[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Keywords||build Priority|P3 |P1
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #17 from Kai Tietz ktietz at gcc dot gnu.org --- Author: ktietz Date: Wed Mar 25 15:05:02 2015 New Revision: 221665 URL: https://gcc.gnu.org/viewcvs?rev=221665root=gccview=rev Log: PR libgomp/64972 * oacc-parallel.c (GOACC_parallel): Use PRIu64 if available. (GOACC_data_start): Likewise. * target.c (gomp_map_vars): Likewise. Modified: trunk/libgomp/ChangeLog trunk/libgomp/oacc-parallel.c trunk/libgomp/target.c
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 Kai Tietz ktietz at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #18 from Kai Tietz ktietz at gcc dot gnu.org --- Fixed on trunk.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org --- (In reply to Rainer Emrich from comment #5) (In reply to Jakub Jelinek from comment #4) And the suggested fix is just to cast to unsigned long and use %ld or %lx instead of %zd and %zx. I can't test it on these targets, so it is better if somebody with M$ access writes and tests the patch. Index: target.c === --- target.c(Revision 221607) +++ target.c(Arbeitskopie) @@ -439,8 +439,8 @@ gomp_map_vars (struct gomp_device_descr was missing. */ size_t size = k-host_end - k-host_start; gomp_fatal (present clause: !acc_is_present (%p, - %zd (0x%zx)), (void *) k-host_start, - size, size); + %ld (0x%lx)), (void *) k-host_start, + (unsigned long) size, (unsigned long) size); } break; case GOMP_MAP_FORCE_DEVICEPTR: Something like this? At least that builds on x86_64-w64-mingw32. Yeah. But there is another issue with formatters in oacc-parallel.c. Shall I append to this bug or open a new one? Please don't create a new bug, it is the same thing.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #5 from Rainer Emrich rai...@emrich-ebersheim.de --- (In reply to Jakub Jelinek from comment #4) And the suggested fix is just to cast to unsigned long and use %ld or %lx instead of %zd and %zx. I can't test it on these targets, so it is better if somebody with M$ access writes and tests the patch. Index: target.c === --- target.c(Revision 221607) +++ target.c(Arbeitskopie) @@ -439,8 +439,8 @@ gomp_map_vars (struct gomp_device_descr was missing. */ size_t size = k-host_end - k-host_start; gomp_fatal (present clause: !acc_is_present (%p, - %zd (0x%zx)), (void *) k-host_start, - size, size); + %ld (0x%lx)), (void *) k-host_start, + (unsigned long) size, (unsigned long) size); } break; case GOMP_MAP_FORCE_DEVICEPTR: Something like this? At least that builds on x86_64-w64-mingw32. But there is another issue with formatters in oacc-parallel.c. Shall I append to this bug or open a new one?
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #8 from Rainer Emrich rai...@emrich-ebersheim.de --- I'm testing the following on x86_64-w64-mingw32 at the moment. Index: oacc-parallel.c === --- oacc-parallel.c (Revision 221607) +++ oacc-parallel.c (Arbeitskopie) @@ -99,8 +99,9 @@ GOACC_parallel (int device, void (*fn) ( gomp_fatal (num_workers (%d) different from one is not yet supported, num_workers); - gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, - __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); + gomp_debug (0, %s: mapnum=%ld, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, + __FUNCTION__, (unsigned long) mapnum, (void *) hostaddrs, + sizes, kinds, (int) async); select_acc_device (device); @@ -178,8 +179,9 @@ GOACC_data_start (int device, size_t map bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK; struct target_mem_desc *tgt; - gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, - __FUNCTION__, mapnum, hostaddrs, sizes, kinds); + gomp_debug (0, %s: mapnum=%ld, hostaddrs=%p, sizes=%p, kinds=%p\n, + __FUNCTION__, (unsigned long) mapnum, (void *) hostaddrs, + sizes, kinds); select_acc_device (device); Index: target.c === --- target.c(Revision 221607) +++ target.c(Arbeitskopie) @@ -439,8 +439,8 @@ gomp_map_vars (struct gomp_device_descr was missing. */ size_t size = k-host_end - k-host_start; gomp_fatal (present clause: !acc_is_present (%p, - %zd (0x%zx)), (void *) k-host_start, - size, size); + %ld (0x%lx)), (void *) k-host_start, + (unsigned long) size, (unsigned long) size); } break; case GOMP_MAP_FORCE_DEVICEPTR:
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #7 from Rainer Emrich rai...@emrich-ebersheim.de --- Ok, here's the additional issue in oacc-parallel.c. libtool: compile: /opt/devel/SCRATCH/tmp.UotBZukqBt/gcc-5.0.0/gcc-5.0.0/./gcc/xgcc -B/opt/devel/SCRATCH/tmp.UotBZukqBt/gcc-5.0.0/gcc-5.0.0/./gcc/ -L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/lib -L/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/mingw/lib -isystem /opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/include -isystem /opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/mingw/include -B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/bin/ -B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/lib/ -isystem /opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/include -isystem /opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-5.0.0/x86_64-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp -I../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/config/mingw32 -I../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/config/posix -I../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp -I../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/../include -Wall -pthread -Werror -g -O2 -MT oacc-parallel.lo -MD -MP -MF .deps/oacc-parallel.Tpo -c ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c -DDLL_EXPORT -DPIC -o .libs/oacc-parallel.o In file included from ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:30:0: ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c: In function 'GOACC_parallel': ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:102:18: error: unknown conversion type character 'z' in format [-Werror=format=] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, ^ d:\opt\devel\gnu\src\gcc-mingw-w64\gcc-5.0.0\libgomp\libgomp.h:554:29: note: in definition of macro 'gomp_debug' (gomp_debug) ((KIND), __VA_ARGS__); \ ^ ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:102:18: error: format '%p' expects argument of type 'void *', but argument 4 has type 'size_t {aka long long unsigned int}' [-Werror=format=] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, ^ d:\opt\devel\gnu\src\gcc-mingw-w64\gcc-5.0.0\libgomp\libgomp.h:554:29: note: in definition of macro 'gomp_debug' (gomp_debug) ((KIND), __VA_ARGS__); \ ^ ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:102:18: error: format '%d' expects argument of type 'int', but argument 7 has type 'short unsigned int *' [-Werror=format=] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, ^ d:\opt\devel\gnu\src\gcc-mingw-w64\gcc-5.0.0\libgomp\libgomp.h:554:29: note: in definition of macro 'gomp_debug' (gomp_debug) ((KIND), __VA_ARGS__); \ ^ ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:102:18: error: too many arguments for format [-Werror=format-extra-args] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, ^ d:\opt\devel\gnu\src\gcc-mingw-w64\gcc-5.0.0\libgomp\libgomp.h:554:29: note: in definition of macro 'gomp_debug' (gomp_debug) ((KIND), __VA_ARGS__); \ ^ ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c: In function 'GOACC_data_start': ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:181:18: error: unknown conversion type character 'z' in format [-Werror=format=] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, ^ d:\opt\devel\gnu\src\gcc-mingw-w64\gcc-5.0.0\libgomp\libgomp.h:554:29: note: in definition of macro 'gomp_debug' (gomp_debug) ((KIND), __VA_ARGS__); \ ^ ../../../../../../../../opt/devel/gnu/src/gcc-mingw-w64/gcc-5.0.0/libgomp/oacc-parallel.c:181:18: error: format '%p' expects argument of type 'void *', but argument 4 has type 'size_t {aka long long unsigned int}' [-Werror=format=] gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, ^
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #11 from Jakub Jelinek jakub at gcc dot gnu.org --- I wouldn't call %zd gnu-style, as it is POSIX. Anyway, libgomp already uses inttypes.h, but only conditionally: #ifdef HAVE_INTTYPES_H fprintf (stderr, GOMP_SPINCOUNT = '%PRIu64'\n, (uint64_t) gomp_spin_count_var); #else fprintf (stderr, GOMP_SPINCOUNT = '%lu'\n, (unsigned long) gomp_spin_count_var); #endif So, if you'd like to do the same (but then cast to uint64_t and use PRIu64, dunno how portable is PRIuPTR compared to PRIu64), that is also an option, but IMNSHO not worth the trouble. All these messages are unimportant OpenACC debugging messages or a fancy abort that will very likely not have sizes of anything 2GB - trying to offload 2GB+ of data to offloading device in one chunk is hardly a case to worry about.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #9 from Mikael Pettersson mikpelinux at gmail dot com --- Please note that sizeof(long) == 4 while sizeof(size_t) == sizeof(void*) == 8 on x86_64-w64-mingw32, so your patch changes the behaviour of the code. Perhaps the change is benign, but I'd use uintptr_t and PRIxPTR.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #10 from Kai Tietz ktietz at gcc dot gnu.org --- I agree that suggested patch changes here behavior on non LP64 targets. Nevertheless it would be something to live by until we reach stage 1 to address this more accurate. To us uintptr_t is by idea ok, just have the weakness that size_t not necessarily has same precision as uintptr_t. If gomp maintainer will say that inttypes.h header use and casting to uintptr_t would be ok for them, I agree. A real solution would be to add in configure a test for used size_t printf-formatter sign, and then use it in source. For gnu-style width-specifier is 'z', for ms-style it is 'I'.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 Thomas Schwinge tschwinge at gcc dot gnu.org changed: What|Removed |Added Keywords||openacc CC||tschwinge at gcc dot gnu.org --- Comment #12 from Thomas Schwinge tschwinge at gcc dot gnu.org --- Sorry for introducing this breakage; and thanks for working on fixing it. (In reply to Jakub Jelinek from comment #11) I wouldn't call %zd gnu-style, as it is POSIX. Anyway, libgomp already uses inttypes.h, but only conditionally: #ifdef HAVE_INTTYPES_H fprintf (stderr, GOMP_SPINCOUNT = '%PRIu64'\n, (uint64_t) gomp_spin_count_var); #else fprintf (stderr, GOMP_SPINCOUNT = '%lu'\n, (unsigned long) gomp_spin_count_var); #endif So, if you'd like to do the same (but then cast to uint64_t and use PRIu64, dunno how portable is PRIuPTR compared to PRIu64), that is also an option, but IMNSHO not worth the trouble. All these messages are unimportant OpenACC debugging messages or a fancy abort that will very likely not have sizes of anything 2GB - trying to offload 2GB+ of data to offloading device in one chunk is hardly a case to worry about. ..., and »640 K ought to be enough for anybody«? ;-) Please do not change the code -- even if only unimportant debugging messages -- so that it might print incorrect data.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #14 from Jakub Jelinek jakub at gcc dot gnu.org --- (In reply to Kai Tietz from comment #13) Rainer: does following patch works for you? Index: oacc-parallel.c === --- oacc-parallel.c (Revision 221640) +++ oacc-parallel.c (Arbeitskopie) @@ -31,6 +31,9 @@ #include libgomp_g.h #include gomp-constants.h #include oacc-int.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include stdarg.h #include assert.h @@ -99,9 +102,14 @@ GOACC_parallel (int device, void (*fn) (void *), gomp_fatal (num_workers (%d) different from one is not yet supported, num_workers); +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p, + async = %d\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds, async); +#else gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); - +#endif select_acc_device (device); thr = goacc_thread (); @@ -178,8 +186,13 @@ GOACC_data_start (int device, size_t mapnum, bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK; struct target_mem_desc *tgt; +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds); +#else gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, __FUNCTION__, mapnum, hostaddrs, sizes, kinds); +#endif select_acc_device (device); Index: target.c === --- target.c (Revision 221640) +++ target.c (Arbeitskopie) @@ -33,6 +33,9 @@ #include limits.h #include stdbool.h #include stdlib.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include assert.h @@ -438,9 +441,16 @@ gomp_map_vars (struct gomp_device_descr *devicep, /* We already looked up the memory region above and it was missing. */ size_t size = k-host_end - k-host_start; +#ifdef HAVE_INTTYPES_H gomp_fatal (present clause: !acc_is_present (%p, + PRIu64 (0xPRIx64)), + (void *) k-host_start, + (uint64_t) size, (uint64_t) size); +#else + gomp_fatal (present clause: !acc_is_present (%p, %zd (0x%zx)), (void *) k-host_start, size, size); +#endif } break; case GOMP_MAP_FORCE_DEVICEPTR: The fallback case really should use %ld or %lx and casts to (unsigned long). Targets that have inttypes.h will (with the exception of M$ targets) likely also support %zd / %zx.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #13 from Kai Tietz ktietz at gcc dot gnu.org --- Rainer: does following patch works for you? Index: oacc-parallel.c === --- oacc-parallel.c(Revision 221640) +++ oacc-parallel.c(Arbeitskopie) @@ -31,6 +31,9 @@ #include libgomp_g.h #include gomp-constants.h #include oacc-int.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include stdarg.h #include assert.h @@ -99,9 +102,14 @@ GOACC_parallel (int device, void (*fn) (void *), gomp_fatal (num_workers (%d) different from one is not yet supported, num_workers); +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p, + async = %d\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds, async); +#else gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); - +#endif select_acc_device (device); thr = goacc_thread (); @@ -178,8 +186,13 @@ GOACC_data_start (int device, size_t mapnum, bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK; struct target_mem_desc *tgt; +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds); +#else gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, __FUNCTION__, mapnum, hostaddrs, sizes, kinds); +#endif select_acc_device (device); Index: target.c === --- target.c(Revision 221640) +++ target.c(Arbeitskopie) @@ -33,6 +33,9 @@ #include limits.h #include stdbool.h #include stdlib.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include assert.h @@ -438,9 +441,16 @@ gomp_map_vars (struct gomp_device_descr *devicep, /* We already looked up the memory region above and it was missing. */ size_t size = k-host_end - k-host_start; +#ifdef HAVE_INTTYPES_H gomp_fatal (present clause: !acc_is_present (%p, + PRIu64 (0xPRIx64)), + (void *) k-host_start, + (uint64_t) size, (uint64_t) size); +#else + gomp_fatal (present clause: !acc_is_present (%p, %zd (0x%zx)), (void *) k-host_start, size, size); +#endif } break; case GOMP_MAP_FORCE_DEVICEPTR:
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #16 from Jakub Jelinek jakub at gcc dot gnu.org --- (In reply to Kai Tietz from comment #15) Ok, I am fine. So patch should be something like: Patch preapproved for trunk with proper ChangeLog if it works on i686-w64-mingw32, please post it to gcc-patches anyway.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #15 from Kai Tietz ktietz at gcc dot gnu.org --- Ok, I am fine. So patch should be something like: Index: oacc-parallel.c === --- oacc-parallel.c(Revision 221640) +++ oacc-parallel.c(Arbeitskopie) @@ -31,6 +31,9 @@ #include libgomp_g.h #include gomp-constants.h #include oacc-int.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include stdarg.h #include assert.h @@ -99,9 +102,15 @@ GOACC_parallel (int device, void (*fn) (void *), gomp_fatal (num_workers (%d) different from one is not yet supported, num_workers); - gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, - __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); - +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p, + async = %d\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds, async); +#else + gomp_debug (0, %s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n, + __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds, + async); +#endif select_acc_device (device); thr = goacc_thread (); @@ -178,8 +187,13 @@ GOACC_data_start (int device, size_t mapnum, bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK; struct target_mem_desc *tgt; - gomp_debug (0, %s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n, - __FUNCTION__, mapnum, hostaddrs, sizes, kinds); +#ifdef HAVE_INTTYPES_H + gomp_debug (0, %s: mapnum=%PRIu64, hostaddrs=%p, size=%p, kinds=%p\n, + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds); +#else + gomp_debug (0, %s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p\n, + __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds); +#endif select_acc_device (device); Index: target.c === --- target.c(Revision 221640) +++ target.c(Arbeitskopie) @@ -33,6 +33,9 @@ #include limits.h #include stdbool.h #include stdlib.h +#ifdef HAVE_INTTYPES_H +# include inttypes.h /* For PRIu64. */ +#endif #include string.h #include assert.h @@ -438,9 +441,16 @@ gomp_map_vars (struct gomp_device_descr *devicep, /* We already looked up the memory region above and it was missing. */ size_t size = k-host_end - k-host_start; +#ifdef HAVE_INTTYPES_H gomp_fatal (present clause: !acc_is_present (%p, - %zd (0x%zx)), (void *) k-host_start, - size, size); + PRIu64 (0xPRIx64)), + (void *) k-host_start, + (uint64_t) size, (uint64_t) size); +#else + gomp_fatal (present clause: !acc_is_present (%p, + %lu (0x%lx)), (void *) k-host_start, + (unsigned long) size, (unsigned long) size); +#endif } break; case GOMP_MAP_FORCE_DEVICEPTR:
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 Kai Tietz ktietz at gcc dot gnu.org changed: What|Removed |Added Known to work||4.9.3 Known to fail||5.0 --- Comment #3 from Kai Tietz ktietz at gcc dot gnu.org --- Issue is that libgomp uses gnu-style printf formatters without checking, if formatter is available on that platform. Due it operates on size_t, the defines provided by inttypes.h are of not much help.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 --- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org --- And the suggested fix is just to cast to unsigned long and use %ld or %lx instead of %zd and %zx. I can't test it on these targets, so it is better if somebody with M$ access writes and tests the patch.
[Bug libgomp/64972] [5 Regression] Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64972 Kai Tietz ktietz at gcc dot gnu.org changed: What|Removed |Added Target Milestone|--- |5.0