From ca0205ee617ab19b9dc4f6f322b501c57624c187 Mon Sep 17 00:00:00 2001 From: ghazi Date: Tue, 16 Aug 2005 00:13:53 +0000 Subject: [PATCH] * aclocal.m4 (gcc_AC_FUNC_PRINTF_PTR): Delete. * configure.ac: Don't call gcc_AC_FUNC_PRINTF_PTR. * system.h (HOST_PTR_PRINTF): Don't define, poison it. * bitmap.c, c-decl.c, config/i386/i386-interix.h, config/iq2000/iq2000.c, mips-tfile.c, print-rtl.c, print-tree.c: Delete HOST_PTR_PRINTF. * configure, config.in: Regenerate. cp: * name-lookup.c, ptree.c: Delete HOST_PTR_PRINTF. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103135 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 13 ++++++++++ gcc/aclocal.m4 | 21 --------------- gcc/bitmap.c | 6 ++--- gcc/c-decl.c | 2 +- gcc/config.in | 6 ----- gcc/config/i386/i386-interix.h | 1 - gcc/config/iq2000/iq2000.c | 4 +-- gcc/configure | 59 ------------------------------------------ gcc/configure.ac | 1 - gcc/cp/ChangeLog | 4 +++ gcc/cp/name-lookup.c | 10 +++---- gcc/cp/ptree.c | 8 +++--- gcc/mips-tfile.c | 20 +++++--------- gcc/print-rtl.c | 4 +-- gcc/print-tree.c | 10 +++---- gcc/system.h | 15 +---------- 16 files changed, 46 insertions(+), 138 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59c7482..fac404b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2005-08-15 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_FUNC_PRINTF_PTR): Delete. + * configure.ac: Don't call gcc_AC_FUNC_PRINTF_PTR. + * system.h (HOST_PTR_PRINTF): Don't define, poison it. + + * bitmap.c, c-decl.c, config/i386/i386-interix.h, + config/iq2000/iq2000.c, mips-tfile.c, print-rtl.c, print-tree.c: + Delete HOST_PTR_PRINTF. + + * configure, config.in: Regenerate. + + 2005-08-15 David Edelsohn * config/rs6000/rs6000.md (QHSI): New mode macro. diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 789112b..2b1c198 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -89,27 +89,6 @@ make_compare_target=$gcc_cv_prog_cmp_skip AC_SUBST(make_compare_target) ]) -dnl See if the printf functions in libc support %p in format strings. -AC_DEFUN([gcc_AC_FUNC_PRINTF_PTR], -[AC_CACHE_CHECK(whether the printf functions support %p, - gcc_cv_func_printf_ptr, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include - -int main() -{ - char buf[64]; - char *p = buf, *q = NULL; - sprintf(buf, "%p", p); - sscanf(buf, "%p", &q); - return (p != q); -}]])], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no, - gcc_cv_func_printf_ptr=no) -rm -f core core.* *.core]) -if test $gcc_cv_func_printf_ptr = yes ; then - AC_DEFINE(HAVE_PRINTF_PTR, 1, [Define if printf supports "%p".]) -fi -]) - dnl See if symbolic links work and if not, try to substitute either hard links or simple copy. AC_DEFUN([gcc_AC_PROG_LN_S], [AC_MSG_CHECKING(whether ln -s works) diff --git a/gcc/bitmap.c b/gcc/bitmap.c index e587c24..3ee8bbd 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -1217,16 +1217,14 @@ debug_bitmap_file (FILE *file, bitmap head) { bitmap_element *ptr; - fprintf (file, "\nfirst = " HOST_PTR_PRINTF - " current = " HOST_PTR_PRINTF " indx = %u\n", + fprintf (file, "\nfirst = %p current = %p 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" HOST_PTR_PRINTF " next = " HOST_PTR_PRINTF - " prev = " HOST_PTR_PRINTF " indx = %u\n\t\tbits = {", + fprintf (file, "\t%p next = %p prev = %p indx = %u\n\t\tbits = {", (void*) ptr, (void*) ptr->next, (void*) ptr->prev, ptr->indx); for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 903b5aa..ff35e08 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -466,7 +466,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 " HOST_PTR_PRINTF " \"%s\"", + fprintf (file, "rid %p \"%s\"", (void *) rid, IDENTIFIER_POINTER (rid)); } } diff --git a/gcc/config.in b/gcc/config.in index 3fc2f58..f533c1c 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -958,12 +958,6 @@ #endif -/* Define if printf supports "%p". */ -#ifndef USED_FOR_TARGET -#undef HAVE_PRINTF_PTR -#endif - - /* Define to 1 if you have the `putchar_unlocked' function. */ #ifndef USED_FOR_TARGET #undef HAVE_PUTCHAR_UNLOCKED diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index 4a96aad..75e1e2b 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -286,7 +286,6 @@ do \ } \ while (0) -#define HOST_PTR_PRINTF "%p" #define HOST_PTR_AS_INT unsigned long #define PCC_BITFIELD_TYPE_MATTERS 1 diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 57e24ea..2adf50a 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1124,7 +1124,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, "function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, ", cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode)); - fprintf (stderr, HOST_PTR_PRINTF, (const PTR) type); + fprintf (stderr, "%p", (void *) type); fprintf (stderr, ", %d )\n\n", named); } @@ -1197,7 +1197,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, "function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, ", cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode)); - fprintf (stderr, HOST_PTR_PRINTF, (const PTR) type); + fprintf (stderr, "%p", (void *) type); fprintf (stderr, ", %d ) = ", named); } diff --git a/gcc/configure b/gcc/configure index 8ec99c2..dd25a7d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -9489,65 +9489,6 @@ else fi -echo "$as_me:$LINENO: checking whether the printf functions support %p" >&5 -echo $ECHO_N "checking whether the printf functions support %p... $ECHO_C" >&6 -if test "${gcc_cv_func_printf_ptr+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - gcc_cv_func_printf_ptr=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int main() -{ - char buf[64]; - char *p = buf, *q = NULL; - sprintf(buf, "%p", p); - sscanf(buf, "%p", &q); - return (p != q); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gcc_cv_func_printf_ptr=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gcc_cv_func_printf_ptr=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f core core.* *.core -fi -echo "$as_me:$LINENO: result: $gcc_cv_func_printf_ptr" >&5 -echo "${ECHO_T}$gcc_cv_func_printf_ptr" >&6 -if test $gcc_cv_func_printf_ptr = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRINTF_PTR 1 -_ACEOF - -fi - echo "$as_me:$LINENO: checking for sys/mman.h" >&5 echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 diff --git a/gcc/configure.ac b/gcc/configure.ac index 516d75d..3cda92c 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1044,7 +1044,6 @@ else fi AC_SUBST(TARGET_GETGROUPS_T) -gcc_AC_FUNC_PRINTF_PTR gcc_AC_FUNC_MMAP_BLACKLIST case "${host}" in diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cdbd2b6..93c9338 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2005-08-15 Kaveh R. Ghazi + + * name-lookup.c, ptree.c: Delete HOST_PTR_PRINTF. + 2005-08-15 Fariborz Jahanian * cp-tree.h (can_convert_arg, fn_type_unification): New argument. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 79a6552..2beb3e7 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1484,7 +1484,7 @@ print_binding_level (struct cp_binding_level* lvl) { tree t; int i = 0, len; - fprintf (stderr, " blocks=" HOST_PTR_PRINTF, (void *) lvl->blocks); + fprintf (stderr, " blocks=%p", (void *) lvl->blocks); if (lvl->more_cleanups_ok) fprintf (stderr, " more-cleanups-ok"); if (lvl->have_cleanups) @@ -1549,7 +1549,7 @@ print_other_binding_stack (struct cp_binding_level *stack) struct cp_binding_level *level; for (level = stack; !global_scope_p (level); level = level->level_chain) { - fprintf (stderr, "binding level " HOST_PTR_PRINTF "\n", (void *) level); + fprintf (stderr, "binding level %p\n", (void *) level); print_binding_level (level); } } @@ -1558,9 +1558,9 @@ void print_binding_stack (void) { struct cp_binding_level *b; - fprintf (stderr, "current_binding_level=" HOST_PTR_PRINTF - "\nclass_binding_level=" HOST_PTR_PRINTF - "\nNAMESPACE_LEVEL (global_namespace)=" HOST_PTR_PRINTF "\n", + fprintf (stderr, "current_binding_level=%p\n" + "class_binding_level=%p\n" + "NAMESPACE_LEVEL (global_namespace)=%p\n", (void *) current_binding_level, (void *) class_binding_level, (void *) NAMESPACE_LEVEL (global_namespace)); if (class_binding_level) diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 7526373..8a7ba94 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -46,15 +46,15 @@ cxx_print_decl (FILE *file, tree node, int indent) indent_to (file, indent + 3); if (TREE_CODE (node) == FUNCTION_DECL && DECL_PENDING_INLINE_INFO (node)) - fprintf (file, " pending-inline-info " HOST_PTR_PRINTF, + fprintf (file, " pending-inline-info %p", (void *) DECL_PENDING_INLINE_INFO (node)); if (TREE_CODE (node) == TYPE_DECL && DECL_SORTED_FIELDS (node)) - fprintf (file, " sorted-fields " HOST_PTR_PRINTF, + fprintf (file, " sorted-fields %p", (void *) DECL_SORTED_FIELDS (node)); if ((TREE_CODE (node) == FUNCTION_DECL || TREE_CODE (node) == VAR_DECL) && DECL_TEMPLATE_INFO (node)) - fprintf (file, " template-info " HOST_PTR_PRINTF, + fprintf (file, " template-info %p", (void *) DECL_TEMPLATE_INFO (node)); } @@ -142,7 +142,7 @@ cxx_print_type (FILE *file, tree node, int indent) static void cxx_print_binding (FILE *stream, cxx_binding *binding, const char *prefix) { - fprintf (stream, "%s <" HOST_PTR_PRINTF ">", + fprintf (stream, "%s <%p>", prefix, (void *) binding); } diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index c96eb41..d7d754f 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -3980,8 +3980,7 @@ write_varray (varray_t *vp, /* virtual array */ return; if (debug) - fprintf (stderr, "\twarray\tvp = " HOST_PTR_PRINTF - ", offset = %7lu, size = %7lu, %s\n", + fprintf (stderr, "\twarray\tvp = %p, offset = %7lu, size = %7lu, %s\n", (void *) vp, (unsigned long) offset, vp->num_allocated * vp->object_size, str); @@ -4020,8 +4019,7 @@ write_object (void) off_t offset; if (debug) - fprintf (stderr, "\n\twrite\tvp = " HOST_PTR_PRINTF - ", offset = %7u, size = %7lu, %s\n", + fprintf (stderr, "\n\twrite\tvp = %p, offset = %7u, size = %7lu, %s\n", (void *) &symbolic_header, 0, (unsigned long) sizeof (symbolic_header), "symbolic header"); @@ -4051,8 +4049,7 @@ write_object (void) pfatal_with_name (object_name); if (debug) - fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF - ", offset = %7lu, size = %7lu, %s\n", + fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", (void *) &orig_linenum, (long) symbolic_header.cbLineOffset, (long) symbolic_header.cbLine, "Line numbers"); @@ -4083,8 +4080,7 @@ write_object (void) pfatal_with_name (object_name); if (debug) - fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF - ", offset = %7lu, size = %7lu, %s\n", + fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", (void *) &orig_opt_syms, (long) symbolic_header.cbOptOffset, num_write, "Optimizer symbols"); @@ -4172,8 +4168,7 @@ write_object (void) file_ptr = file_ptr->next_file) { if (debug) - fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF - ", offset = %7lu, size = %7lu, %s\n", + fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", (void *) &file_ptr->fdr, file_offset, (unsigned long) sizeof (FDR), "File header"); @@ -4205,8 +4200,7 @@ write_object (void) pfatal_with_name (object_name); if (debug) - fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF - ", offset = %7lu, size = %7lu, %s\n", + fprintf (stderr, "\twrite\tvp = %p, offset = %7lu, size = %7lu, %s\n", (void *) &orig_rfds, (long) symbolic_header.cbRfdOffset, num_write, "Relative file descriptors"); @@ -4999,7 +4993,7 @@ allocate_cluster (Size_t npages) pfatal_with_name ("allocate_cluster"); if (debug > 3) - fprintf (stderr, "\talloc\tnpages = %lu, value = " HOST_PTR_PRINTF "\n", + fprintf (stderr, "\talloc\tnpages = %lu, value = %p\n", (unsigned long) npages, (void *) ptr); return ptr; diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 07bfff9..73e3710 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -287,7 +287,7 @@ print_rtx (rtx in_rtx) if (flag_dump_unnumbered) fprintf (outfile, "#"); else - fprintf (outfile, HOST_PTR_PRINTF, + fprintf (outfile, "%p", (char *) NOTE_BLOCK (in_rtx)); sawclose = 1; break; @@ -539,7 +539,7 @@ print_rtx (rtx in_rtx) break; case 't': - fprintf (outfile, " " HOST_PTR_PRINTF, (void *) XTREE (in_rtx, i)); + fprintf (outfile, " %p", (void *) XTREE (in_rtx, i)); break; case '*': diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 954ee2d..ddc370b 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -73,7 +73,7 @@ print_node_brief (FILE *file, const char *prefix, tree node, int indent) name if any. */ if (indent > 0) fprintf (file, " "); - fprintf (file, "%s <%s " HOST_PTR_PRINTF, + fprintf (file, "%s <%s %p", prefix, tree_code_name[(int) TREE_CODE (node)], (char *) node); if (class == tcc_declaration) @@ -218,7 +218,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) indent_to (file, indent); /* Print the slot this node is in, and its code, and address. */ - fprintf (file, "%s <%s " HOST_PTR_PRINTF, + fprintf (file, "%s <%s %p", prefix, tree_code_name[(int) TREE_CODE (node)], (void *) node); /* Print the name, if any. */ @@ -495,7 +495,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) && DECL_STRUCT_FUNCTION (node) != 0) { indent_to (file, indent + 4); - fprintf (file, "saved-insns " HOST_PTR_PRINTF, + fprintf (file, "saved-insns %p", (void *) DECL_STRUCT_FUNCTION (node)); } @@ -755,7 +755,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) break; case STATEMENT_LIST: - fprintf (file, " head " HOST_PTR_PRINTF " tail " HOST_PTR_PRINTF " stmts", + fprintf (file, " head %p tail %p stmts", (void *) node->stmt_list.head, (void *) node->stmt_list.tail); { tree_stmt_iterator i; @@ -763,7 +763,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) { /* Not printing the addresses of the (not-a-tree) 'struct tree_stmt_list_node's. */ - fprintf (file, " " HOST_PTR_PRINTF, (void *)tsi_stmt (i)); + fprintf (file, " %p", (void *)tsi_stmt (i)); } fprintf (file, "\n"); for (i = tsi_start (node); !tsi_end_p (i); tsi_next (&i)) diff --git a/gcc/system.h b/gcc/system.h index 48105fe..34c9009 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -511,19 +511,6 @@ 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 -# ifdef HAVE_PRINTF_PTR -# define HOST_PTR_PRINTF "%p" -# elif SIZEOF_INT == SIZEOF_VOID_P -# define HOST_PTR_PRINTF "%x" -# elif SIZEOF_LONG == SIZEOF_VOID_P -# define HOST_PTR_PRINTF "%lx" -# else -# define HOST_PTR_PRINTF "%llx" -# endif -#endif /* ! HOST_PTR_PRINTF */ - /* By default, colon separates directories in a path. */ #ifndef PATH_SEPARATOR #define PATH_SEPARATOR ':' @@ -741,7 +728,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 + PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ -- 2.7.4