Commit edb89024 by Douglas B Rupp Committed by Douglas Rupp

hwint.h (HOST_LONG_FORMAT): New macro


	* hwint.h (HOST_LONG_FORMAT): New macro
	* bitmap.c, c-decl.c, mips-tfile.c, print-rtl.c, print-tree.c:
	Use HOST_PTR_PRINTF.
	* system.h (HOST_PTR_PRINTF): Resurrect old macro
	* doc/hostconfig.texi (HOST_LONG_FORMAT): Document.
	(HOST_PTR_PRINTF): Document.

From-SVN: r151108
parent ff22013a
2009-08-25 Douglas B Rupp <rupp@gnat.com>
* hwint.h (HOST_LONG_FORMAT): New macro
* bitmap.c, c-decl.c, mips-tfile.c, print-rtl.c, print-tree.c:
Use HOST_PTR_PRINTF.
* system.h (HOST_PTR_PRINTF): Resurrect old macro
* doc/hostconfig.texi (HOST_LONG_FORMAT): Document.
(HOST_PTR_PRINTF): Document.
2009-08-25 Jan Hubicka <jh@suse.cz> 2009-08-25 Jan Hubicka <jh@suse.cz>
* config/i386/bmmintrin.h: Replace by #error. * config/i386/bmmintrin.h: Replace by #error.
......
...@@ -2028,14 +2028,16 @@ debug_bitmap_file (FILE *file, const_bitmap head) ...@@ -2028,14 +2028,16 @@ debug_bitmap_file (FILE *file, const_bitmap head)
{ {
const bitmap_element *ptr; const bitmap_element *ptr;
fprintf (file, "\nfirst = %p current = %p indx = %u\n", fprintf (file, "\nfirst = " HOST_PTR_PRINTF
" current = " HOST_PTR_PRINTF " indx = %u\n",
(void *) head->first, (void *) head->current, head->indx); (void *) head->first, (void *) head->current, head->indx);
for (ptr = head->first; ptr; ptr = ptr->next) for (ptr = head->first; ptr; ptr = ptr->next)
{ {
unsigned int i, j, col = 26; unsigned int i, j, col = 26;
fprintf (file, "\t%p next = %p prev = %p indx = %u\n\t\tbits = {", fprintf (file, "\t" HOST_PTR_PRINTF " next = " HOST_PTR_PRINTF
" prev = " HOST_PTR_PRINTF " indx = %u\n\t\tbits = {",
(const void*) ptr, (const void*) ptr->next, (const void*) ptr, (const void*) ptr->next,
(const void*) ptr->prev, ptr->indx); (const void*) ptr->prev, ptr->indx);
......
...@@ -579,7 +579,7 @@ c_print_identifier (FILE *file, tree node, int indent) ...@@ -579,7 +579,7 @@ c_print_identifier (FILE *file, tree node, int indent)
{ {
tree rid = ridpointers[C_RID_CODE (node)]; tree rid = ridpointers[C_RID_CODE (node)];
indent_to (file, indent + 4); indent_to (file, indent + 4);
fprintf (file, "rid %p \"%s\"", fprintf (file, "rid " HOST_PTR_PRINTF " \"%s\"",
(void *) rid, IDENTIFIER_POINTER (rid)); (void *) rid, IDENTIFIER_POINTER (rid));
} }
} }
......
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
@c 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. @c 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
@c Free Software Foundation, Inc.
@c This is part of the GCC manual. @c This is part of the GCC manual.
@c For copying conditions, see the file gccint.texi. @c For copying conditions, see the file gccint.texi.
...@@ -212,6 +213,14 @@ initialization when a compilation driver is being initialized. ...@@ -212,6 +213,14 @@ initialization when a compilation driver is being initialized.
If defined, the string used to indicate an argument of type @code{long If defined, the string used to indicate an argument of type @code{long
long} to functions like @code{printf}. The default value is long} to functions like @code{printf}. The default value is
@code{"ll"}. @code{"ll"}.
@item HOST_LONG_FORMAT
If defined, the string used to indicate an argument of type @code{long}
to functions like @code{printf}. The default value is @code{"l"}.
@item HOST_PTR_PRINTF
If defined, the string used to indicate an argument of type @code{void *}
to functions like @code{printf}. The default value is @code{"%p"}.
@end ftable @end ftable
In addition, if @command{configure} generates an incorrect definition of In addition, if @command{configure} generates an incorrect definition of
......
/* HOST_WIDE_INT definitions for the GNU compiler. /* HOST_WIDE_INT definitions for the GNU compiler.
Copyright (C) 1998, 2002, 2004, 2008 Free Software Foundation, Inc. Copyright (C) 1998, 2002, 2004, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) #define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
/* The string that should be inserted into a printf style format to /* The string that should be inserted into a printf style format to
indicate a "long" operand. */
#ifndef HOST_LONG_FORMAT
#define HOST_LONG_FORMAT "l"
#endif
/* The string that should be inserted into a printf style format to
indicate a "long long" operand. */ indicate a "long long" operand. */
#ifndef HOST_LONG_LONG_FORMAT #ifndef HOST_LONG_LONG_FORMAT
#define HOST_LONG_LONG_FORMAT "ll" #define HOST_LONG_LONG_FORMAT "ll"
...@@ -70,14 +76,16 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1]; ...@@ -70,14 +76,16 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
/* Various printf format strings for HOST_WIDE_INT. */ /* Various printf format strings for HOST_WIDE_INT. */
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT "l" # define HOST_WIDE_INT_PRINT HOST_LONG_FORMAT
# define HOST_WIDE_INT_PRINT_C "L" # define HOST_WIDE_INT_PRINT_C "L"
/* 'long' might be 32 or 64 bits, and the number of leading zeroes /* 'long' might be 32 or 64 bits, and the number of leading zeroes
must be tweaked accordingly. */ must be tweaked accordingly. */
# if HOST_BITS_PER_WIDE_INT == 64 # if HOST_BITS_PER_WIDE_INT == 64
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx" # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
"0x%" HOST_LONG_FORMAT "x%016" HOST_LONG_FORMAT "x"
# else # else
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx" # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
"0x%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x"
# endif # endif
#else #else
# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT # define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT
......
...@@ -3993,7 +3993,8 @@ write_varray (varray_t *vp, /* virtual array */ ...@@ -3993,7 +3993,8 @@ write_varray (varray_t *vp, /* virtual array */
return; return;
if (debug) if (debug)
fprintf (stderr, "\twarray\tvp = %p, offset = %7lu, size = %7lu, %s\n", fprintf (stderr, "\twarray\tvp = " HOST_PTR_PRINTF
", offset = %7lu, size = %7lu, %s\n",
(void *) vp, (unsigned long) offset, (void *) vp, (unsigned long) offset,
vp->num_allocated * vp->object_size, str); vp->num_allocated * vp->object_size, str);
...@@ -4032,7 +4033,8 @@ write_object (void) ...@@ -4032,7 +4033,8 @@ write_object (void)
off_t offset; off_t offset;
if (debug) if (debug)
fprintf (stderr, "\n\twrite\tvp = %p, offset = %7u, size = %7lu, %s\n", fprintf (stderr, "\n\twrite\tvp = " HOST_PTR_PRINTF
", offset = %7u, size = %7lu, %s\n",
(void *) &symbolic_header, 0, (void *) &symbolic_header, 0,
(unsigned long) sizeof (symbolic_header), "symbolic header"); (unsigned long) sizeof (symbolic_header), "symbolic header");
...@@ -4062,7 +4064,8 @@ write_object (void) ...@@ -4062,7 +4064,8 @@ write_object (void)
pfatal_with_name (object_name); pfatal_with_name (object_name);
if (debug) if (debug)
fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
", offset = %7lu, size = %7lu, %s\n",
(void *) &orig_linenum, (long) symbolic_header.cbLineOffset, (void *) &orig_linenum, (long) symbolic_header.cbLineOffset,
(long) symbolic_header.cbLine, "Line numbers"); (long) symbolic_header.cbLine, "Line numbers");
...@@ -4093,7 +4096,8 @@ write_object (void) ...@@ -4093,7 +4096,8 @@ write_object (void)
pfatal_with_name (object_name); pfatal_with_name (object_name);
if (debug) if (debug)
fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
", offset = %7lu, size = %7lu, %s\n",
(void *) &orig_opt_syms, (long) symbolic_header.cbOptOffset, (void *) &orig_opt_syms, (long) symbolic_header.cbOptOffset,
num_write, "Optimizer symbols"); num_write, "Optimizer symbols");
...@@ -4181,7 +4185,8 @@ write_object (void) ...@@ -4181,7 +4185,8 @@ write_object (void)
file_ptr = file_ptr->next_file) file_ptr = file_ptr->next_file)
{ {
if (debug) if (debug)
fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
", offset = %7lu, size = %7lu, %s\n",
(void *) &file_ptr->fdr, file_offset, (void *) &file_ptr->fdr, file_offset,
(unsigned long) sizeof (FDR), "File header"); (unsigned long) sizeof (FDR), "File header");
...@@ -4213,7 +4218,8 @@ write_object (void) ...@@ -4213,7 +4218,8 @@ write_object (void)
pfatal_with_name (object_name); pfatal_with_name (object_name);
if (debug) if (debug)
fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
", offset = %7lu, size = %7lu, %s\n",
(void *) &orig_rfds, (long) symbolic_header.cbRfdOffset, (void *) &orig_rfds, (long) symbolic_header.cbRfdOffset,
num_write, "Relative file descriptors"); num_write, "Relative file descriptors");
...@@ -5006,7 +5012,7 @@ allocate_cluster (Size_t npages) ...@@ -5006,7 +5012,7 @@ allocate_cluster (Size_t npages)
pfatal_with_name ("allocate_cluster"); pfatal_with_name ("allocate_cluster");
if (debug > 3) if (debug > 3)
fprintf (stderr, "\talloc\tnpages = %lu, value = %p\n", fprintf (stderr, "\talloc\tnpages = %lu, value = " HOST_PTR_PRINTF "\n",
(unsigned long) npages, (void *) ptr); (unsigned long) npages, (void *) ptr);
return ptr; return ptr;
......
/* Prints out tree in human readable form - GCC /* Prints out tree in human readable form - GCC
Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -66,7 +67,7 @@ dump_addr (FILE *file, const char *prefix, const void *addr) ...@@ -66,7 +67,7 @@ dump_addr (FILE *file, const char *prefix, const void *addr)
if (flag_dump_noaddr || flag_dump_unnumbered) if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (file, "%s#", prefix); fprintf (file, "%s#", prefix);
else else
fprintf (file, "%s%p", prefix, addr); fprintf (file, "%s" HOST_PTR_PRINTF, prefix, addr);
} }
/* Print a node in brief fashion, with just the code, address and name. */ /* Print a node in brief fashion, with just the code, address and name. */
......
...@@ -518,6 +518,11 @@ extern int vsnprintf(char *, size_t, const char *, va_list); ...@@ -518,6 +518,11 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
# define mkdir(a,b) mkdir(a) # define mkdir(a,b) mkdir(a)
#endif #endif
/* Provide a way to print an address via printf. */
#ifndef HOST_PTR_PRINTF
#define HOST_PTR_PRINTF "%p"
#endif /* ! HOST_PTR_PRINTF */
/* By default, colon separates directories in a path. */ /* By default, colon separates directories in a path. */
#ifndef PATH_SEPARATOR #ifndef PATH_SEPARATOR
#define PATH_SEPARATOR ':' #define PATH_SEPARATOR ':'
...@@ -742,7 +747,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ...@@ -742,7 +747,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \ TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \
LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \ LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \
TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \ TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \
PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF \ PREDICATE_CODES SPECIAL_MODE_PREDICATES \
EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \ EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \
TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \ TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \
SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \ SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment