This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][4/4] Always 64bit-HWI cleanups
- From: Richard Biener <rguenther at suse dot de>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 May 2014 12:35:24 +0200 (CEST)
- Subject: Re: [PATCH][4/4] Always 64bit-HWI cleanups
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnykNVd1UD+fkTfTsSb3AKWFFc4QFRz7iQgUobu6g4m3AmQ at mail dot gmail dot com> <f2d94717-1333-4dd0-acb7-3106c5f22f35 at email dot android dot com>
On Tue, 27 May 2014, Richard Biener wrote:
> On May 27, 2014 3:58:06 AM CEST, David Edelsohn <dje.gcc@gmail.com> wrote:
> >This patch (further) broke bootstrap on AIX. AIX defaults to 32 bit,
> >although it supports 64 bit HWI.
> >
> >/nasfarm/edelsohn/src/src/gcc/bitmap.c: In function 'int
> >print_statistics(bitmap_descriptor_d**, output_info*)':
> >/nasfarm/edelsohn/src/src/gcc/bitmap.c:2168:24: error: expected ')'
> >before 'PRId64'
> >/nasfarm/edelsohn/src/src/gcc/bitmap.c: In function 'void
> >dump_bitmap_statistics()':
> >/nasfarm/edelsohn/src/src/gcc/bitmap.c:2202:15: error: expected ')'
> >before 'PRId64'
> >
> >/nasfarm/edelsohn/src/src/gcc/bt-load.c: In function 'void
> >migrate_btr_defs(reg_class, int)':
> >/nasfarm/edelsohn/src/src/gcc/bt-load.c:1414:34: error: expected ')'
> >before 'PRId64'
> >
> >/nasfarm/edelsohn/src/src/gcc/cfg.c: In function 'void
> >dump_edge_info(FILE*, edge, int, int)':
> >/nasfarm/edelsohn/src/src/gcc/cfg.c:489:25: error: expected ')' before
> >'PRId64'
> >/nasfarm/edelsohn/src/src/gcc/cfg.c: In function 'void
> >dump_bb_info(FILE*, basic_block, int, int, bool, bool)':
> >/nasfarm/edelsohn/src/src/gcc/cfg.c:737:33: error: expected ')' before
> >'PRId64'
>
> This means aix has inttypes.h but not the standard mandated PRI?64 macros. Does it have stdint.h and therein int64_t?
>
> A possibility is to define the GCC fallbacks when the defines are not defined as opposed to only when inttypes.h is not available.
>
> Can you investigate some more the situation on aix?
Proposed patch below.
Richard.
Index: gcc/hwint.h
===================================================================
--- gcc/hwint.h (revision 210932)
+++ gcc/hwint.h (working copy)
@@ -135,21 +135,30 @@ typedef HOST_WIDE_INT __gcc_host_wide_in
#define HOST_WIDE_INT_PRINT_HEX "%#" HOST_WIDE_INT_PRINT "x"
#define HOST_WIDE_INT_PRINT_HEX_PURE "%" HOST_WIDE_INT_PRINT "x"
-/* Provide C99 <inttypes.h> style format definitions for 64bits. */
-#ifndef HAVE_INTTYPES_H
-#undef PRId64
+/* Provide C99 <inttypes.h> style format definitions for 64bits. As
+ 64bit types are only conditionally supported also provide fallback
+ definitions for the 64bit variants even if inttypes.h is available. */
+#ifndef PRId64
#define PRId64 HOST_WIDE_INT_PRINT "d"
-#undef PRIi64
+#endif
+#ifndef PRIi64
#define PRIi64 HOST_WIDE_INT_PRINT "i"
-#undef PRIo64
+#endif
+#ifndef PRIo64
#define PRIo64 HOST_WIDE_INT_PRINT "o"
-#undef PRIu64
+#endif
+#ifndef PRIu64
#define PRIu64 HOST_WIDE_INT_PRINT "u"
-#undef PRIx64
+#endif
+#ifndef PRIx64
#define PRIx64 HOST_WIDE_INT_PRINT "x"
-#undef PRIX64
+#endif
+#ifndef PRIX64
#define PRIX64 HOST_WIDE_INT_PRINT "X"
#endif
+#ifndef HAVE_INTTYPES_H
+/* 32bit variants go here once we start using them. */
+#endif
/* Define HOST_WIDEST_FAST_INT to the widest integer type supported
efficiently in hardware. (That is, the widest integer type that fits