Recent snapshots of gcc 5 can not be built any more for the i686-w64-mingw32 target: make[4]: Entering directory '/home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/i686-w64-mingw32/libgomp' /bin/sh ./libtool --tag=CC --mode=compile /home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/./gcc/xgcc -B/home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/./gcc/ -L/usr/i686-w64-mingw32/lib -L/usr/mingw/lib -isystem /usr/i686-w64-mingw32/include -isystem /usr/mingw/include -B/usr/i686-w64-mingw32/bin/ -B/usr/i686-w64-mingw32/lib/ -isystem /usr/i686-w64-mingw32/include -isystem /usr/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I../../../libgomp -I../../../libgomp/config/mingw32 -I../../../libgomp/config/posix -I../../../libgomp -I../../../libgomp/../include -Wall -Werror -Wc,-pthread -g -O2 -MT target.lo -MD -MP -MF .deps/target.Tpo -c -o target.lo ../../../libgomp/target.c libtool: compile: /home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/./gcc/xgcc -B/home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/./gcc/ -L/usr/i686-w64-mingw32/lib -L/usr/mingw/lib -isystem /usr/i686-w64-mingw32/include -isystem /usr/mingw/include -B/usr/i686-w64-mingw32/bin/ -B/usr/i686-w64-mingw32/lib/ -isystem /usr/i686-w64-mingw32/include -isystem /usr/i686-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I../../../libgomp -I../../../libgomp/config/mingw32 -I../../../libgomp/config/posix -I../../../libgomp -I../../../libgomp/../include -Wall -pthread -Werror -g -O2 -MT target.lo -MD -MP -MF .deps/target.Tpo -c ../../../libgomp/target.c -DDLL_EXPORT -DPIC -o .libs/target.o ../../../libgomp/target.c: In function 'gomp_map_vars': ../../../libgomp/target.c:440:21: error: unknown conversion type character 'z' in format [-Werror=format=] gomp_fatal ("present clause: !acc_is_present (%p, " ^ ../../../libgomp/target.c:440:21: error: unknown conversion type character 'z' in format [-Werror=format=] ../../../libgomp/target.c:440:21: error: too many arguments for format [-Werror=format-extra-args] cc1: all warnings being treated as errors Makefile:613: recipe for target 'target.lo' failed make[4]: *** [target.lo] Error 1 make[4]: Leaving directory '/home/erik/fedora/mingw-gcc/gcc-5-20150125/build_win32/i686-w64-mingw32/libgomp' The offending line contains this piece of code: gomp_fatal ("present clause: !acc_is_present (%p, " "%zd (0x%zx))", (void *) k->host_start, size, size); This piece of code was introduced in r219682 which was applied on January 15 2015. This issue was also discussed at the mingw-w64 mailing list @ http://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/54CD7703.8080206@users.sourceforge.net/ and also contains some possible solutions
Confirmed. '%z' isn't valid for msvcrt as width-specifier. Shouldn't we use here instead inttypes.h header and PRIxPTR?
Issue exists for target x86_64-w64-mingw32 too. By the way, this is a regression. At the moment gcc doesn't build for the *-w64-mingw32 targets.
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.
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.
(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?
(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.
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", ^ 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: too many arguments for format [-Werror=format-extra-args] 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__); \ ^ cc1.exe: all warnings being treated as errors Issue at these two locations: lines 102,103: gomp_debug (0, "%s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n", __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); lines 181,182: gomp_debug (0, "%s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n", __FUNCTION__, mapnum, hostaddrs, sizes, kinds);
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:
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.
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'.
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.
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.
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" (0x"PRIx64"))", + (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:
(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" (0x"PRIx64"))", > + (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.
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" (0x"PRIx64"))", + (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:
(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.
Author: ktietz Date: Wed Mar 25 15:05:02 2015 New Revision: 221665 URL: https://gcc.gnu.org/viewcvs?rev=221665&root=gcc&view=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
Fixed on trunk.