This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][4/4] Always 64bit-HWI cleanups

On Tue, 27 May 2014, Richard Biener wrote:

> On May 27, 2014 3:58:06 AM CEST, David Edelsohn <> 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.


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
-/* Provide C99 <inttypes.h> style format definitions for 64bits.  */
-#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
+#ifndef PRIi64
 #define PRIi64 HOST_WIDE_INT_PRINT "i"
-#undef PRIo64
+#ifndef PRIo64
 #define PRIo64 HOST_WIDE_INT_PRINT "o"
-#undef PRIu64
+#ifndef PRIu64
 #define PRIu64 HOST_WIDE_INT_PRINT "u"
-#undef PRIx64
+#ifndef PRIx64
 #define PRIx64 HOST_WIDE_INT_PRINT "x"
-#undef PRIX64
+#ifndef PRIX64
+/* 32bit variants go here once we start using them.  */
 /* Define HOST_WIDEST_FAST_INT to the widest integer type supported
    efficiently in hardware.  (That is, the widest integer type that fits

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]