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
This commit is contained in:
Douglas B Rupp 2009-08-25 23:19:16 +00:00 committed by Douglas Rupp
parent ff22013ab2
commit edb890249f
8 changed files with 58 additions and 18 deletions

View File

@ -1,3 +1,12 @@
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>
* config/i386/bmmintrin.h: Replace by #error.

View File

@ -2028,14 +2028,16 @@ debug_bitmap_file (FILE *file, const_bitmap head)
{
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);
for (ptr = head->first; ptr; ptr = ptr->next)
{
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->prev, ptr->indx);

View File

@ -579,7 +579,7 @@ c_print_identifier (FILE *file, tree node, int indent)
{
tree rid = ridpointers[C_RID_CODE (node)];
indent_to (file, indent + 4);
fprintf (file, "rid %p \"%s\"",
fprintf (file, "rid " HOST_PTR_PRINTF " \"%s\"",
(void *) rid, IDENTIFIER_POINTER (rid));
}
}

View File

@ -1,5 +1,6 @@
@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 For copying conditions, see the file gccint.texi.
@ -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
long} to functions like @code{printf}. The default value is
@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
In addition, if @command{configure} generates an incorrect definition of

View File

@ -1,5 +1,5 @@
/* 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.
@ -15,6 +15,12 @@
#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT)
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
/* 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. */
#ifndef HOST_LONG_LONG_FORMAT
@ -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. */
#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"
/* 'long' might be 32 or 64 bits, and the number of leading zeroes
must be tweaked accordingly. */
# 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
# 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
#else
# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT

View File

@ -3993,7 +3993,8 @@ write_varray (varray_t *vp, /* virtual array */
return;
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,
vp->num_allocated * vp->object_size, str);
@ -4032,7 +4033,8 @@ write_object (void)
off_t offset;
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,
(unsigned long) sizeof (symbolic_header), "symbolic header");
@ -4062,7 +4064,8 @@ write_object (void)
pfatal_with_name (object_name);
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,
(long) symbolic_header.cbLine, "Line numbers");
@ -4093,7 +4096,8 @@ write_object (void)
pfatal_with_name (object_name);
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,
num_write, "Optimizer symbols");
@ -4181,7 +4185,8 @@ write_object (void)
file_ptr = file_ptr->next_file)
{
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,
(unsigned long) sizeof (FDR), "File header");
@ -4213,7 +4218,8 @@ write_object (void)
pfatal_with_name (object_name);
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,
num_write, "Relative file descriptors");
@ -5006,7 +5012,7 @@ allocate_cluster (Size_t npages)
pfatal_with_name ("allocate_cluster");
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);
return ptr;

View File

@ -1,6 +1,7 @@
/* Prints out tree in human readable form - GCC
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.
@ -66,7 +67,7 @@ dump_addr (FILE *file, const char *prefix, const void *addr)
if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (file, "%s#", prefix);
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. */

View File

@ -518,6 +518,11 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
# define mkdir(a,b) mkdir(a)
#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. */
#ifndef PATH_SEPARATOR
#define PATH_SEPARATOR ':'
@ -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 \
LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \
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 \
TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \
SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \