Merge
authordavid
Fri, 09 Oct 2015 08:46:44 +0000
changeset 33149 a82c401c7eed
parent 33147 52e5fbc71615 (current diff)
parent 33148 68fa8b6c4340 (diff)
child 33150 9e514d10a7bf
Merge
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -48,8 +48,6 @@
 }
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Profiling/safepoint support
 
 bool frame::safe_for_sender(JavaThread *thread) {
@@ -280,7 +278,7 @@
   address* pc_addr = &(((address*) sp())[-1]);
   if (TracePcPatching) {
     tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]",
-                  pc_addr, *pc_addr, pc);
+                  p2i(pc_addr), p2i(*pc_addr), p2i(pc));
   }
   // Either the return address is the original one or we are going to
   // patch in the same address that's already there.
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -52,8 +52,6 @@
 
 #define __ _masm->
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef _WIN64
 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
   address entry = __ pc();
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -57,8 +57,6 @@
 
 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef ASSERT
 bool AbstractAssembler::pd_check_instruction_mark() { return true; }
 #endif
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -30,8 +30,6 @@
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #define __ _masm->
 
 #ifdef PRODUCT
@@ -488,7 +486,7 @@
   const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx";
   tty->print_cr("MH %s %s=" PTR_FORMAT " sp=" PTR_FORMAT,
                 adaptername, mh_reg_name,
-                (void *)mh, entry_sp);
+                p2i(mh), p2i(entry_sp));
 
   if (Verbose) {
     tty->print_cr("Registers:");
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -35,8 +35,6 @@
 #include "c1/c1_Runtime1.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void NativeInstruction::wrote(int offset) {
   ICache::invalidate_word(addr_at(offset));
 }
@@ -46,7 +44,7 @@
   // Make sure code pattern is actually a call imm32 instruction.
   int inst = ubyte_at(0);
   if (inst != instruction_code) {
-    tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", instruction_address(),
+    tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", p2i(instruction_address()),
                                                         inst);
     fatal("not a call disp32");
   }
@@ -63,7 +61,7 @@
 
 void NativeCall::print() {
   tty->print_cr(PTR_FORMAT ": call " PTR_FORMAT,
-                instruction_address(), destination());
+                p2i(instruction_address()), p2i(destination()));
 }
 
 // Inserts a native call instruction at a given pc
@@ -230,7 +228,7 @@
 
 void NativeMovConstReg::print() {
   tty->print_cr(PTR_FORMAT ": mov reg, " INTPTR_FORMAT,
-                instruction_address(), data());
+                p2i(instruction_address()), data());
 }
 
 //-------------------------------------------------------------------
@@ -396,7 +394,7 @@
 
 
 void NativeMovRegMem::print() {
-  tty->print_cr("0x%x: mov reg, [reg + %x]", instruction_address(), offset());
+  tty->print_cr(PTR_FORMAT ": mov reg, [reg + %x]", p2i(instruction_address()), offset());
 }
 
 //-------------------------------------------------------------------
@@ -418,7 +416,7 @@
 
 
 void NativeLoadAddress::print() {
-  tty->print_cr("0x%x: lea [reg + %x], reg", instruction_address(), offset());
+  tty->print_cr(PTR_FORMAT ": lea [reg + %x], reg", p2i(instruction_address()), offset());
 }
 
 //--------------------------------------------------------------------------------
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -35,8 +35,6 @@
 #include "opto/runtime.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // machine-dependent part of VtableStubs: create VtableStub of correct size and
 // initialize its code
 
@@ -113,7 +111,7 @@
 
   if (PrintMiscellaneous && (WizardMode || Verbose)) {
     tty->print_cr("vtable #%d at " PTR_FORMAT "[%d] left over: %d",
-                  vtable_index, s->entry_point(),
+                  vtable_index, p2i(s->entry_point()),
                   (int)(s->code_end() - s->entry_point()),
                   (int)(s->code_end() - __ pc()));
   }
@@ -206,7 +204,7 @@
 
   if (PrintMiscellaneous && (WizardMode || Verbose)) {
     tty->print_cr("itable #%d at " PTR_FORMAT "[%d] left over: %d",
-                  itable_index, s->entry_point(),
+                  itable_index, p2i(s->entry_point()),
                   (int)(s->code_end() - s->entry_point()),
                   (int)(s->code_end() - __ pc()));
   }
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -128,8 +128,6 @@
 
 #define LARGEPAGES_BIT (1 << 6)
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 ////////////////////////////////////////////////////////////////////////////////
 // global variables
 julong os::Bsd::_physical_memory = 0;
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -106,8 +106,6 @@
 # include <inttypes.h>
 # include <sys/ioctl.h>
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
 // getrusage() is prepared to handle the associated failure.
 #ifndef RUSAGE_THREAD
@@ -1969,7 +1967,8 @@
       char name[PATH_MAX + 1];
 
       // Parse fields from line
-      sscanf(line, "%lx-%lx %4s %lx %5s %ld %s", &base, &top, permissions, &offset, device, &inode, name);
+      sscanf(line, UINT64_FORMAT_X "-" UINT64_FORMAT_X " %4s " UINT64_FORMAT_X " %5s " INT64_FORMAT " %s",
+             &base, &top, permissions, &offset, device, &inode, name);
 
       // Filter by device id '00:00' so that we only get file system mapped files.
       if (strcmp(device, "00:00") != 0) {
@@ -2632,7 +2631,7 @@
 static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
                                     int err) {
   warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
-          ", %d) failed; error='%s' (errno=%d)", addr, size, exec,
+          ", %d) failed; error='%s' (errno=%d)", p2i(addr), size, exec,
           strerror(err), err);
 }
 
@@ -2640,7 +2639,7 @@
                                     size_t alignment_hint, bool exec,
                                     int err) {
   warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
-          ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", addr, size,
+          ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", p2i(addr), size,
           alignment_hint, exec, strerror(err), err);
 }
 
@@ -4717,7 +4716,7 @@
   if (threadStackSizeInBytes != 0 &&
       threadStackSizeInBytes < os::Linux::min_stack_allowed) {
     tty->print_cr("\nThe stack size specified is too small, "
-                  "Specify at least %dk",
+                  "Specify at least " SIZE_FORMAT "k",
                   os::Linux::min_stack_allowed/ K);
     return JNI_ERR;
   }
@@ -4918,12 +4917,12 @@
   Dl_info dlinfo;
   memset(&dlinfo, 0, sizeof(dlinfo));
   if (dladdr(addr, &dlinfo) != 0) {
-    st->print(PTR_FORMAT ": ", addr);
+    st->print(PTR_FORMAT ": ", p2i(addr));
     if (dlinfo.dli_sname != NULL && dlinfo.dli_saddr != NULL) {
-      st->print("%s+%#x", dlinfo.dli_sname,
-                addr - (intptr_t)dlinfo.dli_saddr);
+      st->print("%s+" PTR_FORMAT, dlinfo.dli_sname,
+                p2i(addr) - p2i(dlinfo.dli_saddr));
     } else if (dlinfo.dli_fbase != NULL) {
-      st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
+      st->print("<offset " PTR_FORMAT ">", p2i(addr) - p2i(dlinfo.dli_fbase));
     } else {
       st->print("<absolute address>");
     }
@@ -4931,7 +4930,7 @@
       st->print(" in %s", dlinfo.dli_fname);
     }
     if (dlinfo.dli_fbase != NULL) {
-      st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
+      st->print(" at " PTR_FORMAT, p2i(dlinfo.dli_fbase));
     }
     st->cr();
 
@@ -5323,7 +5322,7 @@
 void os::pause() {
   char filename[MAX_PATH];
   if (PauseAtStartupFile && PauseAtStartupFile[0]) {
-    jio_snprintf(filename, MAX_PATH, PauseAtStartupFile);
+    jio_snprintf(filename, MAX_PATH, "%s", PauseAtStartupFile);
   } else {
     jio_snprintf(filename, MAX_PATH, "./vm.paused.%d", current_process_id());
   }
@@ -5959,7 +5958,7 @@
   int written;
 
   if (core_pattern[0] == '/') {
-    written = jio_snprintf(buffer, bufferSize, core_pattern);
+    written = jio_snprintf(buffer, bufferSize, "%s", core_pattern);
   } else {
     char cwd[PATH_MAX];
 
@@ -6095,7 +6094,7 @@
       for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) {
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false);
         test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " ->  " PTR_FORMAT " %s",
-            size, alignment, p, (p != NULL ? "" : "(failed)"));
+                 size, alignment, p2i(p), (p != NULL ? "" : "(failed)"));
         if (p != NULL) {
           assert(is_ptr_aligned(p, alignment), "must be");
           small_page_write(p, size);
@@ -6114,8 +6113,8 @@
         char* const req_addr = (char*) align_ptr_up(mapping1, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
         test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-            size, alignment, req_addr, p,
-            ((p != NULL ? (p == req_addr ? "(exact match)" : "") : "(failed)")));
+                 size, alignment, p2i(req_addr), p2i(p),
+                 ((p != NULL ? (p == req_addr ? "(exact match)" : "") : "(failed)")));
         if (p != NULL) {
           assert(p == req_addr, "must be");
           small_page_write(p, size);
@@ -6134,8 +6133,7 @@
         char* const req_addr = (char*) align_ptr_up(mapping2, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
         test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-            size, alignment, req_addr, p,
-            ((p != NULL ? "" : "(failed)")));
+                 size, alignment, p2i(req_addr), p2i(p), ((p != NULL ? "" : "(failed)")));
         // as the area around req_addr contains already existing mappings, the API should always
         // return NULL (as per contract, it cannot return another address)
         assert(p == NULL, "must be");
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -38,8 +38,6 @@
 #include <semaphore.h>
 #include <signal.h>
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Todo: provide a os::get_max_process_id() or similar. Number of processes
 // may have been configured, can be read more accurately from proc fs etc.
 #ifndef MAX_PID
@@ -194,30 +192,30 @@
   st->print(" STACK ");
   getrlimit(RLIMIT_STACK, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
+  else st->print("%luk", rlim.rlim_cur >> 10);
 
   st->print(", CORE ");
   getrlimit(RLIMIT_CORE, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
+  else st->print("%luk", rlim.rlim_cur >> 10);
 
   // Isn't there on solaris
 #if !defined(TARGET_OS_FAMILY_solaris) && !defined(TARGET_OS_FAMILY_aix)
   st->print(", NPROC ");
   getrlimit(RLIMIT_NPROC, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
+  else st->print("%lu", rlim.rlim_cur);
 #endif
 
   st->print(", NOFILE ");
   getrlimit(RLIMIT_NOFILE, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
+  else st->print("%lu", rlim.rlim_cur);
 
   st->print(", AS ");
   getrlimit(RLIMIT_AS, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
+  else st->print("%luk", rlim.rlim_cur >> 10);
   st->cr();
 }
 
@@ -961,7 +959,7 @@
     }
   } else if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL ||
              sig == SIGTRAP || sig == SIGFPE) {
-    os->print(", si_addr: " PTR_FORMAT, si->si_addr);
+    os->print(", si_addr: " PTR_FORMAT, p2i(si->si_addr));
 #ifdef SIGPOLL
   } else if (sig == SIGPOLL) {
     os->print(", si_band: " PTR64_FORMAT, (uint64_t)si->si_band);
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -276,8 +276,6 @@
 # endif
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 address os::current_stack_pointer() {
 #if defined(__clang__) || defined(__llvm__)
   register void *esp;
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -89,8 +89,6 @@
 #define SPELL_REG_FP "ebp"
 #endif // AMD64
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 address os::current_stack_pointer() {
 #ifdef SPARC_WORKS
   register void *esp;
@@ -727,32 +725,32 @@
   ucontext_t *uc = (ucontext_t*)context;
   st->print_cr("Registers:");
 #ifdef AMD64
-  st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
-  st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
-  st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
-  st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
+  st->print(  "RAX=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RAX]);
+  st->print(", RBX=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RBX]);
+  st->print(", RCX=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RCX]);
+  st->print(", RDX=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RDX]);
   st->cr();
-  st->print(  "RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
-  st->print(", RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
-  st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
-  st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
+  st->print(  "RSP=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RSP]);
+  st->print(", RBP=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RBP]);
+  st->print(", RSI=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RSI]);
+  st->print(", RDI=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RDI]);
   st->cr();
-  st->print(  "R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
-  st->print(", R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
-  st->print(", R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
-  st->print(", R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
+  st->print(  "R8 =" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R8]);
+  st->print(", R9 =" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R9]);
+  st->print(", R10=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R10]);
+  st->print(", R11=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R11]);
   st->cr();
-  st->print(  "R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
-  st->print(", R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
-  st->print(", R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
-  st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
+  st->print(  "R12=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R12]);
+  st->print(", R13=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R13]);
+  st->print(", R14=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R14]);
+  st->print(", R15=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_R15]);
   st->cr();
-  st->print(  "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]);
-  st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
-  st->print(", CSGSFS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_CSGSFS]);
-  st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]);
+  st->print(  "RIP=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_RIP]);
+  st->print(", EFLAGS=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_EFL]);
+  st->print(", CSGSFS=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_CSGSFS]);
+  st->print(", ERR=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_ERR]);
   st->cr();
-  st->print("  TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]);
+  st->print("  TRAPNO=" INTPTR_FORMAT, (intptr_t)uc->uc_mcontext.gregs[REG_TRAPNO]);
 #else
   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
@@ -766,13 +764,13 @@
   st->cr();
   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
-  st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
+  st->print(", CR2=" PTR64_FORMAT, (uint64_t)uc->uc_mcontext.cr2);
 #endif // AMD64
   st->cr();
   st->cr();
 
   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
-  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
+  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
   print_hex_dump(st, (address)sp, (address)(sp + 8*sizeof(intptr_t)), sizeof(intptr_t));
   st->cr();
 
@@ -780,7 +778,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
+  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
   print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
 }
 
--- a/hotspot/src/share/vm/classfile/dictionary.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/classfile/dictionary.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/hashtable.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 DictionaryEntry*  Dictionary::_current_class_entry = NULL;
 int               Dictionary::_current_class_index =    0;
 
@@ -558,7 +556,7 @@
 
 void ProtectionDomainCacheEntry::print() {
   tty->print_cr("entry " PTR_FORMAT " value " PTR_FORMAT " strongly_reachable %d next " PTR_FORMAT,
-                this, (void*)literal(), _strongly_reachable, next());
+                p2i(this), p2i(literal()), _strongly_reachable, p2i(next()));
 }
 #endif
 
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -53,8 +53,6 @@
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java)    \
   klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
 
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -43,8 +43,6 @@
 #include "gc/g1/g1StringDedup.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // the number of buckets a thread claims
 const int ClaimChunkSize = 32;
 
@@ -445,7 +443,7 @@
   if (str1 == str2) {
     tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
                   "in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
-                  (void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
+                  p2i(str1), bkt1, e_cnt1, bkt2, e_cnt2);
     return _verify_fail_continue;
   }
 
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -37,8 +37,6 @@
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // --------------------------------------------------------------------------
 // the number of buckets a thread claims
 const int ClaimChunkSize = 32;
@@ -623,8 +621,8 @@
           ((float)_symbols_removed/(float)_symbols_counted)* 100);
   }
   tty->print_cr("  Reference counts         %7d", Symbol::_total_count);
-  tty->print_cr("  Symbol arena used        %7dK", arena()->used()/1024);
-  tty->print_cr("  Symbol arena size        %7dK", arena()->size_in_bytes()/1024);
+  tty->print_cr("  Symbol arena used        " SIZE_FORMAT_W(7) "K", arena()->used()/1024);
+  tty->print_cr("  Symbol arena size        " SIZE_FORMAT_W(7) "K", arena()->size_in_bytes()/1024);
   tty->print_cr("  Total symbol length      %7d", total_length);
   tty->print_cr("  Maximum symbol length    %7d", max_length);
   tty->print_cr("  Average symbol length    %7.2f", ((float) total_length / (float) total_count));
@@ -645,7 +643,7 @@
     HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
     if (entry != NULL) {
       while (entry != NULL) {
-        tty->print(PTR_FORMAT " ", entry->literal());
+        tty->print(PTR_FORMAT " ", p2i(entry->literal()));
         entry->literal()->print();
         tty->print(" %d", entry->literal()->refcount());
         p = entry->next_addr();
--- a/hotspot/src/share/vm/code/debugInfo.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/debugInfo.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -29,8 +29,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Constructors
 
 DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
--- a/hotspot/src/share/vm/code/exceptionHandlerTable.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/exceptionHandlerTable.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -27,8 +27,6 @@
 #include "code/nmethod.hpp"
 #include "memory/allocation.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
   _nesting.check();
   if (_length >= _size) {
@@ -186,7 +184,7 @@
 void ImplicitExceptionTable::print(address base) const {
   tty->print("{");
   for( uint i=0; i<len(); i++ )
-    tty->print("< " INTPTR_FORMAT ", " INTPTR_FORMAT " > ",base + *adr(i), base + *(adr(i)+1));
+    tty->print("< " INTPTR_FORMAT ", " INTPTR_FORMAT " > ", p2i(base + *adr(i)), p2i(base + *(adr(i)+1)));
   tty->print_cr("}");
 }
 
@@ -225,6 +223,6 @@
   for (uint i = 0; i < len(); i++) {
      if ((*adr(i) > (unsigned int)nm->insts_size()) ||
          (*(adr(i)+1) > (unsigned int)nm->insts_size()))
-       fatal("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data);
+       fatal("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, p2i(_data));
   }
 }
--- a/hotspot/src/share/vm/code/icBuffer.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/icBuffer.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -38,8 +38,6 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubRoutines.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 DEF_STUB_INTERFACE(ICStub);
 
 StubQueue* InlineCacheBuffer::_buffer    = NULL;
@@ -97,7 +95,7 @@
 }
 
 void ICStub::print() {
-  tty->print_cr("ICStub: site: " INTPTR_FORMAT, _ic_site);
+  tty->print_cr("ICStub: site: " INTPTR_FORMAT, p2i(_ic_site));
 }
 #endif
 
@@ -175,7 +173,7 @@
   assert (CompiledIC_lock->is_locked(), "");
   if (TraceICBuffer) {
     tty->print_cr("  create transition stub for " INTPTR_FORMAT " destination " INTPTR_FORMAT " cached value " INTPTR_FORMAT,
-                  ic->instruction_address(), entry, cached_value);
+                  p2i(ic->instruction_address()), p2i(entry), p2i(cached_value));
   }
 
   // If an transition stub is already associate with the inline cache, then we remove the association.
@@ -230,6 +228,6 @@
   _pending_released = icholder;
   _pending_count++;
   if (TraceICBuffer) {
-    tty->print_cr("enqueueing icholder " INTPTR_FORMAT " to be freed", icholder);
+    tty->print_cr("enqueueing icholder " INTPTR_FORMAT " to be freed", p2i(icholder));
   }
 }
--- a/hotspot/src/share/vm/code/nmethod.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -50,8 +50,6 @@
 #include "shark/sharkCompiler.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 unsigned char nmethod::_global_unloading_clock = 0;
 
 #ifdef DTRACE_ENABLED
@@ -809,9 +807,9 @@
 
 
 #define LOG_OFFSET(log, name)                    \
-  if ((intptr_t)name##_end() - (intptr_t)name##_begin()) \
-    log->print(" " XSTR(name) "_offset='%d'"    , \
-               (intptr_t)name##_begin() - (intptr_t)this)
+  if (p2i(name##_end()) - p2i(name##_begin())) \
+    log->print(" " XSTR(name) "_offset='" INTX_FORMAT "'"    , \
+               p2i(name##_begin()) - p2i(this))
 
 
 void nmethod::log_new_nmethod() const {
@@ -820,8 +818,8 @@
     HandleMark hm;
     xtty->begin_elem("nmethod");
     log_identity(xtty);
-    xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", code_begin(), size());
-    xtty->print(" address='" INTPTR_FORMAT "'", (intptr_t) this);
+    xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", p2i(code_begin()), size());
+    xtty->print(" address='" INTPTR_FORMAT "'", p2i(this));
 
     LOG_OFFSET(xtty, relocation);
     LOG_OFFSET(xtty, consts);
@@ -849,7 +847,7 @@
     ttyLocker ttyl;
     if (WizardMode) {
       CompileTask::print(st, this, msg, /*short_form:*/ true);
-      st->print_cr(" (" INTPTR_FORMAT ")", this);
+      st->print_cr(" (" INTPTR_FORMAT ")", p2i(this));
     } else {
       CompileTask::print(st, this, msg, /*short_form:*/ false);
     }
@@ -1205,7 +1203,7 @@
     tty->print_cr("[Class unloading: Making nmethod " INTPTR_FORMAT
                   " unloadable], Method*(" INTPTR_FORMAT
                   "), cause(" INTPTR_FORMAT ")",
-                  this, (address)_method, (address)cause);
+                  p2i(this), p2i(_method), p2i(cause));
     if (!Universe::heap()->is_gc_active())
       cause->klass()->print();
   }
@@ -1402,7 +1400,8 @@
   }
 
   if (TraceCreateZombies) {
-    tty->print_cr("nmethod <" INTPTR_FORMAT "> code made %s", this, (state == not_entrant) ? "not entrant" : "zombie");
+    tty->print_cr("nmethod <" INTPTR_FORMAT "> code made %s",
+                  p2i(this), (state == not_entrant) ? "not entrant" : "zombie");
   }
 
   NMethodSweeper::report_state_change(this);
@@ -1418,10 +1417,12 @@
   assert_locked_or_safepoint(CodeCache_lock);
 
   // completely deallocate this method
-  Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this);
+  Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, p2i(this));
   if (PrintMethodFlushing) {
-    tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb",
-        _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(this))/1024);
+    tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT
+                  "/Free CodeCache:" SIZE_FORMAT "Kb",
+                  _compile_id, p2i(this), CodeCache::nof_blobs(),
+                  CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(this))/1024);
   }
 
   // We need to deallocate any ExceptionCache data.
@@ -1709,7 +1710,7 @@
     // Clean inline caches pointing to both zombie and not_entrant methods
     if (!nm->is_in_use() || (nm->method()->code() != nm)) {
       ic->set_to_clean();
-      assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", from, from->method()->name_and_sig_as_C_string());
+      assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", p2i(from), from->method()->name_and_sig_as_C_string());
     }
   }
 
@@ -2119,8 +2120,8 @@
     if (_print_nm == NULL)  return;
     if (!_detected_scavenge_root)  _print_nm->print_on(tty, "new scavenge root");
     tty->print_cr("" PTR_FORMAT "[offset=%d] detected scavengable oop " PTR_FORMAT " (found at " PTR_FORMAT ")",
-                  _print_nm, (int)((intptr_t)p - (intptr_t)_print_nm),
-                  (void *)(*p), (intptr_t)p);
+                  p2i(_print_nm), (int)((intptr_t)p - (intptr_t)_print_nm),
+                  p2i(*p), p2i(p));
     (*p)->print();
   }
 #endif //PRODUCT
@@ -2426,7 +2427,7 @@
     ResourceMark rm(thread);
     CodeBlob* cb = CodeCache::find_blob(pc);
     assert(cb != NULL && cb == this, "");
-    tty->print_cr("implicit exception happened at " INTPTR_FORMAT, pc);
+    tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
     print();
     method()->print_codes();
     print_code();
@@ -2519,7 +2520,7 @@
       _ok = false;
     }
     tty->print_cr("*** non-oop " PTR_FORMAT " found at " PTR_FORMAT " (offset %d)",
-                  (void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
+                  p2i(*p), p2i(p), (int)((intptr_t)p - (intptr_t)_nm));
   }
   virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
 };
@@ -2540,7 +2541,7 @@
   ResourceMark rm;
 
   if (!CodeCache::contains(this)) {
-    fatal("nmethod at " INTPTR_FORMAT " not in zone", this);
+    fatal("nmethod at " INTPTR_FORMAT " not in zone", p2i(this));
   }
 
   if(is_native_method() )
@@ -2548,12 +2549,12 @@
 
   nmethod* nm = CodeCache::find_nmethod(verified_entry_point());
   if (nm != this) {
-    fatal("findNMethod did not find this nmethod (" INTPTR_FORMAT ")", this);
+    fatal("findNMethod did not find this nmethod (" INTPTR_FORMAT ")", p2i(this));
   }
 
   for (PcDesc* p = scopes_pcs_begin(); p < scopes_pcs_end(); p++) {
     if (! p->verify(this)) {
-      tty->print_cr("\t\tin nmethod at " INTPTR_FORMAT " (pcs)", this);
+      tty->print_cr("\t\tin nmethod at " INTPTR_FORMAT " (pcs)", p2i(this));
     }
   }
 
@@ -2642,7 +2643,7 @@
       _ok = false;
     }
     tty->print_cr("*** scavengable oop " PTR_FORMAT " found at " PTR_FORMAT " (offset %d)",
-                  (void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm));
+                  p2i(*p), p2i(p), (int)((intptr_t)p - (intptr_t)_nm));
     (*p)->print();
   }
   virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
@@ -2686,8 +2687,8 @@
   print_on(tty, NULL);
 
   if (WizardMode) {
-    tty->print("((nmethod*) " INTPTR_FORMAT ") ", this);
-    tty->print(" for method " INTPTR_FORMAT , (address)method());
+    tty->print("((nmethod*) " INTPTR_FORMAT ") ", p2i(this));
+    tty->print(" for method " INTPTR_FORMAT , p2i(method()));
     tty->print(" { ");
     if (is_in_use())      tty->print("in_use ");
     if (is_not_entrant()) tty->print("not_entrant ");
@@ -2697,52 +2698,52 @@
     tty->print_cr("}:");
   }
   if (size              () > 0) tty->print_cr(" total in heap  [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              (address)this,
-                                              (address)this + size(),
+                                              p2i(this),
+                                              p2i(this) + size(),
                                               size());
   if (relocation_size   () > 0) tty->print_cr(" relocation     [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              relocation_begin(),
-                                              relocation_end(),
+                                              p2i(relocation_begin()),
+                                              p2i(relocation_end()),
                                               relocation_size());
   if (consts_size       () > 0) tty->print_cr(" constants      [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              consts_begin(),
-                                              consts_end(),
+                                              p2i(consts_begin()),
+                                              p2i(consts_end()),
                                               consts_size());
   if (insts_size        () > 0) tty->print_cr(" main code      [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              insts_begin(),
-                                              insts_end(),
+                                              p2i(insts_begin()),
+                                              p2i(insts_end()),
                                               insts_size());
   if (stub_size         () > 0) tty->print_cr(" stub code      [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              stub_begin(),
-                                              stub_end(),
+                                              p2i(stub_begin()),
+                                              p2i(stub_end()),
                                               stub_size());
   if (oops_size         () > 0) tty->print_cr(" oops           [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              oops_begin(),
-                                              oops_end(),
+                                              p2i(oops_begin()),
+                                              p2i(oops_end()),
                                               oops_size());
   if (metadata_size      () > 0) tty->print_cr(" metadata       [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              metadata_begin(),
-                                              metadata_end(),
+                                              p2i(metadata_begin()),
+                                              p2i(metadata_end()),
                                               metadata_size());
   if (scopes_data_size  () > 0) tty->print_cr(" scopes data    [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              scopes_data_begin(),
-                                              scopes_data_end(),
+                                              p2i(scopes_data_begin()),
+                                              p2i(scopes_data_end()),
                                               scopes_data_size());
   if (scopes_pcs_size   () > 0) tty->print_cr(" scopes pcs     [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              scopes_pcs_begin(),
-                                              scopes_pcs_end(),
+                                              p2i(scopes_pcs_begin()),
+                                              p2i(scopes_pcs_end()),
                                               scopes_pcs_size());
   if (dependencies_size () > 0) tty->print_cr(" dependencies   [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              dependencies_begin(),
-                                              dependencies_end(),
+                                              p2i(dependencies_begin()),
+                                              p2i(dependencies_end()),
                                               dependencies_size());
   if (handler_table_size() > 0) tty->print_cr(" handler table  [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              handler_table_begin(),
-                                              handler_table_end(),
+                                              p2i(handler_table_begin()),
+                                              p2i(handler_table_end()),
                                               handler_table_size());
   if (nul_chk_table_size() > 0) tty->print_cr(" nul chk table  [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
-                                              nul_chk_table_begin(),
-                                              nul_chk_table_end(),
+                                              p2i(nul_chk_table_begin()),
+                                              p2i(nul_chk_table_end()),
                                               nul_chk_table_size());
 }
 
@@ -2793,20 +2794,20 @@
     jint* index_end   = (jint*)relocation_end() - 1;
     jint  index_size  = *index_end;
     jint* index_start = (jint*)( (address)index_end - index_size );
-    tty->print_cr("    index @" INTPTR_FORMAT ": index_size=%d", index_start, index_size);
+    tty->print_cr("    index @" INTPTR_FORMAT ": index_size=%d", p2i(index_start), index_size);
     if (index_size > 0) {
       jint* ip;
       for (ip = index_start; ip+2 <= index_end; ip += 2)
         tty->print_cr("  (%d %d) addr=" INTPTR_FORMAT " @" INTPTR_FORMAT,
                       ip[0],
                       ip[1],
-                      header_end()+ip[0],
-                      relocation_begin()-1+ip[1]);
+                      p2i(header_end()+ip[0]),
+                      p2i(relocation_begin()-1+ip[1]));
       for (; ip < index_end; ip++)
         tty->print_cr("  (%d ?)", ip[0]);
-      tty->print_cr("          @" INTPTR_FORMAT ": index_size=%d", ip, *ip);
+      tty->print_cr("          @" INTPTR_FORMAT ": index_size=%d", p2i(ip), *ip);
       ip++;
-      tty->print_cr("reloc_end @" INTPTR_FORMAT ":", ip);
+      tty->print_cr("reloc_end @" INTPTR_FORMAT ":", p2i(ip));
     }
   }
 }
@@ -3088,7 +3089,7 @@
   int cont_offset = ImplicitExceptionTable(this).at(begin - code_begin());
   if (cont_offset != 0) {
     st->move_to(column);
-    st->print("; implicit exception: dispatches to " INTPTR_FORMAT, code_begin() + cont_offset);
+    st->print("; implicit exception: dispatches to " INTPTR_FORMAT, p2i(code_begin() + cont_offset));
   }
 
 }
@@ -3111,7 +3112,7 @@
       break;
     }
     case relocInfo::static_call_type:
-      st->print_cr("Static call at " INTPTR_FORMAT, iter.reloc()->addr());
+      st->print_cr("Static call at " INTPTR_FORMAT, p2i(iter.reloc()->addr()));
       compiledStaticCall_at(iter.reloc())->print();
       break;
     }
--- a/hotspot/src/share/vm/code/pcDesc.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/pcDesc.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -29,8 +29,6 @@
 #include "code/scopeDesc.hpp"
 #include "memory/resourceArea.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
   _pc_offset           = pc_offset;
   _scope_decode_offset = scope_decode_offset;
@@ -45,7 +43,7 @@
 void PcDesc::print(nmethod* code) {
 #ifndef PRODUCT
   ResourceMark rm;
-  tty->print_cr("PcDesc(pc=0x%lx offset=%x bits=%x):", real_pc(code), pc_offset(), _flags);
+  tty->print_cr("PcDesc(pc=" PTR_FORMAT " offset=%x bits=%x):", p2i(real_pc(code)), pc_offset(), _flags);
 
   if (scope_decode_offset() == DebugInformationRecorder::serialized_null) {
     return;
--- a/hotspot/src/share/vm/code/relocInfo.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/relocInfo.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 #include "runtime/stubCodeGenerator.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
 
 
@@ -447,7 +445,7 @@
     // Known "miscellaneous" non-stub pointers:
     // os::get_polling_page(), SafepointSynchronize::address_of_state()
     if (PrintRelocations) {
-      tty->print_cr("random unregistered address in relocInfo: " INTPTR_FORMAT, runtime_address);
+      tty->print_cr("random unregistered address in relocInfo: " INTPTR_FORMAT, p2i(runtime_address));
     }
 #ifndef _LP64
     return (int32_t) (intptr_t)runtime_address;
@@ -925,7 +923,7 @@
     return;
   }
   tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT " offset=%d",
-             _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr, _current->addr_offset());
+             p2i(_current), type(), reloc_type_string((relocInfo::relocType) type()), p2i(_addr), _current->addr_offset());
   if (current()->format() != 0)
     tty->print(" format=%d", current()->format());
   if (datalen() == 1) {
@@ -951,11 +949,11 @@
         oop_value = r->oop_value();
       }
       tty->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
-                 oop_addr, (address)raw_oop, r->offset());
+                 p2i(oop_addr), p2i(raw_oop), r->offset());
       // Do not print the oop by default--we want this routine to
       // work even during GC or other inconvenient times.
       if (WizardMode && oop_value != NULL) {
-        tty->print("oop_value=" INTPTR_FORMAT ": ", (address)oop_value);
+        tty->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
         oop_value->print_value_on(tty);
       }
       break;
@@ -972,9 +970,9 @@
         metadata_value = r->metadata_value();
       }
       tty->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
-                 metadata_addr, (address)raw_metadata, r->offset());
+                 p2i(metadata_addr), p2i(raw_metadata), r->offset());
       if (metadata_value != NULL) {
-        tty->print("metadata_value=" INTPTR_FORMAT ": ", (address)metadata_value);
+        tty->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
         metadata_value->print_value_on(tty);
       }
       break;
@@ -984,33 +982,33 @@
   case relocInfo::section_word_type:
     {
       DataRelocation* r = (DataRelocation*) reloc();
-      tty->print(" | [target=" INTPTR_FORMAT "]", r->value()); //value==target
+      tty->print(" | [target=" INTPTR_FORMAT "]", p2i(r->value())); //value==target
       break;
     }
   case relocInfo::static_call_type:
   case relocInfo::runtime_call_type:
     {
       CallRelocation* r = (CallRelocation*) reloc();
-      tty->print(" | [destination=" INTPTR_FORMAT "]", r->destination());
+      tty->print(" | [destination=" INTPTR_FORMAT "]", p2i(r->destination()));
       break;
     }
   case relocInfo::virtual_call_type:
     {
       virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
       tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT "]",
-                 r->destination(), r->cached_value());
+                 p2i(r->destination()), p2i(r->cached_value()));
       break;
     }
   case relocInfo::static_stub_type:
     {
       static_stub_Relocation* r = (static_stub_Relocation*) reloc();
-      tty->print(" | [static_call=" INTPTR_FORMAT "]", r->static_call());
+      tty->print(" | [static_call=" INTPTR_FORMAT "]", p2i(r->static_call()));
       break;
     }
   case relocInfo::trampoline_stub_type:
     {
       trampoline_stub_Relocation* r = (trampoline_stub_Relocation*) reloc();
-      tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", r->owner());
+      tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", p2i(r->owner()));
       break;
     }
   }
@@ -1029,7 +1027,7 @@
     got_next = (skip_next || next());
     skip_next = false;
 
-    tty->print("         @" INTPTR_FORMAT ": ", scan);
+    tty->print("         @" INTPTR_FORMAT ": ", p2i(scan));
     relocInfo* newscan = _current+1;
     if (!has_current())  newscan -= 1;  // nothing to scan here!
     while (scan < newscan) {
--- a/hotspot/src/share/vm/code/scopeDesc.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/scopeDesc.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -30,8 +30,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
   _code          = code;
   _decode_offset = decode_offset;
@@ -178,13 +176,13 @@
 void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
   // header
   if (pd != NULL) {
-    st->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset());
+    st->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", p2i(pd->real_pc(_code)), pd->pc_offset());
   }
 
   print_value_on(st);
   // decode offsets
   if (WizardMode) {
-    st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->content_begin());
+    st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, p2i(_code->content_begin()));
     st->print_cr(" offset:     %d",    _decode_offset);
     st->print_cr(" bci:        %d",    bci());
     st->print_cr(" reexecute:  %s",    should_reexecute() ? "true" : "false");
--- a/hotspot/src/share/vm/code/vtableStubs.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/code/vtableStubs.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -40,8 +40,6 @@
 #include "opto/matcher.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // -----------------------------------------------------------------------------------------
 // Implementation of VtableStub
 
@@ -79,8 +77,8 @@
 
 
 void VtableStub::print_on(outputStream* st) const {
-  st->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
-             index(), receiver_location(), code_begin(), code_end());
+  st->print("vtable stub (index = %d, receiver_location = " INTX_FORMAT ", code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
+             index(), p2i(receiver_location()), p2i(code_begin()), p2i(code_end()));
 }
 
 
@@ -126,8 +124,8 @@
 
     enter(is_vtable_stub, vtable_index, s);
     if (PrintAdapterHandlers) {
-      tty->print_cr("Decoding VtableStub %s[%d]@%d",
-                    is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location());
+      tty->print_cr("Decoding VtableStub %s[%d]@" INTX_FORMAT,
+                    is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location()));
       Disassembler::decode(s->code_begin(), s->code_end());
     }
     // Notify JVMTI about this stub. The event will be recorded by the enclosing
@@ -224,7 +222,7 @@
   ik->print();
   fatal("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", "
         "index %d (vtable length %d)",
-        (address)receiver, index, vt->length());
+        p2i(receiver), index, vt->length());
 }
 
 #endif // PRODUCT
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -56,8 +56,6 @@
 #include "shark/sharkEntry.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void*       Disassembler::_library               = NULL;
 bool        Disassembler::_tried_to_load_library = false;
 
@@ -330,16 +328,19 @@
   if (Universe::is_fully_initialized()) {
     if (StubRoutines::contains(adr)) {
       StubCodeDesc* desc = StubCodeDesc::desc_for(adr);
-      if (desc == NULL)
+      if (desc == NULL) {
         desc = StubCodeDesc::desc_for(adr + frame::pc_return_offset);
+      }
       if (desc != NULL) {
         st->print("Stub::%s", desc->name());
-        if (desc->begin() != adr)
-          st->print("%+d 0x%p",adr - desc->begin(), adr);
-        else if (WizardMode) st->print(" " PTR_FORMAT, adr);
+        if (desc->begin() != adr) {
+          st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));
+        } else if (WizardMode) {
+          st->print(" " PTR_FORMAT, p2i(adr));
+        }
         return;
       }
-      st->print("Stub::<unknown> " PTR_FORMAT, adr);
+      st->print("Stub::<unknown> " PTR_FORMAT, p2i(adr));
       return;
     }
 
@@ -347,13 +348,13 @@
     if (bs->is_a(BarrierSet::CardTableModRef) &&
         adr == (address)(barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base)) {
       st->print("word_map_base");
-      if (WizardMode) st->print(" " INTPTR_FORMAT, (intptr_t)adr);
+      if (WizardMode) st->print(" " INTPTR_FORMAT, p2i(adr));
       return;
     }
   }
 
   // Fall through to a simple (hexadecimal) numeral.
-  st->print(PTR_FORMAT, adr);
+  st->print(PTR_FORMAT, p2i(adr));
 }
 
 void decode_env::print_insn_labels() {
@@ -365,7 +366,7 @@
   }
   _strings.print_block_comment(st, (intptr_t)(p - _start));
   if (_print_pc) {
-    st->print("  " PTR_FORMAT ": ", p);
+    st->print("  " PTR_FORMAT ": ", p2i(p));
   }
 }
 
@@ -386,13 +387,16 @@
     address pc1 = pc + perline;
     if (pc1 > pc_limit)  pc1 = pc_limit;
     for (; pc < pc1; pc += incr) {
-      if (pc == pc0)
+      if (pc == pc0) {
         st->print(BYTES_COMMENT);
-      else if ((uint)(pc - pc0) % sizeof(int) == 0)
+      } else if ((uint)(pc - pc0) % sizeof(int) == 0) {
         st->print(" ");         // put out a space on word boundaries
-      if (incr == sizeof(int))
-            st->print("%08lx", *(int*)pc);
-      else  st->print("%02x",   (*pc)&0xFF);
+      }
+      if (incr == sizeof(int)) {
+        st->print("%08x", *(int*)pc);
+      } else {
+        st->print("%02x", (*pc)&0xFF);
+      }
     }
     st->cr();
   }
@@ -488,7 +492,7 @@
 void Disassembler::decode(CodeBlob* cb, outputStream* st) {
   if (!load_library())  return;
   decode_env env(cb, st);
-  env.output()->print_cr("Decoding CodeBlob " PTR_FORMAT, cb);
+  env.output()->print_cr("Decoding CodeBlob " PTR_FORMAT, p2i(cb));
   env.decode_instructions(cb->code_begin(), cb->code_end());
 }
 
@@ -501,7 +505,7 @@
 void Disassembler::decode(nmethod* nm, outputStream* st) {
   if (!load_library())  return;
   decode_env env(nm, st);
-  env.output()->print_cr("Decoding compiled method " PTR_FORMAT ":", nm);
+  env.output()->print_cr("Decoding compiled method " PTR_FORMAT ":", p2i(nm));
   env.output()->print_cr("Code:");
 
 #ifdef SHARK
@@ -533,9 +537,9 @@
     int offset = 0;
     for (address p = nm->consts_begin(); p < nm->consts_end(); p += 4, offset += 4) {
       if ((offset % 8) == 0) {
-        env.output()->print_cr("  " PTR_FORMAT " (offset: %4d): " PTR32_FORMAT "   " PTR64_FORMAT, p, offset, *((int32_t*) p), *((int64_t*) p));
+        env.output()->print_cr("  " PTR_FORMAT " (offset: %4d): " PTR32_FORMAT "   " PTR64_FORMAT, p2i(p), offset, *((int32_t*) p), *((int64_t*) p));
       } else {
-        env.output()->print_cr("  " PTR_FORMAT " (offset: %4d): " PTR32_FORMAT,                    p, offset, *((int32_t*) p));
+        env.output()->print_cr("  " PTR_FORMAT " (offset: %4d): " PTR32_FORMAT,                    p2i(p), offset, *((int32_t*) p));
       }
     }
   }
--- a/hotspot/src/share/vm/compiler/methodLiveness.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/compiler/methodLiveness.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -32,8 +32,6 @@
 #include "memory/allocation.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // The MethodLiveness class performs a simple liveness analysis on a method
 // in order to decide which locals are live (that is, will be used again) at
 // a particular bytecode index (bci).
@@ -540,7 +538,7 @@
                  _time_flow.seconds() * 100 / _time_total.seconds());
   tty->print_cr ("    Query       : %3.3f sec. (%2.2f%%)", _time_query.seconds(),
                  _time_query.seconds() * 100 / _time_total.seconds());
-  tty->print_cr ("  #bytes   : %8d (%3.0f bytes per sec)",
+  tty->print_cr ("  #bytes   : %8ld (%3.0f bytes per sec)",
                  _total_bytes,
                  _total_bytes / _time_total.seconds());
   tty->print_cr ("  #methods : %8d (%3.0f methods per sec)",
@@ -554,7 +552,7 @@
                  _max_method_blocks);
   tty->print_cr ("    avg bytes  : %3.3f",
                  (float)_total_bytes / _total_methods);
-  tty->print_cr ("  #blocks  : %8d",
+  tty->print_cr ("  #blocks  : %8ld",
                  _total_blocks);
   tty->print_cr ("    avg normal predecessors    : %3.3f  max normal predecessors    : %3d",
                  (float)_total_edges / _total_blocks,
@@ -564,7 +562,7 @@
                  _max_block_exc_edges);
   tty->print_cr ("    avg visits                 : %3.3f",
                  (float)_total_visits / _total_blocks);
-  tty->print_cr ("  #locals queried : %8d    #live : %8d   %%live : %2.2f%%",
+  tty->print_cr ("  #locals queried : %8ld    #live : %8ld   %%live : %2.2f%%",
                  _total_locals_queried,
                  _total_live_locals_queried,
                  100.0 * _total_live_locals_queried / _total_locals_queried);
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -66,8 +66,6 @@
 #include "opto/runtime.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 class UnlockFlagSaver {
   private:
     JavaThread* _thread;
@@ -444,14 +442,14 @@
       if (message != NULL) {
         tty->print_cr("Exception <%s: %s> (" INTPTR_FORMAT ")",
                       h_exception->print_value_string(), message->as_C_string(),
-                      (address)h_exception());
+                      p2i(h_exception()));
       } else {
         tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")",
                       h_exception->print_value_string(),
-                      (address)h_exception());
+                      p2i(h_exception()));
       }
       tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string());
-      tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, thread);
+      tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, p2i(thread));
     }
 // Don't go paging in something which won't be used.
 //     else if (extable->length() == 0) {
@@ -885,7 +883,7 @@
 #ifndef PRODUCT
   if (TraceOnStackReplacement) {
     if (nm != NULL) {
-      tty->print("OSR entry @ pc: " INTPTR_FORMAT ": ", nm->osr_entry());
+      tty->print("OSR entry @ pc: " INTPTR_FORMAT ": ", p2i(nm->osr_entry()));
       nm->print();
     }
   }
@@ -1305,7 +1303,7 @@
       tty->cr();
       tty->print_cr("argument handler #%d at " PTR_FORMAT " for fingerprint " UINT64_FORMAT,
                     _handlers->length(),
-                    handler,
+                    p2i(handler),
                     fingerprint);
     }
     _fingerprints->append(fingerprint);
@@ -1316,8 +1314,8 @@
       tty->print_cr("duplicate argument handler #%d for fingerprint " UINT64_FORMAT "(old: " PTR_FORMAT ", new : " PTR_FORMAT ")",
                     _handlers->length(),
                     fingerprint,
-                    _handlers->at(handler_index),
-                    handler);
+                    p2i(_handlers->at(handler_index)),
+                    p2i(handler));
     }
   }
 }
--- a/hotspot/src/share/vm/interpreter/oopMapCache.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/signature.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 class OopMapCacheEntry: private InterpreterOopMap {
   friend class InterpreterOopMap;
   friend class OopMapForCacheEntry;
--- a/hotspot/src/share/vm/libadt/dict.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/libadt/dict.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 
 #include <assert.h>
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 //------------------------------data-----------------------------------------
 // String hash tables
 #define MAXID 20
@@ -288,9 +286,9 @@
 // Handier print routine
 void Dict::print() {
   DictI i(this); // Moved definition in iterator here because of g++.
-  tty->print("Dict@0x%lx[%d] = {", this, _cnt);
+  tty->print("Dict@" INTPTR_FORMAT "[%d] = {", p2i(this), _cnt);
   for( ; i.test(); ++i ) {
-    tty->print("(0x%lx,0x%lx),", i._key, i._value);
+    tty->print("(" INTPTR_FORMAT "," INTPTR_FORMAT "),", p2i(i._key), p2i(i._value));
   }
   tty->print_cr("}");
 }
--- a/hotspot/src/share/vm/memory/filemap.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -50,7 +50,6 @@
 #define O_BINARY 0     // otherwise do nothing.
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 extern address JVM_FunctionAtStart();
 extern address JVM_FunctionAtEnd();
 
@@ -443,8 +442,8 @@
   if (_file_open) {
     guarantee(si->_file_offset == _file_offset, "file offset mismatch.");
     if (PrintSharedSpaces) {
-      tty->print_cr("Shared file region %d: 0x%6x bytes, addr " INTPTR_FORMAT
-                    " file offset 0x%6x", region, size, base, _file_offset);
+      tty->print_cr("Shared file region %d: " SIZE_FORMAT_HEX_W(6) " bytes, addr " INTPTR_FORMAT
+                    " file offset " SIZE_FORMAT_HEX_W(6), region, size, p2i(base), _file_offset);
     }
   } else {
     si->_file_offset = _file_offset;
@@ -602,7 +601,8 @@
   // other reserved memory (like the code cache).
   ReservedSpace rs(size, os::vm_allocation_granularity(), false, requested_addr);
   if (!rs.is_reserved()) {
-    fail_continue("Unable to reserve shared space at required address " INTPTR_FORMAT, requested_addr);
+    fail_continue("Unable to reserve shared space at required address "
+                  INTPTR_FORMAT, p2i(requested_addr));
     return rs;
   }
   // the reserved virtual memory is for mapping class data sharing archive
@@ -659,7 +659,7 @@
         tty->print_cr("Shared string data from the CDS archive is being ignored. "
                      "The current CompressedOops/CompressedClassPointers encoding differs from "
                      "that archived due to heap size change. The archive was dumped using max heap "
-                     "size %dM.", max_heap_size()/M);
+                     "size " UINTX_FORMAT "M.", max_heap_size()/M);
       }
     } else {
       string_ranges = new MemRegion[MetaspaceShared::max_strings];
@@ -896,7 +896,7 @@
   }
   if (_obj_alignment != ObjectAlignmentInBytes) {
     FileMapInfo::fail_continue("The shared archive file's ObjectAlignmentInBytes of %d"
-                  " does not equal the current ObjectAlignmentInBytes of %d.",
+                  " does not equal the current ObjectAlignmentInBytes of " INTX_FORMAT ".",
                   _obj_alignment, ObjectAlignmentInBytes);
     return false;
   }
@@ -951,7 +951,7 @@
     char *base = _header->region_addr(i);
     gclog_or_tty->print("  %s " INTPTR_FORMAT "-" INTPTR_FORMAT,
                         shared_region_name[i],
-                        base, base + si->_used);
+                        p2i(base), p2i(base + si->_used));
   }
 }
 
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -44,8 +44,6 @@
 #include "runtime/vm_operations.hpp"
 #include "utilities/hashtable.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 int MetaspaceShared::_max_alignment = 0;
 
 ReservedSpace* MetaspaceShared::_shared_rs = NULL;
@@ -578,7 +576,7 @@
 
   // Print shared spaces all the time
 // To make fmt_space be a syntactic constant (for format warnings), use #define.
-#define fmt_space "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " INTPTR_FORMAT
+#define fmt_space "%s space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [%4.1f%% used] at " INTPTR_FORMAT
   Metaspace* ro_space = _loader_data->ro_metaspace();
   Metaspace* rw_space = _loader_data->rw_metaspace();
 
@@ -611,12 +609,12 @@
   const double mc_u_perc = mc_bytes / double(mc_alloced) * 100.0;
   const double total_u_perc = total_bytes / double(total_alloced) * 100.0;
 
-  tty->print_cr(fmt_space, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom());
-  tty->print_cr(fmt_space, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom());
-  tty->print_cr(fmt_space, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low);
-  tty->print_cr(fmt_space, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low);
-  tty->print_cr(fmt_space, "st", ss_bytes, ss_t_perc, ss_bytes, 100.0, ss_low);
-  tty->print_cr("total   : %9d [100.0%% of total] out of %9d bytes [%4.1f%% used]",
+  tty->print_cr(fmt_space, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, p2i(ro_space->bottom()));
+  tty->print_cr(fmt_space, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, p2i(rw_space->bottom()));
+  tty->print_cr(fmt_space, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, p2i(md_low));
+  tty->print_cr(fmt_space, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, p2i(mc_low));
+  tty->print_cr(fmt_space, "st", ss_bytes, ss_t_perc, ss_bytes,   100.0,     p2i(ss_low));
+  tty->print_cr("total   : " SIZE_FORMAT_W(9) " [100.0%% of total] out of " SIZE_FORMAT_W(9) " bytes [%4.1f%% used]",
                  total_bytes, total_alloced, total_u_perc);
 
   // Update the vtable pointers in all of the Klass objects in the
@@ -738,9 +736,9 @@
   TraceTime timer("Dump Shared Spaces", TraceStartupTime);
   ResourceMark rm;
 
-  tty->print_cr("Allocated shared space: %d bytes at " PTR_FORMAT,
+  tty->print_cr("Allocated shared space: " SIZE_FORMAT " bytes at " PTR_FORMAT,
                 MetaspaceShared::shared_rs()->size(),
-                MetaspaceShared::shared_rs()->base());
+                p2i(MetaspaceShared::shared_rs()->base()));
 
   // Preload classes to be shared.
   // Should use some os:: method rather than fopen() here. aB.
--- a/hotspot/src/share/vm/memory/virtualspace.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/memory/virtualspace.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -29,8 +29,6 @@
 #include "oops/oop.inline.hpp"
 #include "services/memTracker.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // ReservedSpace
 
 // Dummy constructor
@@ -82,7 +80,7 @@
     assert(UseCompressedOops, "currently requested address used only for compressed oops");
     if (PrintCompressedOopsMode) {
       tty->cr();
-      tty->print_cr("Reserved memory not at requested address: " PTR_FORMAT " vs " PTR_FORMAT, base, requested_address);
+      tty->print_cr("Reserved memory not at requested address: " PTR_FORMAT " vs " PTR_FORMAT, p2i(base), p2i(requested_address));
     }
     // OS ignored requested address. Try different address.
     if (special) {
@@ -138,8 +136,8 @@
       // Check alignment constraints.
       assert((uintptr_t) base % alignment == 0,
              "Large pages returned a non-aligned address, base: "
-             PTR_FORMAT " alignment: " PTR_FORMAT,
-             base, (void*)(uintptr_t)alignment);
+             PTR_FORMAT " alignment: " SIZE_FORMAT_HEX,
+             p2i(base), alignment);
       _special = true;
     } else {
       // failed; try to reserve regular memory below
@@ -291,7 +289,7 @@
       if (PrintCompressedOopsMode) {
         tty->cr();
         tty->print_cr("Protected page at the reserved heap base: "
-                      PTR_FORMAT " / " INTX_FORMAT " bytes", _base, _noaccess_prefix);
+                      PTR_FORMAT " / " INTX_FORMAT " bytes", p2i(_base), _noaccess_prefix);
       }
       assert(Universe::narrow_oop_use_implicit_null_checks() == true, "not initialized?");
     } else {
@@ -324,8 +322,8 @@
   char* base = NULL;
 
   if (PrintCompressedOopsMode && Verbose) {
-    tty->print("Trying to allocate at address " PTR_FORMAT " heap of size " PTR_FORMAT ".\n",
-               requested_address, (address)size);
+    tty->print("Trying to allocate at address " PTR_FORMAT " heap of size " SIZE_FORMAT_HEX ".\n",
+               p2i(requested_address), size);
   }
 
   if (special) {
@@ -335,8 +333,8 @@
       // Check alignment constraints.
       assert((uintptr_t) base % alignment == 0,
              "Large pages returned a non-aligned address, base: "
-             PTR_FORMAT " alignment: " PTR_FORMAT,
-             base, (void*)(uintptr_t)alignment);
+             PTR_FORMAT " alignment: " SIZE_FORMAT_HEX,
+             p2i(base), alignment);
       _special = true;
     }
   }
@@ -561,7 +559,7 @@
     // Last, desperate try without any placement.
     if (_base == NULL) {
       if (PrintCompressedOopsMode && Verbose) {
-        tty->print("Trying to allocate at address NULL heap of size " PTR_FORMAT ".\n", (address)size + noaccess_prefix);
+        tty->print("Trying to allocate at address NULL heap of size " SIZE_FORMAT_HEX ".\n", size + noaccess_prefix);
       }
       initialize(size + noaccess_prefix, alignment, large, NULL, false);
     }
@@ -853,7 +851,7 @@
     if (!os::commit_memory(lower_high(), lower_needs, _executable)) {
       debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
                          ", lower_needs=" SIZE_FORMAT ", %d) failed",
-                         lower_high(), lower_needs, _executable);)
+                         p2i(lower_high()), lower_needs, _executable);)
       return false;
     } else {
       _lower_high += lower_needs;
@@ -867,7 +865,7 @@
                            _executable)) {
       debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
                          ", middle_needs=" SIZE_FORMAT ", " SIZE_FORMAT
-                         ", %d) failed", middle_high(), middle_needs,
+                         ", %d) failed", p2i(middle_high()), middle_needs,
                          middle_alignment(), _executable);)
       return false;
     }
@@ -880,7 +878,7 @@
     if (!os::commit_memory(upper_high(), upper_needs, _executable)) {
       debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
                          ", upper_needs=" SIZE_FORMAT ", %d) failed",
-                         upper_high(), upper_needs, _executable);)
+                         p2i(upper_high()), upper_needs, _executable);)
       return false;
     } else {
       _upper_high += upper_needs;
@@ -1017,8 +1015,8 @@
   out->cr();
   out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
   out->print_cr(" - reserved:  " SIZE_FORMAT, reserved_size());
-  out->print_cr(" - [low, high]:     [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low(), high());
-  out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low_boundary(), high_boundary());
+  out->print_cr(" - [low, high]:     [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  p2i(low()), p2i(high()));
+  out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  p2i(low_boundary()), p2i(high_boundary()));
 }
 
 void VirtualSpace::print() {
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -45,8 +45,6 @@
 #include "runtime/vframe.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
   // Tags are RW but comment below applies to tags also.
   Array<u1>* tags = MetadataFactory::new_writeable_array<u1>(loader_data, length, 0, CHECK_NULL);
@@ -1868,11 +1866,11 @@
     st->cr();
   }
   if (pool_holder() != NULL) {
-    st->print_cr(" - holder: " INTPTR_FORMAT, pool_holder());
+    st->print_cr(" - holder: " INTPTR_FORMAT, p2i(pool_holder()));
   }
-  st->print_cr(" - cache: " INTPTR_FORMAT, cache());
-  st->print_cr(" - resolved_references: " INTPTR_FORMAT, (void *)resolved_references());
-  st->print_cr(" - reference_map: " INTPTR_FORMAT, reference_map());
+  st->print_cr(" - cache: " INTPTR_FORMAT, p2i(cache()));
+  st->print_cr(" - resolved_references: " INTPTR_FORMAT, p2i(resolved_references()));
+  st->print_cr(" - reference_map: " INTPTR_FORMAT, p2i(reference_map()));
 
   for (int index = 1; index < length(); index++) {      // Index 0 is unused
     ((ConstantPool*)this)->print_entry_on(index, st);
@@ -1897,7 +1895,7 @@
       { Klass* k = klass_at(index, CATCH);
         guarantee(k != NULL, "need klass");
         k->print_value_on(st);
-        st->print(" {0x%lx}", (address)k);
+        st->print(" {" PTR_FORMAT "}", p2i(k));
       }
       break;
     case JVM_CONSTANT_Fieldref :
@@ -1910,7 +1908,7 @@
       if (is_pseudo_string_at(index)) {
         oop anObj = pseudo_string_at(index);
         anObj->print_value_on(st);
-        st->print(" {0x%lx}", (address)anObj);
+        st->print(" {" PTR_FORMAT "}", p2i(anObj));
       } else {
         unresolved_string_at(index)->print_value_on(st);
       }
@@ -1987,7 +1985,7 @@
     if (extra)  st->print(" (extra)");
   }
   if (cache() != NULL) {
-    st->print(" cache=" PTR_FORMAT, cache());
+    st->print(" cache=" PTR_FORMAT, p2i(cache()));
   }
 }
 
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -36,8 +36,6 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/macros.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Implementation of ConstantPoolCacheEntry
 
 void ConstantPoolCacheEntry::initialize_entry(int index) {
@@ -310,9 +308,9 @@
   if (TraceInvokeDynamic) {
     tty->print_cr("set_method_handle bc=%d appendix=" PTR_FORMAT "%s method_type=" PTR_FORMAT "%s method=" PTR_FORMAT " ",
                   invoke_code,
-                  (void *)appendix(),    (has_appendix    ? "" : " (unused)"),
-                  (void *)method_type(), (has_method_type ? "" : " (unused)"),
-                  (intptr_t)adapter());
+                  p2i(appendix()),    (has_appendix    ? "" : " (unused)"),
+                  p2i(method_type()), (has_method_type ? "" : " (unused)"),
+                  p2i(adapter()));
     adapter->print();
     if (has_appendix)  appendix()->print();
   }
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -66,8 +66,6 @@
 #include "c1/c1_Compiler.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef DTRACE_ENABLED
 
 
@@ -1028,7 +1026,7 @@
   if (TraceFinalizerRegistration) {
     tty->print("Registered ");
     i->print_value_on(tty);
-    tty->print_cr(" (" INTPTR_FORMAT ") as finalizable", (address)i);
+    tty->print_cr(" (" INTPTR_FORMAT ") as finalizable", p2i(i));
   }
   instanceHandle h_i(THREAD, i);
   // Pass the handle as argument, JavaCalls::call expects oop as jobjects
@@ -1131,7 +1129,7 @@
   if (TraceClassInitialization) {
     tty->print("%d Initializing ", call_class_initializer_impl_counter++);
     this_k->name()->print_value();
-    tty->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", (address)this_k());
+    tty->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i(this_k()));
   }
   if (h_method() != NULL) {
     JavaCallArguments args; // No arguments
@@ -2797,7 +2795,7 @@
       st->print("   ");
     }
   }
-  if (n >= MaxSubklassPrintSize) st->print("(%d more klasses...)", n - MaxSubklassPrintSize);
+  if (n >= MaxSubklassPrintSize) st->print("(" INTX_FORMAT " more klasses...)", n - MaxSubklassPrintSize);
   st->cr();
 
   if (is_interface()) {
@@ -2873,9 +2871,9 @@
   }
   st->print(BULLET"inner classes:     "); inner_classes()->print_value_on(st);     st->cr();
   st->print(BULLET"java mirror:       "); java_mirror()->print_value_on(st);       st->cr();
-  st->print(BULLET"vtable length      %d  (start addr: " INTPTR_FORMAT ")", vtable_length(), start_of_vtable());  st->cr();
+  st->print(BULLET"vtable length      %d  (start addr: " INTPTR_FORMAT ")", vtable_length(), p2i(start_of_vtable())); st->cr();
   if (vtable_length() > 0 && (Verbose || WizardMode))  print_vtable(start_of_vtable(), vtable_length(), st);
-  st->print(BULLET"itable length      %d (start addr: " INTPTR_FORMAT ")", itable_length(), start_of_itable()); st->cr();
+  st->print(BULLET"itable length      %d (start addr: " INTPTR_FORMAT ")", itable_length(), p2i(start_of_itable())); st->cr();
   if (itable_length() > 0 && (Verbose || WizardMode))  print_vtable(start_of_itable(), itable_length(), st);
   st->print_cr(BULLET"---- static fields (%d words):", static_field_size());
   FieldPrinter print_static_field(st);
@@ -3068,7 +3066,7 @@
   template <class T> void do_oop_work(T* p) {
     oop obj = oopDesc::load_decode_heap_oop(p);
     if (!obj->is_oop_or_null()) {
-      tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p, (address)obj);
+      tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i(obj));
       Universe::print();
       guarantee(false, "boom");
     }
@@ -3110,7 +3108,7 @@
   Klass* sib = next_sibling();
   if (sib != NULL) {
     if (sib == this) {
-      fatal("subclass points to itself " PTR_FORMAT, sib);
+      fatal("subclass points to itself " PTR_FORMAT, p2i(sib));
     }
 
     guarantee(sib->is_klass(), "should be klass");
@@ -3310,7 +3308,7 @@
         // The previous version InstanceKlass is on the ClassLoaderData deallocate list
         // so will be deallocated during the next phase of class unloading.
         RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is dead",
-                              pv_node));
+                              p2i(pv_node)));
         // For debugging purposes.
         pv_node->set_is_scratch_class();
         pv_node->class_loader_data()->add_to_deallocate_list(pv_node);
@@ -3321,7 +3319,7 @@
         continue;
       } else {
         RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is alive",
-                              pv_node));
+                              p2i(pv_node)));
         assert(pvcp->pool_holder() != NULL, "Constant pool with no holder");
         guarantee (!loader_data->is_unloading(), "unloaded classes can't be on the stack");
         live_count++;
@@ -3472,10 +3470,10 @@
         // is never reached, but this won't be noticeable to the programmer.
         old_method->set_running_emcp(true);
         RC_TRACE(0x00000400, ("add: EMCP method %s is on_stack " INTPTR_FORMAT,
-                              old_method->name_and_sig_as_C_string(), old_method));
+                              old_method->name_and_sig_as_C_string(), p2i(old_method)));
       } else if (!old_method->is_obsolete()) {
         RC_TRACE(0x00000400, ("add: EMCP method %s is NOT on_stack " INTPTR_FORMAT,
-                              old_method->name_and_sig_as_C_string(), old_method));
+                              old_method->name_and_sig_as_C_string(), p2i(old_method)));
       }
     }
   }
--- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -33,8 +33,6 @@
 #include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void InstanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
   // Clear the nonstatic oop-map entries corresponding to referent
   // and nextPending field.  They are treated specially by the
--- a/hotspot/src/share/vm/oops/klassVtable.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -38,8 +38,6 @@
 #include "runtime/handles.inline.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 inline InstanceKlass* klassVtable::ik() const {
   Klass* k = _klass();
   assert(k->oop_is_instance(), "not an InstanceKlass");
@@ -1505,7 +1503,7 @@
 #ifndef PRODUCT
     print();
 #endif
-    fatal("vtableEntry " PTR_FORMAT ": method is from subclass", this);
+    fatal("vtableEntry " PTR_FORMAT ": method is from subclass", p2i(this));
   }
 }
 
@@ -1515,7 +1513,7 @@
   ResourceMark rm;
   tty->print("vtableEntry %s: ", method()->name()->as_C_string());
   if (Verbose) {
-    tty->print("m %#lx ", (address)method());
+    tty->print("m " PTR_FORMAT " ", p2i(method()));
   }
 }
 
@@ -1586,7 +1584,7 @@
 void klassItable::print_statistics() {
  tty->print_cr("itable statistics:");
  tty->print_cr("%6d classes with itables", _total_classes);
- tty->print_cr("%6d K uses for itables (average by class: %d bytes)", _total_size / K, _total_size / _total_classes);
+ tty->print_cr("%6lu K uses for itables (average by class: %ld bytes)", _total_size / K, _total_size / _total_classes);
 }
 
 #endif // PRODUCT
--- a/hotspot/src/share/vm/oops/markOop.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/markOop.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -27,8 +27,6 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/objectMonitor.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void markOopDesc::print_on(outputStream* st) const {
   if (is_marked()) {
     st->print(" marked(" INTPTR_FORMAT ")", value());
@@ -39,7 +37,7 @@
     if (mon == NULL) {
       st->print("NULL (this should never be seen!)");
     } else {
-      st->print("{count=" INTPTR_FORMAT ",waiters=" INTPTR_FORMAT
+      st->print("{count=0x%08x,waiters=0x%08x"
                 ",recursions=" INTPTR_FORMAT ",owner=" INTPTR_FORMAT "}",
                 mon->count(), mon->waiters(), mon->recursions(),
                 p2i(mon->owner()));
@@ -65,7 +63,7 @@
     assert(is_unlocked() || has_bias_pattern(), "just checking");
     st->print("mark(");
     if (has_bias_pattern()) st->print("biased,");
-    st->print("hash %#lx,", hash());
+    st->print("hash " INTPTR_FORMAT ",", hash());
     st->print("age %d)", age());
   }
 }
--- a/hotspot/src/share/vm/oops/method.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/method.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -57,8 +57,6 @@
 #include "utilities/quickSort.hpp"
 #include "utilities/xmlstream.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Implementation of Method
 
 Method* Method::allocate(ClassLoaderData* loader_data,
@@ -250,7 +248,7 @@
     ResourceMark rm;
     assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(),
            "bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
-           bcp, name_and_sig_as_C_string());
+           p2i(bcp), name_and_sig_as_C_string());
   }
 #endif
   return bcp - code_base();
@@ -2026,9 +2024,9 @@
   assert(is_method(), "must be method");
   st->print_cr("%s", internal_name());
   // get the effect of PrintOopAddress, always, for methods:
-  st->print_cr(" - this oop:          " INTPTR_FORMAT, (intptr_t)this);
+  st->print_cr(" - this oop:          " INTPTR_FORMAT, p2i(this));
   st->print   (" - method holder:     "); method_holder()->print_value_on(st); st->cr();
-  st->print   (" - constants:         " INTPTR_FORMAT " ", (address)constants());
+  st->print   (" - constants:         " INTPTR_FORMAT " ", p2i(constants()));
   constants()->print_value_on(st); st->cr();
   st->print   (" - access:            0x%x  ", access_flags().as_int()); access_flags().print_on(st); st->cr();
   st->print   (" - name:              ");    name()->print_value_on(st); st->cr();
@@ -2042,26 +2040,26 @@
   if (highest_comp_level() != CompLevel_none)
     st->print_cr(" - highest level:     %d", highest_comp_level());
   st->print_cr(" - vtable index:      %d",   _vtable_index);
-  st->print_cr(" - i2i entry:         " INTPTR_FORMAT, interpreter_entry());
+  st->print_cr(" - i2i entry:         " INTPTR_FORMAT, p2i(interpreter_entry()));
   st->print(   " - adapters:          ");
   AdapterHandlerEntry* a = ((Method*)this)->adapter();
   if (a == NULL)
-    st->print_cr(INTPTR_FORMAT, a);
+    st->print_cr(INTPTR_FORMAT, p2i(a));
   else
     a->print_adapter_on(st);
-  st->print_cr(" - compiled entry     " INTPTR_FORMAT, from_compiled_entry());
+  st->print_cr(" - compiled entry     " INTPTR_FORMAT, p2i(from_compiled_entry()));
   st->print_cr(" - code size:         %d",   code_size());
   if (code_size() != 0) {
-    st->print_cr(" - code start:        " INTPTR_FORMAT, code_base());
-    st->print_cr(" - code end (excl):   " INTPTR_FORMAT, code_base() + code_size());
+    st->print_cr(" - code start:        " INTPTR_FORMAT, p2i(code_base()));
+    st->print_cr(" - code end (excl):   " INTPTR_FORMAT, p2i(code_base() + code_size()));
   }
   if (method_data() != NULL) {
-    st->print_cr(" - method data:       " INTPTR_FORMAT, (address)method_data());
+    st->print_cr(" - method data:       " INTPTR_FORMAT, p2i(method_data()));
   }
   st->print_cr(" - checked ex length: %d",   checked_exceptions_length());
   if (checked_exceptions_length() > 0) {
     CheckedExceptionElement* table = checked_exceptions_start();
-    st->print_cr(" - checked ex start:  " INTPTR_FORMAT, table);
+    st->print_cr(" - checked ex start:  " INTPTR_FORMAT, p2i(table));
     if (Verbose) {
       for (int i = 0; i < checked_exceptions_length(); i++) {
         st->print_cr("   - throws %s", constants()->printable_name_at(table[i].class_cp_index));
@@ -2070,7 +2068,7 @@
   }
   if (has_linenumber_table()) {
     u_char* table = compressed_linenumber_table();
-    st->print_cr(" - linenumber start:  " INTPTR_FORMAT, table);
+    st->print_cr(" - linenumber start:  " INTPTR_FORMAT, p2i(table));
     if (Verbose) {
       CompressedLineNumberReadStream stream(table);
       while (stream.read_pair()) {
@@ -2081,7 +2079,7 @@
   st->print_cr(" - localvar length:   %d",   localvariable_table_length());
   if (localvariable_table_length() > 0) {
     LocalVariableTableElement* table = localvariable_table_start();
-    st->print_cr(" - localvar start:    " INTPTR_FORMAT, table);
+    st->print_cr(" - localvar start:    " INTPTR_FORMAT, p2i(table));
     if (Verbose) {
       for (int i = 0; i < localvariable_table_length(); i++) {
         int bci = table[i].start_bci;
@@ -2098,8 +2096,8 @@
     code()->print_value_on(st);
   }
   if (is_native()) {
-    st->print_cr(" - native function:   " INTPTR_FORMAT, native_function());
-    st->print_cr(" - signature handler: " INTPTR_FORMAT, signature_handler());
+    st->print_cr(" - native function:   " INTPTR_FORMAT, p2i(native_function()));
+    st->print_cr(" - signature handler: " INTPTR_FORMAT, p2i(signature_handler()));
   }
 }
 
--- a/hotspot/src/share/vm/oops/methodData.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -38,8 +38,6 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // ==================================================================
 // DataLayout
 //
--- a/hotspot/src/share/vm/oops/oop.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/oops/oop.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 #include "runtime/thread.inline.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 bool always_do_update_barrier = false;
 
 BarrierSet* oopDesc::_bs = NULL;
@@ -47,7 +45,7 @@
 
 void oopDesc::print_address_on(outputStream* st) const {
   if (PrintOopAddress) {
-    st->print("{" INTPTR_FORMAT "}", this);
+    st->print("{" INTPTR_FORMAT "}", p2i(this));
   }
 }
 
--- a/hotspot/src/share/vm/opto/type.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/opto/type.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -41,8 +41,6 @@
 #include "opto/opcodes.hpp"
 #include "opto/type.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
@@ -2784,7 +2782,7 @@
 #ifndef PRODUCT
 void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
   if( _ptr == Constant )
-    st->print(INTPTR_FORMAT, _bits);
+    st->print(INTPTR_FORMAT, p2i(_bits));
   else
     st->print("rawptr:%s", ptr_msg[_ptr]);
 }
@@ -3187,7 +3185,7 @@
 void TypeOopPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
   st->print("oopptr:%s", ptr_msg[_ptr]);
   if( _klass_is_exact ) st->print(":exact");
-  if( const_oop() ) st->print(INTPTR_FORMAT, const_oop());
+  if( const_oop() ) st->print(INTPTR_FORMAT, p2i(const_oop()));
   switch( _offset ) {
   case OffsetTop: st->print("+top"); break;
   case OffsetBot: st->print("+any"); break;
@@ -4635,7 +4633,7 @@
 #ifndef PRODUCT
 void TypeMetadataPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
   st->print("metadataptr:%s", ptr_msg[_ptr]);
-  if( metadata() ) st->print(INTPTR_FORMAT, metadata());
+  if( metadata() ) st->print(INTPTR_FORMAT, p2i(metadata()));
   switch( _offset ) {
   case OffsetTop: st->print("+top"); break;
   case OffsetBot: st->print("+any"); break;
@@ -5033,7 +5031,7 @@
     {
       const char *name = klass()->name()->as_utf8();
       if( name ) {
-        st->print("klass %s: " INTPTR_FORMAT, name, klass());
+        st->print("klass %s: " INTPTR_FORMAT, name, p2i(klass()));
       } else {
         ShouldNotReachHere();
       }
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -102,7 +102,8 @@
 #define UNCHECKED() (unchecked_jni_NativeInterface)
 
 static const char * warn_wrong_jnienv = "Using JNIEnv in the wrong thread";
-static const char * warn_bad_class_descriptor = "JNI FindClass received a bad class descriptor \"%s\".  A correct class descriptor " \
+static const char * warn_bad_class_descriptor1 = "JNI FindClass received a bad class descriptor \"";
+static const char * warn_bad_class_descriptor2 = "\".  A correct class descriptor " \
   "has no leading \"L\" or trailing \";\".  Incorrect descriptors will not be accepted in future releases.";
 static const char * fatal_using_jnienv_in_nonjava = "FATAL ERROR in native method: Using JNIEnv in non-Java thread";
 static const char * warn_other_function_in_critical = "Warning: Calling other JNI functions in the scope of " \
@@ -484,7 +485,8 @@
       name[0] == JVM_SIGNATURE_CLASS &&            // 'L'
       name[len-1] == JVM_SIGNATURE_ENDCLASS ) {    // ';'
     char msg[JVM_MAXPATHLEN];
-    jio_snprintf(msg, JVM_MAXPATHLEN, warn_bad_class_descriptor, name);
+    jio_snprintf(msg, JVM_MAXPATHLEN, "%s%s%s",
+                 warn_bad_class_descriptor1, name, warn_bad_class_descriptor2);
     ReportJNIWarning(thr, msg);
   }
 }
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Fri Oct 09 08:46:44 2015 +0000
@@ -44,9 +44,6 @@
 # include "prims/jvmtiRawMonitor.hpp"
 # include "prims/jvmtiUtil.hpp"
 
-// There are known-bad format/arg pairings in the code generated by this file.
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 </xsl:text>
 
   <xsl:if test="$trace = 'Trace'">
@@ -543,8 +540,8 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [%s] %s %s  env=%d",  curr_thread_name, func_name, 
-                    JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), env);
+          tty->print_cr("JVMTI [%s] %s %s  env=" PTR_FORMAT,  curr_thread_name, func_name, 
+                    JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), p2i(env));
     }
 </xsl:text>
     </xsl:if>
@@ -760,8 +757,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_MONITOR</xsl:with-param>
-      <xsl:with-param name="comment"> - not a raw monitor 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, rmonitor</xsl:with-param>
+      <xsl:with-param name="comment"> - not a raw monitor " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(rmonitor)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
   }
@@ -777,8 +774,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
-      <xsl:with-param name="comment"> - jthread resolved to NULL - jthread = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - jthread resolved to NULL - jthread = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
     }
@@ -786,8 +783,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
-      <xsl:with-param name="comment"> - oop is not a thread - jthread = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - oop is not a thread - jthread = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
     }
@@ -798,8 +795,8 @@
       <xsl:with-param name="err">
         <xsl:text>JVMTI_ERROR_THREAD_NOT_ALIVE</xsl:text>
       </xsl:with-param>
-      <xsl:with-param name="comment"> - not a Java thread - jthread = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - not a Java thread - jthread = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
     }
@@ -842,7 +839,7 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:with-param>
-      <xsl:with-param name="comment"> - negative depth - jthread = 0x%x</xsl:with-param>
+      <xsl:with-param name="comment"> - negative depth - jthread = " INT32_FORMAT "</xsl:with-param>
       <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
@@ -861,8 +858,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
-      <xsl:with-param name="comment"> - resolved to NULL - jclass = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - resolved to NULL - jclass = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
   }
@@ -870,8 +867,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
-      <xsl:with-param name="comment"> - not a class - jclass = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - not a class - jclass = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
   }
@@ -882,8 +879,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
-      <xsl:with-param name="comment"> - is a primitive class - jclass = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - is a primitive class - jclass = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
   }
@@ -892,8 +889,8 @@
 </xsl:text>
     <xsl:apply-templates select=".." mode="traceError">     
       <xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
-      <xsl:with-param name="comment"> - no Klass* - jclass = 0x%x</xsl:with-param>
-      <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+      <xsl:with-param name="comment"> - no Klass* - jclass = " PTR_FORMAT "</xsl:with-param>
+      <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
     </xsl:apply-templates>
     <xsl:text>
   }
@@ -1034,12 +1031,12 @@
   <xsl:text> </xsl:text>
   <xsl:value-of select="$name"/>
   <xsl:variable name="child" select="child::*[position()=1]"/>
-  <xsl:choose>
+  <xsl:choose>g
     <xsl:when test="name($child)='char'">
       <xsl:text>='%s'</xsl:text>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:text>=0x%x</xsl:text>
+      <xsl:text>=" PTR_FORMAT "</xsl:text>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
@@ -1047,7 +1044,15 @@
 <xsl:template match="inbuf" mode="traceInValue">
   <xsl:param name="name"/>
   <xsl:text>, </xsl:text>
-  <xsl:value-of select="$name"/>
+  <xsl:variable name="child" select="child::*[position()=1]"/>
+  <xsl:choose>
+    <xsl:when test="name($child)='char'">
+      <xsl:value-of select="$name"/>
+    </xsl:when>
+    <xsl:otherwise>
+      p2i(<xsl:value-of select="$name"/>)
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="ptrtype" mode="traceInFormat">
@@ -1057,7 +1062,7 @@
     <xsl:when test="name($child)='jclass'">
       <xsl:text> </xsl:text>
       <xsl:value-of select="$name"/>
-      <xsl:text>=0x%x</xsl:text>
+      <xsl:text>=" PTR_FORMAT "</xsl:text>
     </xsl:when>
     <xsl:otherwise>
       <xsl:apply-templates select="$child" mode="traceInFormat"/> 
@@ -1071,7 +1076,7 @@
   <xsl:choose>
     <xsl:when test="name($child)='jclass'">
       <xsl:text>, </xsl:text>
-      <xsl:value-of select="$name"/>
+      p2i(<xsl:value-of select="$name"/>)
     </xsl:when>
     <xsl:otherwise>
       <xsl:apply-templates select="$child" mode="traceInValue"/>
@@ -1083,13 +1088,13 @@
   <xsl:param name="name"/>
   <xsl:text> </xsl:text>
   <xsl:value-of select="$name"/>
-  <xsl:text>=0x%x</xsl:text>
+  <xsl:text>=" PTR_FORMAT "</xsl:text>
 </xsl:template>
 
 <xsl:template match="inptr" mode="traceInValue">
   <xsl:param name="name"/>
   <xsl:text>, </xsl:text>
-  <xsl:value-of select="$name"/>
+  p2i(<xsl:value-of select="$name"/>)
 </xsl:template>
 
 <xsl:template match="jrawMonitorID|jfieldID" mode="traceInFormat">
@@ -1214,18 +1219,25 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="jint|jlocation" mode="traceInFormat">
+<xsl:template match="jint" mode="traceInFormat">
   <xsl:param name="name"/>
   <xsl:text> </xsl:text>
   <xsl:value-of select="$name"/>
-  <xsl:text>=%d</xsl:text>
+  <xsl:text>=" INT32_FORMAT "</xsl:text>
+</xsl:template>
+
+<xsl:template match="jlocation" mode="traceInFormat">
+  <xsl:param name="name"/>
+  <xsl:text> </xsl:text>
+  <xsl:value-of select="$name"/>
+  <xsl:text>=" INT64_FORMAT "</xsl:text>
 </xsl:template>
 
 <xsl:template match="jlong" mode="traceInFormat">
   <xsl:param name="name"/>
   <xsl:text> </xsl:text>
   <xsl:value-of select="$name"/>
-  <xsl:text>=%ld</xsl:text>
+  <xsl:text>=" INT64_FORMAT "</xsl:text>
 </xsl:template>
 
 <xsl:template match="size_t" mode="traceInFormat">
--- a/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -38,8 +38,6 @@
 #include "runtime/vmThread.hpp"
 #include "runtime/vm_operations.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef JVMTI_TRACE
 #define EC_TRACE(out) do { \
   if (JvmtiTrace::trace_event_controller()) { \
@@ -564,7 +562,7 @@
   jlong was_any_env_thread_enabled = JvmtiEventController::_universal_global_event_enabled.get_bits();
   jlong any_env_thread_enabled = 0;
 
-  EC_TRACE(("JVMTI [-] # recompute enabled - before %llx", was_any_env_thread_enabled));
+  EC_TRACE(("JVMTI [-] # recompute enabled - before " UINT64_FORMAT_X, was_any_env_thread_enabled));
 
   // compute non-thread-filters events.
   // This must be done separately from thread-filtered events, since some
@@ -646,7 +644,7 @@
 
   }
 
-  EC_TRACE(("JVMTI [-] # recompute enabled - after %llx", any_env_thread_enabled));
+  EC_TRACE(("JVMTI [-] # recompute enabled - after " UINT64_FORMAT_X, any_env_thread_enabled));
 }
 
 
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -58,8 +58,6 @@
 #include "gc/parallel/psMarkSweep.hpp"
 #endif // INCLUDE_ALL_GCS
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef JVMTI_TRACE
 #define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; }
 #define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; tty->print_cr out; }
@@ -770,7 +768,7 @@
 
       EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD,
                 ("JVMTI [%s] class compile method unload event sent jmethodID " PTR_FORMAT,
-                 JvmtiTrace::safe_get_thread_name(thread), method));
+                 JvmtiTrace::safe_get_thread_name(thread), p2i(method)));
 
       ResourceMark rm(thread);
 
@@ -805,7 +803,7 @@
     if (!ets->breakpoint_posted() && ets->is_enabled(JVMTI_EVENT_BREAKPOINT)) {
       ThreadState old_os_state = thread->osthread()->get_state();
       thread->osthread()->set_state(BREAKPOINTED);
-      EVT_TRACE(JVMTI_EVENT_BREAKPOINT, ("JVMTI [%s] Evt Breakpoint sent %s.%s @ %d",
+      EVT_TRACE(JVMTI_EVENT_BREAKPOINT, ("JVMTI [%s] Evt Breakpoint sent %s.%s @ " INTX_FORMAT,
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1258,7 +1256,7 @@
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     ets->compare_and_set_current_location(mh(), location, JVMTI_EVENT_SINGLE_STEP);
     if (!ets->single_stepping_posted() && ets->is_enabled(JVMTI_EVENT_SINGLE_STEP)) {
-      EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Evt Single Step sent %s.%s @ %d",
+      EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Evt Single Step sent %s.%s @ " INTX_FORMAT,
                     JvmtiTrace::safe_get_thread_name(thread),
                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1298,7 +1296,7 @@
       if (ets->is_enabled(JVMTI_EVENT_EXCEPTION) && (exception != NULL)) {
 
         EVT_TRACE(JVMTI_EVENT_EXCEPTION,
-                     ("JVMTI [%s] Evt Exception thrown sent %s.%s @ %d",
+                     ("JVMTI [%s] Evt Exception thrown sent %s.%s @ " INTX_FORMAT,
                       JvmtiTrace::safe_get_thread_name(thread),
                       (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                       (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1374,7 +1372,7 @@
     return;
   }
   EVT_TRIG_TRACE(JVMTI_EVENT_EXCEPTION_CATCH,
-                    ("JVMTI [%s] Trg unwind_due_to_exception triggered %s.%s @ %s%d - %s",
+                    ("JVMTI [%s] Trg unwind_due_to_exception triggered %s.%s @ %s" INTX_FORMAT " - %s",
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1409,7 +1407,7 @@
       for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
         if (ets->is_enabled(JVMTI_EVENT_EXCEPTION_CATCH) && (exception_handle() != NULL)) {
           EVT_TRACE(JVMTI_EVENT_EXCEPTION_CATCH,
-                     ("JVMTI [%s] Evt ExceptionCatch sent %s.%s @ %d",
+                     ("JVMTI [%s] Evt ExceptionCatch sent %s.%s @ " INTX_FORMAT,
                       JvmtiTrace::safe_get_thread_name(thread),
                       (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                       (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1503,7 +1501,7 @@
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_FIELD_ACCESS)) {
-      EVT_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("JVMTI [%s] Evt Field Access event sent %s.%s @ %d",
+      EVT_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("JVMTI [%s] Evt Field Access event sent %s.%s @ " INTX_FORMAT,
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1667,7 +1665,7 @@
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_FIELD_MODIFICATION)) {
       EVT_TRACE(JVMTI_EVENT_FIELD_MODIFICATION,
-                   ("JVMTI [%s] Evt Field Modification event sent %s.%s @ %d",
+                   ("JVMTI [%s] Evt Field Modification event sent %s.%s @ " INTX_FORMAT,
                     JvmtiTrace::safe_get_thread_name(thread),
                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1807,7 +1805,7 @@
 
     EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD,
               ("JVMTI [%s] class compile method load event sent (by GenerateEvents), jmethodID=" PTR_FORMAT,
-              JvmtiTrace::safe_get_thread_name(thread), method));
+               JvmtiTrace::safe_get_thread_name(thread), p2i(method)));
 
     JvmtiEventMark jem(thread);
     JvmtiJavaThreadEventTransition jet(thread);
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -45,8 +45,6 @@
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/events.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 Array<Method*>* VM_RedefineClasses::_old_methods = NULL;
 Array<Method*>* VM_RedefineClasses::_new_methods = NULL;
 Method**  VM_RedefineClasses::_matching_old_methods = NULL;
@@ -1714,12 +1712,12 @@
             // unless we are trying to stress ldc -> ldc_w rewriting
             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
               ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
-              bcp, cp_index, new_index));
+              p2i(bcp), cp_index, new_index));
             *(bcp + 1) = new_index;
           } else {
             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
               ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d",
-              Bytecodes::name(c), bcp, cp_index, new_index));
+              Bytecodes::name(c), p2i(bcp), cp_index, new_index));
             // the new value needs ldc_w instead of ldc
             u_char inst_buffer[4]; // max instruction size is 4 bytes
             bcp = (address)inst_buffer;
@@ -1780,7 +1778,7 @@
           // the original index is mapped so update w/ new value
           RC_TRACE_WITH_THREAD(0x00080000, THREAD,
             ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
-            bcp, cp_index, new_index));
+            p2i(bcp), cp_index, new_index));
           // Rewriter::rewrite_method() uses put_native_u2() in this
           // situation because it is reusing the constant pool index
           // location for a native index into the ConstantPoolCache.
--- a/hotspot/src/share/vm/prims/privilegedStack.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/privilegedStack.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -30,8 +30,6 @@
 #include "prims/privilegedStack.hpp"
 #include "runtime/vframe.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) {
   Method* method        = vfst->method();
   _klass                = method->method_holder();
@@ -65,7 +63,7 @@
 #ifndef PRODUCT
 
 void PrivilegedElement::print_on(outputStream* st) const {
-  st->print("   0x%lx ", _frame_id);
+  st->print("   " PTR_FORMAT " ", p2i(_frame_id));
   _klass->print_value_on(st);
   if (protection_domain() != NULL) {
     st->print("   ");
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -44,8 +44,6 @@
 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif // INCLUDE_ALL_GCS
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 /*
  *      Implementation of class sun.misc.Unsafe
  */
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -65,8 +65,6 @@
 #endif // INCLUDE_NMT
 
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #define SIZE_T_MAX_VALUE ((size_t) -1)
 
 bool WhiteBox::_used = false;
@@ -201,8 +199,8 @@
                   "\tUniverse::narrow_oop_base() is " PTR_FORMAT "\n"
                   "\tUniverse::narrow_oop_use_implicit_null_checks() is %d",
                   UseCompressedOops,
-                  rhs.base(),
-                  Universe::narrow_oop_base(),
+                  p2i(rhs.base()),
+                  p2i(Universe::narrow_oop_base()),
                   Universe::narrow_oop_use_implicit_null_checks());
     return;
   }
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -53,8 +53,6 @@
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 bool DeoptimizationMarker::_is_active = false;
 
 Deoptimization::UnrollBlock::UnrollBlock(int  size_of_deoptimized_frame,
@@ -112,7 +110,7 @@
   tty->print_cr("  size_of_deoptimized_frame = %d", _size_of_deoptimized_frame);
   tty->print(   "  frame_sizes: ");
   for (int index = 0; index < number_of_frames(); index++) {
-    tty->print("%d ", frame_sizes()[index]);
+    tty->print(INTX_FORMAT " ", frame_sizes()[index]);
   }
   tty->cr();
 }
@@ -206,7 +204,7 @@
         assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
         if (TraceDeoptimization) {
           ttyLocker ttyl;
-          tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, (void *)result, thread);
+          tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, p2i(result), p2i(thread));
         }
       }
       if (objects != NULL) {
@@ -217,7 +215,7 @@
 #ifndef PRODUCT
         if (TraceDeoptimization) {
           ttyLocker ttyl;
-          tty->print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, thread);
+          tty->print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, p2i(thread));
           print_objects(objects, realloc_failures);
         }
 #endif
@@ -245,13 +243,13 @@
               if (mi->eliminated()) {
                 if (first) {
                   first = false;
-                  tty->print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, thread);
+                  tty->print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, p2i(thread));
                 }
                 if (mi->owner_is_scalar_replaced()) {
                   Klass* k = java_lang_Class::as_Klass(mi->owner_klass());
                   tty->print_cr("     failed reallocation for klass %s", k->external_name());
                 } else {
-                  tty->print_cr("     object <" INTPTR_FORMAT "> locked", (void *)mi->owner());
+                  tty->print_cr("     object <" INTPTR_FORMAT "> locked", p2i(mi->owner()));
                 }
               }
             }
@@ -550,11 +548,12 @@
 #ifndef PRODUCT
   if (TraceDeoptimization) {
     ttyLocker ttyl;
-    tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", thread, array, exec_mode);
+    tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d",
+                  p2i(thread), p2i(array), exec_mode);
   }
 #endif
   Events::log(thread, "DEOPT UNPACKING pc=" INTPTR_FORMAT " sp=" INTPTR_FORMAT " mode %d",
-              stub_frame.pc(), stub_frame.sp(), exec_mode);
+              p2i(stub_frame.pc()), p2i(stub_frame.sp()), exec_mode);
 
   UnrollBlock* info = array->unroll_block();
 
@@ -690,7 +689,7 @@
         tty->print_cr("  top_frame_expression_stack_adjustment = %d", top_frame_expression_stack_adjustment);
         tty->print_cr("  exec_mode = %d", exec_mode);
         tty->print_cr("  cur_invoke_parameter_size = %d", cur_invoke_parameter_size);
-        tty->print_cr("  Thread = " INTPTR_FORMAT ", thread ID = " UINTX_FORMAT, thread, thread->osthread()->thread_id());
+        tty->print_cr("  Thread = " INTPTR_FORMAT ", thread ID = %d", p2i(thread), thread->osthread()->thread_id());
         tty->print_cr("  Interpreted frames:");
         for (int k = 0; k < cur_array->frames(); k++) {
           vframeArrayElement* el = cur_array->element(k);
@@ -966,7 +965,7 @@
     KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()));
     Handle obj = sv->value();
 
-    tty->print("     object <" INTPTR_FORMAT "> of type ", (void *)sv->value()());
+    tty->print("     object <" INTPTR_FORMAT "> of type ", p2i(sv->value()()));
     k->print_value();
     assert(obj.not_null() || realloc_failures, "reallocation was missed");
     if (obj.is_null()) {
@@ -985,12 +984,12 @@
 #endif // COMPILER2
 
 vframeArray* Deoptimization::create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk, bool realloc_failures) {
-  Events::log(thread, "DEOPT PACKING pc=" INTPTR_FORMAT " sp=" INTPTR_FORMAT, fr.pc(), fr.sp());
+  Events::log(thread, "DEOPT PACKING pc=" INTPTR_FORMAT " sp=" INTPTR_FORMAT, p2i(fr.pc()), p2i(fr.sp()));
 
 #ifndef PRODUCT
   if (TraceDeoptimization) {
     ttyLocker ttyl;
-    tty->print("DEOPT PACKING thread " INTPTR_FORMAT " ", thread);
+    tty->print("DEOPT PACKING thread " INTPTR_FORMAT " ", p2i(thread));
     fr.print_on(tty);
     tty->print_cr("     Virtual frames (innermost first):");
     for (int index = 0; index < chunk->length(); index++) {
@@ -1035,7 +1034,7 @@
 #ifndef PRODUCT
   if (TraceDeoptimization) {
     ttyLocker ttyl;
-    tty->print_cr("     Created vframeArray " INTPTR_FORMAT, array);
+    tty->print_cr("     Created vframeArray " INTPTR_FORMAT, p2i(array));
   }
 #endif // PRODUCT
 
@@ -1297,7 +1296,7 @@
 
   // Log a message
   Events::log(thread, "Uncommon trap: trap_request=" PTR32_FORMAT " fr.pc=" INTPTR_FORMAT,
-              trap_request, fr.pc());
+              trap_request, p2i(fr.pc()));
 
   {
     ResourceMark rm;
@@ -1331,7 +1330,7 @@
 
     // Log a message
     Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d",
-                              trap_reason_name(reason), trap_action_name(action), fr.pc(),
+                              trap_reason_name(reason), trap_action_name(action), p2i(fr.pc()),
                               trap_method->name_and_sig_as_C_string(), trap_bci);
 
     // Print a bunch of diagnostics, if requested.
@@ -1386,7 +1385,7 @@
         tty->print("Uncommon trap occurred in");
         nm->method()->print_short_name(tty);
         tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d",
-                   fr.pc(),
+                   p2i(fr.pc()),
                    os::current_thread_id(),
                    trap_reason_name(reason),
                    trap_action_name(action),
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -42,8 +42,6 @@
 #include "runtime/vframe.hpp"
 #include "utilities/macros.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Static fields of FlatProfiler
 int               FlatProfiler::received_gc_ticks   = 0;
 int               FlatProfiler::vm_operation_ticks  = 0;
@@ -186,7 +184,7 @@
   if (counters == NULL) return;
 
   tty->cr();
-  tty->print_cr("Printing compiled methods with PC buckets having more than %d ticks", ProfilerPCTickThreshold);
+  tty->print_cr("Printing compiled methods with PC buckets having more than " INTX_FORMAT " ticks", ProfilerPCTickThreshold);
   tty->print_cr("===================================================================");
   tty->cr();
 
@@ -1494,7 +1492,7 @@
   }
 
   if (WizardMode) {
-    tty->print_cr("Node area used: %dKb", (area_top - area_bottom) / 1024);
+    tty->print_cr("Node area used: " INTX_FORMAT " Kb", (area_top - area_bottom) / 1024);
   }
   reset();
 }
--- a/hotspot/src/share/vm/runtime/frame.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -50,9 +50,6 @@
 #include "runtime/thread.inline.hpp"
 #include "utilities/decoder.hpp"
 
-
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
   _thread         = thread;
   _update_map     = update_map;
@@ -112,7 +109,7 @@
     if (src != NULL) {
 
       r->print_on(st);
-      st->print(" [" INTPTR_FORMAT "] = ", src);
+      st->print(" [" INTPTR_FORMAT "] = ", p2i(src));
       if (((uintptr_t)src & (sizeof(*src)-1)) != 0) {
         st->print_cr("<misaligned>");
       } else {
@@ -494,9 +491,10 @@
   NOT_PRODUCT(address begin = pc()-40;)
   NOT_PRODUCT(address end   = NULL;)
 
-  st->print("%s frame (sp=" INTPTR_FORMAT " unextended sp=" INTPTR_FORMAT, print_name(), sp(), unextended_sp());
+  st->print("%s frame (sp=" INTPTR_FORMAT " unextended sp=" INTPTR_FORMAT, print_name(), p2i(sp()), p2i(unextended_sp()));
   if (sp() != NULL)
-    st->print(", fp=" INTPTR_FORMAT ", real_fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT, fp(), real_fp(), pc());
+    st->print(", fp=" INTPTR_FORMAT ", real_fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT,
+              p2i(fp()), p2i(real_fp()), p2i(pc()));
 
   if (StubRoutines::contains(pc())) {
     st->print_cr(")");
@@ -569,15 +567,15 @@
     st->print_cr("]");
   }
   // monitor
-  st->print_cr(" - monitor[" INTPTR_FORMAT "]", interpreter_frame_monitor_begin());
+  st->print_cr(" - monitor[" INTPTR_FORMAT "]", p2i(interpreter_frame_monitor_begin()));
   // bcp
-  st->print(" - bcp    [" INTPTR_FORMAT "]", interpreter_frame_bcp());
+  st->print(" - bcp    [" INTPTR_FORMAT "]", p2i(interpreter_frame_bcp()));
   st->fill_to(23);
   st->print_cr("; @%d", interpreter_frame_bci());
   // locals
-  st->print_cr(" - locals [" INTPTR_FORMAT "]", interpreter_frame_local_at(0));
+  st->print_cr(" - locals [" INTPTR_FORMAT "]", p2i(interpreter_frame_local_at(0)));
   // method
-  st->print(" - method [" INTPTR_FORMAT "]", (address)interpreter_frame_method());
+  st->print(" - method [" INTPTR_FORMAT "]", p2i(interpreter_frame_method()));
   st->fill_to(23);
   st->print("; ");
   interpreter_frame_method()->print_name(st);
@@ -606,7 +604,7 @@
     while ((p2 = strstr(p1, os::file_separator())) != NULL) p1 = p2 + len;
     st->print("  [%s+0x%x]", p1, offset);
   } else {
-    st->print("  " PTR_FORMAT, pc);
+    st->print("  " PTR_FORMAT, p2i(pc));
   }
 
   // function name - os::dll_address_to_function_name() may return confusing
@@ -645,14 +643,14 @@
         st->print("j  %s", buf);
         st->print("+%d", this->interpreter_frame_bci());
       } else {
-        st->print("j  " PTR_FORMAT, pc());
+        st->print("j  " PTR_FORMAT, p2i(pc()));
       }
     } else if (StubRoutines::contains(pc())) {
       StubCodeDesc* desc = StubCodeDesc::desc_for(pc());
       if (desc != NULL) {
         st->print("v  ~StubRoutines::%s", desc->name());
       } else {
-        st->print("v  ~StubRoutines::" PTR_FORMAT, pc());
+        st->print("v  ~StubRoutines::" PTR_FORMAT, p2i(pc()));
       }
     } else if (_cb->is_buffer_blob()) {
       st->print("v  ~BufferBlob::%s", ((BufferBlob *)_cb)->name());
@@ -661,12 +659,12 @@
       Method* m = nm->method();
       if (m != NULL) {
         m->name_and_sig_as_C_string(buf, buflen);
-        st->print("J %d%s %s %s (%d bytes) @ " PTR_FORMAT " [" PTR_FORMAT "+0x%x]",
+        st->print("J %d%s %s %s (%d bytes) @ " PTR_FORMAT " [" PTR_FORMAT "+" INTPTR_FORMAT "]",
                   nm->compile_id(), (nm->is_osr_method() ? "%" : ""),
                   ((nm->compiler() != NULL) ? nm->compiler()->name() : ""),
-                  buf, m->code_size(), _pc, _cb->code_begin(), _pc - _cb->code_begin());
+                  buf, m->code_size(), p2i(_pc), p2i(_cb->code_begin()), _pc - _cb->code_begin());
       } else {
-        st->print("J  " PTR_FORMAT, pc());
+        st->print("J  " PTR_FORMAT, p2i(pc()));
       }
     } else if (_cb->is_runtime_stub()) {
       st->print("v  ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name());
@@ -677,7 +675,7 @@
     } else if (_cb->is_safepoint_stub()) {
       st->print("v  ~SafepointBlob");
     } else {
-      st->print("v  blob " PTR_FORMAT, pc());
+      st->print("v  blob " PTR_FORMAT, p2i(pc()));
     }
   } else {
     print_C_frame(st, buf, buflen, pc());
@@ -998,7 +996,8 @@
   }
 };
 
-void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f) {
+void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix,
+                                       const RegisterMap* reg_map, OopClosure* f) {
   ResourceMark rm;
   CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
   finder.oops_do();
@@ -1022,7 +1021,7 @@
     return NULL;
   }
   oop r = *oop_adr;
-  assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r);
+  assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", p2i(r), p2i(r));
   return r;
 }
 
@@ -1223,7 +1222,7 @@
     nmethod* nm = cb()->as_nmethod_or_null();
     values.describe(-1, info_address,
                     FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no,
-                                       nm, nm->method()->name_and_sig_as_C_string(),
+                                       p2i(nm), nm->method()->name_and_sig_as_C_string(),
                                        (_deopt_state == is_deoptimized) ?
                                        " (deoptimized)" :
                                        ((_deopt_state == unknown) ? " (state unknown)" : "")),
@@ -1233,7 +1232,7 @@
     nmethod* nm = cb()->as_nmethod_or_null();
     values.describe(-1, info_address,
                     FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
-                                       nm, nm->method()->name_and_sig_as_C_string()), 2);
+                                       p2i(nm), nm->method()->name_and_sig_as_C_string()), 2);
   } else {
     // provide default info if not handled before
     char *info = (char *) "special frame";
@@ -1290,8 +1289,8 @@
     if (prev.location == fv.location) {
       if (fv.owner != prev.owner) {
         tty->print_cr("overlapping storage");
-        tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", prev.location, *prev.location, prev.description);
-        tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", fv.location, *fv.location, fv.description);
+        tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", p2i(prev.location), *prev.location, prev.description);
+        tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", p2i(fv.location), *fv.location, fv.description);
         error = true;
       }
     } else {
@@ -1335,14 +1334,14 @@
   for (int i = max_index; i >= min_index; i--) {
     FrameValue fv = _values.at(i);
     while (cur > fv.location) {
-      tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT, cur, *cur);
+      tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT, p2i(cur), *cur);
       cur--;
     }
     if (last == fv.location) {
       const char* spacer = "          " LP64_ONLY("        ");
       tty->print_cr(" %s  %s %s", spacer, spacer, fv.description);
     } else {
-      tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", fv.location, *fv.location, fv.description);
+      tty->print_cr(" " INTPTR_FORMAT ": " INTPTR_FORMAT " %s", p2i(fv.location), *fv.location, fv.description);
       last = fv.location;
       cur--;
     }
--- a/hotspot/src/share/vm/runtime/globals.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -49,8 +49,6 @@
 #include "shark/shark_globals.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
               MATERIALIZE_PD_DEVELOPER_FLAG, \
               MATERIALIZE_PRODUCT_FLAG, \
@@ -369,11 +367,11 @@
     } else if (is_uint()) {
       st->print("%-16u", get_uint());
     } else if (is_intx()) {
-      st->print("%-16ld", get_intx());
+      st->print(INTX_FORMAT_W(-16), get_intx());
     } else if (is_uintx()) {
-      st->print("%-16lu", get_uintx());
+      st->print(UINTX_FORMAT_W(-16), get_uintx());
     } else if (is_uint64_t()) {
-      st->print("%-16lu", get_uint64_t());
+      st->print(UINT64_FORMAT_W(-16), get_uint64_t());
     } else if (is_size_t()) {
       st->print(SIZE_FORMAT_W(-16), get_size_t());
     } else if (is_double()) {
--- a/hotspot/src/share/vm/runtime/handles.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/handles.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -30,13 +30,11 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef ASSERT
 oop* HandleArea::allocate_handle(oop obj) {
   assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
   assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark");
-  assert(obj->is_oop(), "not an oop: " INTPTR_FORMAT, (intptr_t*) obj);
+  assert(obj->is_oop(), "not an oop: " INTPTR_FORMAT, p2i(obj));
   return real_allocate_handle(obj);
 }
 
@@ -85,10 +83,9 @@
   // The thread local handle areas should not get very large
   if (TraceHandleAllocation && (size_t)handles_visited > TotalHandleAllocationLimit) {
 #ifdef ASSERT
-    warning("%d: Visited in HandleMark : %d",
-      _nof_handlemarks, handles_visited);
+    warning("%d: Visited in HandleMark : " SIZE_FORMAT, _nof_handlemarks, handles_visited);
 #else
-    warning("Visited in HandleMark : %d", handles_visited);
+    warning("Visited in HandleMark : " SIZE_FORMAT, handles_visited);
 #endif
   }
   if (_prev != NULL) _prev->oops_do(f);
@@ -137,10 +134,10 @@
     handles /= sizeof(void *); // Adjust for size of a handle
     if (handles > HandleAllocationLimit) {
       // Note: _nof_handlemarks is only set in debug mode
-      warning("%d: Allocated in HandleMark : %d", _nof_handlemarks, handles);
+      warning("%d: Allocated in HandleMark : " SIZE_FORMAT, _nof_handlemarks, handles);
     }
 
-    tty->print_cr("Handles %d", handles);
+    tty->print_cr("Handles " SIZE_FORMAT, handles);
   }
 #endif
 
--- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -36,8 +36,6 @@
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Implementation of InterfaceSupport
 
 #ifdef ASSERT
@@ -73,7 +71,7 @@
 }
 
 void InterfaceSupport::trace(const char* result_type, const char* header) {
-  tty->print_cr("%6d  %s", _number_of_calls, header);
+  tty->print_cr("%6ld  %s", _number_of_calls, header);
 }
 
 void InterfaceSupport::gc_alot() {
@@ -109,8 +107,7 @@
       if (FullGCALotInterval > 1) {
         _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0));
         if (PrintGCDetails && Verbose) {
-          tty->print_cr("Full gc no: %u\tInterval: %d", invocations,
-                        _fullgc_alot_counter);
+          tty->print_cr("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);
         }
       } else {
         _fullgc_alot_counter = 1;
@@ -130,8 +127,7 @@
         if (ScavengeALotInterval > 1) {
           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
           if (PrintGCDetails && Verbose) {
-            tty->print_cr("Scavenge no: %u\tInterval: %d", invocations,
-                          _scavenge_alot_counter);
+            tty->print_cr("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);
           }
         } else {
           _scavenge_alot_counter = 1;
--- a/hotspot/src/share/vm/runtime/java.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/java.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -80,8 +80,6 @@
 #include "opto/runtime.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 GrowableArray<Method*>* collected_profiled_methods;
 
 int compare_methods(Method** a, Method** b) {
@@ -159,7 +157,7 @@
   collected_invoked_methods->sort(&compare_methods);
   //
   tty->cr();
-  tty->print_cr("Histogram Over MethodOop Invocation Counters (cutoff = %d):", MethodHistogramCutoff);
+  tty->print_cr("Histogram Over MethodOop Invocation Counters (cutoff = " INTX_FORMAT "):", MethodHistogramCutoff);
   tty->cr();
   tty->print_cr("____Count_(I+C)____Method________________________Module_________________");
   unsigned total = 0, int_total = 0, comp_total = 0, static_total = 0, final_total = 0,
--- a/hotspot/src/share/vm/runtime/jniHandles.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/jniHandles.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -30,8 +30,6 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/thread.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 JNIHandleBlock* JNIHandles::_global_handles       = NULL;
 JNIHandleBlock* JNIHandles::_weak_global_handles  = NULL;
 oop             JNIHandles::_deleted_handle       = NULL;
@@ -281,7 +279,7 @@
       _blocks_allocated++;
       if (TraceJNIHandleAllocation) {
         tty->print_cr("JNIHandleBlock " INTPTR_FORMAT " allocated (%d total blocks)",
-                      block, _blocks_allocated);
+                      p2i(block), _blocks_allocated);
       }
       if (ZapJNIHandleArea) block->zap();
       #ifndef PRODUCT
@@ -396,7 +394,7 @@
         } else {
           // The weakly referenced object is not alive, clear the reference by storing NULL
           if (TraceReferenceGC) {
-            tty->print_cr("Clearing JNI weak reference (" INTPTR_FORMAT ")", root);
+            tty->print_cr("Clearing JNI weak reference (" INTPTR_FORMAT ")", p2i(root));
           }
           *root = NULL;
         }
@@ -504,7 +502,7 @@
   }
   if (TraceJNIHandleAllocation) {
     tty->print_cr("Rebuild free list JNIHandleBlock " INTPTR_FORMAT " blocks=%d used=%d free=%d add=%d",
-      this, blocks, total-free, free, _allocate_before_rebuild);
+                  p2i(this), blocks, total-free, free, _allocate_before_rebuild);
   }
 }
 
--- a/hotspot/src/share/vm/runtime/mutex.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/mutex.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -42,8 +42,6 @@
 # include "mutex_bsd.inline.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
 //
 // Native Monitor-Mutex locking - theory of operations
@@ -1212,9 +1210,9 @@
 }
 
 void Monitor::print_on_error(outputStream* st) const {
-  st->print("[" PTR_FORMAT, this);
+  st->print("[" PTR_FORMAT, p2i(this));
   st->print("] %s", _name);
-  st->print(" - owner thread: " PTR_FORMAT, _owner);
+  st->print(" - owner thread: " PTR_FORMAT, p2i(_owner));
 }
 
 
@@ -1225,7 +1223,8 @@
 
 #ifndef PRODUCT
 void Monitor::print_on(outputStream* st) const {
-  st->print_cr("Mutex: [0x%lx/0x%lx] %s - owner: 0x%lx", this, _LockWord.FullWord, _name, _owner);
+  st->print_cr("Mutex: [" PTR_FORMAT "/" PTR_FORMAT "] %s - owner: " PTR_FORMAT,
+               p2i(this), _LockWord.FullWord, _name, p2i(_owner));
 }
 #endif
 
--- a/hotspot/src/share/vm/runtime/os.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -61,8 +61,6 @@
 
 # include <signal.h>
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 OSThread*         os::_starting_thread    = NULL;
 address           os::_polling_page       = NULL;
 volatile int32_t* os::_mem_serialize_page = NULL;
@@ -621,12 +619,12 @@
   ptr = guarded.get_user_ptr();
 #endif
   if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) {
-    tty->print_cr("os::malloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, ptr);
+    tty->print_cr("os::malloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr));
     breakpoint();
   }
   debug_only(if (paranoid) verify_memory(ptr));
   if (PrintMalloc && tty != NULL) {
-    tty->print_cr("os::malloc " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, ptr);
+    tty->print_cr("os::malloc " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr));
   }
 
   // we do not track guard memory
@@ -658,7 +656,7 @@
     return os::malloc(size, memflags, stack);
   }
   if ((intptr_t)memblock == (intptr_t)MallocCatchPtr) {
-    tty->print_cr("os::realloc caught " PTR_FORMAT, memblock);
+    tty->print_cr("os::realloc caught " PTR_FORMAT, p2i(memblock));
     breakpoint();
   }
   // NMT support
@@ -671,7 +669,7 @@
   // always move the block
   void* ptr = os::malloc(size, memflags, stack);
   if (PrintMalloc && tty != NULL) {
-    tty->print_cr("os::realloc " SIZE_FORMAT " bytes, " PTR_FORMAT " --> " PTR_FORMAT, size, memblock, ptr);
+    tty->print_cr("os::realloc " SIZE_FORMAT " bytes, " PTR_FORMAT " --> " PTR_FORMAT, size, p2i(memblock), p2i(ptr));
   }
   // Copy to new memory if malloc didn't fail
   if ( ptr != NULL ) {
@@ -681,7 +679,7 @@
     memcpy(ptr, memblock, MIN2(size, memblock_size));
     if (paranoid) verify_memory(MemTracker::malloc_base(ptr));
     if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) {
-      tty->print_cr("os::realloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, ptr);
+      tty->print_cr("os::realloc caught, " SIZE_FORMAT " bytes --> " PTR_FORMAT, size, p2i(ptr));
       breakpoint();
     }
     os::free(memblock);
@@ -696,7 +694,7 @@
 #ifdef ASSERT
   if (memblock == NULL) return;
   if ((intptr_t)memblock == (intptr_t)MallocCatchPtr) {
-    if (tty != NULL) tty->print_cr("os::free caught " PTR_FORMAT, memblock);
+    if (tty != NULL) tty->print_cr("os::free caught " PTR_FORMAT, p2i(memblock));
     breakpoint();
   }
   void* membase = MemTracker::record_free(memblock);
@@ -796,7 +794,7 @@
   }
 
   address p = start;
-  st->print(PTR_FORMAT ":   ", start);
+  st->print(PTR_FORMAT ":   ", p2i(start));
   while (p < end) {
     switch (unitsize) {
       case 1: st->print("%02x", *(u1*)p); break;
@@ -809,7 +807,7 @@
     if (cols >= cols_per_line && p < end) {
        cols = 0;
        st->cr();
-       st->print(PTR_FORMAT ":   ", p);
+       st->print(PTR_FORMAT ":   ", p2i(p));
     } else {
        st->print(" ");
     }
@@ -856,9 +854,9 @@
   size_t mem = physical_memory()/G;
   if (mem == 0) {  // for low memory systems
     mem = physical_memory()/M;
-    st->print("%d cores, %dM, ", processor_count(), mem);
+    st->print("%d cores, " SIZE_FORMAT "M, ", processor_count(), mem);
   } else {
-    st->print("%d cores, %dG, ", processor_count(), mem);
+    st->print("%d cores, " SIZE_FORMAT "G, ", processor_count(), mem);
   }
   get_summary_os_info(buf, buflen);
   st->print_raw(buf);
@@ -914,41 +912,40 @@
       // the interpreter is generated into a buffer blob
       InterpreterCodelet* i = Interpreter::codelet_containing(addr);
       if (i != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", addr, (int)(addr - i->code_begin()));
+        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
         i->print_on(st);
         return;
       }
       if (Interpreter::contains(addr)) {
         st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
-                     " (not bytecode specific)", addr);
+                     " (not bytecode specific)", p2i(addr));
         return;
       }
       //
       if (AdapterHandlerLibrary::contains(b)) {
-        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", addr, (int)(addr - b->code_begin()));
+        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - b->code_begin()));
         AdapterHandlerLibrary::print_handler_on(st, b);
       }
       // the stubroutines are generated into a buffer blob
       StubCodeDesc* d = StubCodeDesc::desc_for(addr);
       if (d != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", addr, (int)(addr - d->begin()));
+        st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
         d->print_on(st);
         st->cr();
         return;
       }
       if (StubRoutines::contains(addr)) {
-        st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) "
-                     "stub routine", addr);
+        st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", p2i(addr));
         return;
       }
       // the InlineCacheBuffer is using stubs generated into a buffer blob
       if (InlineCacheBuffer::contains(addr)) {
-        st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", addr);
+        st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", p2i(addr));
         return;
       }
       VtableStub* v = VtableStubs::stub_containing(addr);
       if (v != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", addr, (int)(addr - v->entry_point()));
+        st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
         v->print_on(st);
         st->cr();
         return;
@@ -958,7 +955,7 @@
     if (nm != NULL) {
       ResourceMark rm;
       st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
-                addr, (int)(addr - nm->entry_point()), nm);
+                p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
       if (verbose) {
         st->print(" for ");
         nm->method()->print_value_on(st);
@@ -967,7 +964,7 @@
       nm->print_nmethod(verbose);
       return;
     }
-    st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", addr, (int)(addr - b->code_begin()));
+    st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
     b->print_on(st);
     return;
   }
@@ -985,9 +982,9 @@
     }
     if (print) {
       if (p == (HeapWord*) addr) {
-        st->print_cr(INTPTR_FORMAT " is an oop", addr);
+        st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
       } else {
-        st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, addr, p);
+        st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
       }
       oop(p)->print_on(st);
       return;
@@ -995,22 +992,22 @@
   } else {
     if (Universe::heap()->is_in_reserved(addr)) {
       st->print_cr(INTPTR_FORMAT " is an unallocated location "
-                   "in the heap", addr);
+                   "in the heap", p2i(addr));
       return;
     }
   }
   if (JNIHandles::is_global_handle((jobject) addr)) {
-    st->print_cr(INTPTR_FORMAT " is a global jni handle", addr);
+    st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
     return;
   }
   if (JNIHandles::is_weak_global_handle((jobject) addr)) {
-    st->print_cr(INTPTR_FORMAT " is a weak global jni handle", addr);
+    st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
     return;
   }
 #ifndef PRODUCT
   // we don't keep the block list in product mode
   if (JNIHandleBlock::any_contains((jobject) addr)) {
-    st->print_cr(INTPTR_FORMAT " is a local jni handle", addr);
+    st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
     return;
   }
 #endif
@@ -1020,7 +1017,7 @@
     if (thread->privileged_stack_top() != NULL &&
         thread->privileged_stack_top()->contains(addr)) {
       st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack "
-                   "for thread: " INTPTR_FORMAT, addr, thread);
+                   "for thread: " INTPTR_FORMAT, p2i(addr), p2i(thread));
       if (verbose) thread->print_on(st);
       return;
     }
@@ -1029,7 +1026,7 @@
       if (verbose) {
         thread->print_on(st);
       } else {
-        st->print_cr(INTPTR_FORMAT " is a thread", addr);
+        st->print_cr(INTPTR_FORMAT " is a thread", p2i(addr));
       }
       return;
     }
@@ -1038,7 +1035,7 @@
     if (thread->stack_base() >= addr &&
         addr > (thread->stack_base() - thread->stack_size())) {
       st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
-                   INTPTR_FORMAT, addr, thread);
+                   INTPTR_FORMAT, p2i(addr), p2i(thread));
       if (verbose) thread->print_on(st);
       return;
     }
@@ -1052,7 +1049,7 @@
       st->cr();
     } else {
       // Use addr->print() from the debugger instead (not here)
-      st->print_cr(INTPTR_FORMAT " is pointing into metadata", addr);
+      st->print_cr(INTPTR_FORMAT " is pointing into metadata", p2i(addr));
     }
     return;
   }
@@ -1062,7 +1059,7 @@
     return;
   }
 
-  st->print_cr(INTPTR_FORMAT " is an unknown value", addr);
+  st->print_cr(INTPTR_FORMAT " is an unknown value", p2i(addr));
 }
 
 // Looks like all platforms except IA64 can use the same function to check
@@ -1461,7 +1458,7 @@
                   " pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT
                   " size=" SIZE_FORMAT,
                   str, region_min_size, region_max_size,
-                  page_size, base, size);
+                  page_size, p2i(base), size);
   }
 }
 #endif  // #ifndef PRODUCT
--- a/hotspot/src/share/vm/runtime/osThread.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/osThread.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -26,8 +26,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/osThread.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) {
   pd_initialize();
   set_start_proc(start_proc);
@@ -41,7 +39,7 @@
 
 // Printing
 void OSThread::print_on(outputStream *st) const {
-  st->print("nid=0x%lx ", thread_id());
+  st->print("nid=0x%x ", thread_id());
   switch (_state) {
     case ALLOCATED:               st->print("allocated ");                 break;
     case INITIALIZED:             st->print("initialized ");               break;
--- a/hotspot/src/share/vm/runtime/perfData.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/perfData.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -34,8 +34,6 @@
 #include "utilities/exceptions.hpp"
 #include "utilities/globalDefinitions.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 PerfDataList*   PerfDataManager::_all = NULL;
 PerfDataList*   PerfDataManager::_sampled = NULL;
 PerfDataList*   PerfDataManager::_constants = NULL;
@@ -170,14 +168,14 @@
 
   if (PerfTraceDataCreation) {
     tty->print("name = %s, dtype = %d, variability = %d,"
-               " units = %d, dsize = %d, vlen = %d,"
-               " pad_length = %d, size = %d, on_c_heap = %s,"
+               " units = %d, dsize = " SIZE_FORMAT ", vlen = " SIZE_FORMAT ","
+               " pad_length = " SIZE_FORMAT ", size = " SIZE_FORMAT ", on_c_heap = %s,"
                " address = " INTPTR_FORMAT ","
                " data address = " INTPTR_FORMAT "\n",
                cname, dtype, variability(),
                units(), dsize, vlen,
                pad_length, size, is_on_c_heap() ? "TRUE":"FALSE",
-               psmp, valuep);
+               p2i(psmp), p2i(valuep));
   }
 
   // record the start of the entry and the location of the data field.
--- a/hotspot/src/share/vm/runtime/perfMemory.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/perfMemory.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -36,8 +36,6 @@
 #include "runtime/statSampler.hpp"
 #include "utilities/globalDefinitions.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Prefix of performance data file.
 const char               PERFDATA_NAME[] = "hsperfdata";
 
@@ -96,7 +94,7 @@
 
   if (PerfTraceMemOps) {
     tty->print("PerfDataMemorySize = " SIZE_FORMAT ","
-               " os::vm_allocation_granularity = " SIZE_FORMAT ","
+               " os::vm_allocation_granularity = %d,"
                " adjusted size = " SIZE_FORMAT "\n",
                PerfDataMemorySize,
                os::vm_allocation_granularity(),
@@ -129,7 +127,7 @@
     if (PerfTraceMemOps) {
       tty->print("PerfMemory created: address = " INTPTR_FORMAT ","
                  " size = " SIZE_FORMAT "\n",
-                 (void*)_start,
+                 p2i(_start),
                  _capacity);
     }
 
--- a/hotspot/src/share/vm/runtime/safepoint.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -63,8 +63,6 @@
 #include "c1/c1_globals.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // --------------------------------------------------------------------------------------------------
 // Implementation of Safepoint begin/end
 
@@ -893,7 +891,7 @@
     case _running:
     default:
        tty->print_cr("restart thread " INTPTR_FORMAT " with state %d",
-                      _thread, _type);
+                     p2i(_thread), _type);
        _thread->print();
       ShouldNotReachHere();
   }
@@ -915,7 +913,7 @@
 
   st->print_cr("Thread: " INTPTR_FORMAT
               "  [0x%2x] State: %s _has_called_back %d _at_poll_safepoint %d",
-               _thread, _thread->osthread()->thread_id(), s, _has_called_back,
+               p2i(_thread), _thread->osthread()->thread_id(), s, _has_called_back,
                _at_poll_safepoint);
 
   _thread->print_thread_state_on(st);
@@ -934,7 +932,7 @@
 
   // Step 1: Find the nmethod from the return address
   if (ShowSafepointMsgs && Verbose) {
-    tty->print_cr("Polling page exception at " INTPTR_FORMAT, thread()->saved_exception_pc());
+    tty->print_cr("Polling page exception at " INTPTR_FORMAT, p2i(thread()->saved_exception_pc()));
   }
   address real_return_addr = thread()->saved_exception_pc();
 
@@ -1241,8 +1239,8 @@
   if (!need_to_track_page_armed_status) {
     tty->print_cr("Polling page always armed");
   } else {
-    tty->print_cr("Defer polling page loop count = %d\n",
-                 DeferPollingPageLoopCount);
+    tty->print_cr("Defer polling page loop count = " INTX_FORMAT "\n",
+                  DeferPollingPageLoopCount);
   }
 
   for (int index = 0; index < VM_Operation::VMOp_Terminating; index++) {
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -64,8 +64,6 @@
 #include "c1/c1_Runtime1.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Shared stub locations
 RuntimeStub*        SharedRuntime::_wrong_method_blob;
 RuntimeStub*        SharedRuntime::_wrong_method_abstract_blob;
@@ -183,7 +181,7 @@
     tty->print_cr("IC Miss Histogram:");
     int tot_misses = 0;
     for (int i = 0; i < _ICmiss_index; i++) {
-      tty->print_cr("  at: " INTPTR_FORMAT "  nof: %d", _ICmiss_at[i], _ICmiss_count[i]);
+      tty->print_cr("  at: " INTPTR_FORMAT "  nof: %d", p2i(_ICmiss_at[i]), _ICmiss_count[i]);
       tot_misses += _ICmiss_count[i];
     }
     tty->print_cr("Total IC misses: %7d", tot_misses);
@@ -455,7 +453,7 @@
 // previous frame depending on the return address.
 
 address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* thread, address return_address) {
-  assert(frame::verify_return_pc(return_address), "must be a return address: " INTPTR_FORMAT, return_address);
+  assert(frame::verify_return_pc(return_address), "must be a return address: " INTPTR_FORMAT, p2i(return_address));
   assert(thread->frames_to_pop_failed_realloc() == 0 || Interpreter::contains(return_address), "missed frames to pop?");
 
   // Reset method handle flag.
@@ -498,7 +496,7 @@
 
 #ifndef PRODUCT
   { ResourceMark rm;
-    tty->print_cr("No exception handler found for exception at " INTPTR_FORMAT " - potential problems:", return_address);
+    tty->print_cr("No exception handler found for exception at " INTPTR_FORMAT " - potential problems:", p2i(return_address));
     tty->print_cr("a) exception happened in (new?) code stubs/buffers that is not handled here");
     tty->print_cr("b) other problem");
   }
@@ -685,7 +683,7 @@
 #endif
 
   if (t == NULL) {
-    tty->print_cr("MISSING EXCEPTION HANDLER for pc " INTPTR_FORMAT " and handler bci %d", ret_pc, handler_bci);
+    tty->print_cr("MISSING EXCEPTION HANDLER for pc " INTPTR_FORMAT " and handler bci %d", p2i(ret_pc), handler_bci);
     tty->print_cr("   Exception:");
     exception->print();
     tty->cr();
@@ -769,7 +767,7 @@
         // in a debug VM to verify the correctness of the compiled
         // method stack banging.
         assert(thread->deopt_mark() == NULL, "no stack overflow from deopt blob/uncommon trap");
-        Events::log_exception(thread, "StackOverflowError at " INTPTR_FORMAT, pc);
+        Events::log_exception(thread, "StackOverflowError at " INTPTR_FORMAT, p2i(pc));
         return StubRoutines::throw_StackOverflowError_entry();
       }
 
@@ -786,10 +784,10 @@
 
           if (vt_stub->is_abstract_method_error(pc)) {
             assert(!vt_stub->is_vtable_stub(), "should never see AbstractMethodErrors from vtable-type VtableStubs");
-            Events::log_exception(thread, "AbstractMethodError at " INTPTR_FORMAT, pc);
+            Events::log_exception(thread, "AbstractMethodError at " INTPTR_FORMAT, p2i(pc));
             return StubRoutines::throw_AbstractMethodError_entry();
           } else {
-            Events::log_exception(thread, "NullPointerException at vtable entry " INTPTR_FORMAT, pc);
+            Events::log_exception(thread, "NullPointerException at vtable entry " INTPTR_FORMAT, p2i(pc));
             return StubRoutines::throw_NullPointerException_at_call_entry();
           }
         } else {
@@ -807,9 +805,9 @@
             bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob();
             if (!is_in_blob) {
               cb->print();
-              fatal("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc);
+              fatal("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, p2i(pc));
             }
-            Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc);
+            Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, p2i(pc));
             // There is no handler here, so we will simply unwind.
             return StubRoutines::throw_NullPointerException_at_call_entry();
           }
@@ -821,13 +819,13 @@
             // => the nmethod is not yet active (i.e., the frame
             // is not set up yet) => use return address pushed by
             // caller => don't push another return address
-            Events::log_exception(thread, "NullPointerException in IC check " INTPTR_FORMAT, pc);
+            Events::log_exception(thread, "NullPointerException in IC check " INTPTR_FORMAT, p2i(pc));
             return StubRoutines::throw_NullPointerException_at_call_entry();
           }
 
           if (nm->method()->is_method_handle_intrinsic()) {
             // exception happened inside MH dispatch code, similar to a vtable stub
-            Events::log_exception(thread, "NullPointerException in MH adapter " INTPTR_FORMAT, pc);
+            Events::log_exception(thread, "NullPointerException in MH adapter " INTPTR_FORMAT, p2i(pc));
             return StubRoutines::throw_NullPointerException_at_call_entry();
           }
 
@@ -865,9 +863,9 @@
     // for AbortVMOnException flag
     NOT_PRODUCT(Exceptions::debug_check_abort("java.lang.NullPointerException"));
     if (exception_kind == IMPLICIT_NULL) {
-      Events::log_exception(thread, "Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
+      Events::log_exception(thread, "Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, p2i(pc), p2i(target_pc));
     } else {
-      Events::log_exception(thread, "Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
+      Events::log_exception(thread, "Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, p2i(pc), p2i(target_pc));
     }
     return target_pc;
   }
@@ -1176,7 +1174,8 @@
       (is_optimized) ? "optimized " : "", (is_virtual) ? "virtual" : "static",
       Bytecodes::name(invoke_code));
     callee_method->print_short_name(tty);
-    tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT, caller_frame.pc(), callee_method->code());
+    tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT,
+                  p2i(caller_frame.pc()), p2i(callee_method->code()));
   }
 #endif
 
@@ -1397,8 +1396,8 @@
       ResourceMark rm(thread);
       tty->print("converting IC miss to reresolve (%s) call to", Bytecodes::name(bc));
       callee_method->print_short_name(tty);
-      tty->print_cr(" from pc: " INTPTR_FORMAT, caller_frame.pc());
-      tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
+      tty->print_cr(" from pc: " INTPTR_FORMAT, p2i(caller_frame.pc()));
+      tty->print_cr(" code: " INTPTR_FORMAT, p2i(callee_method->code()));
     }
     return callee_method;
   }
@@ -1415,7 +1414,7 @@
     ResourceMark rm(thread);
     tty->print("IC miss (%s) call to", Bytecodes::name(bc));
     callee_method->print_short_name(tty);
-    tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
+    tty->print_cr(" code: " INTPTR_FORMAT, p2i(callee_method->code()));
   }
 
   if (ICMissHistogram) {
@@ -1447,7 +1446,7 @@
           ResourceMark rm(thread);
           tty->print("OPTIMIZED IC miss (%s) call to", Bytecodes::name(bc));
           callee_method->print_short_name(tty);
-          tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
+          tty->print_cr(" code: " INTPTR_FORMAT, p2i(callee_method->code()));
         }
         should_be_mono = true;
       } else if (inline_cache->is_icholder_call()) {
@@ -1464,7 +1463,7 @@
               ResourceMark rm(thread);
               tty->print("FALSE IC miss (%s) converting to compiled call to", Bytecodes::name(bc));
               callee_method->print_short_name(tty);
-              tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
+              tty->print_cr(" code: " INTPTR_FORMAT, p2i(callee_method->code()));
             }
             should_be_mono = true;
           }
@@ -1604,7 +1603,7 @@
     ResourceMark rm(thread);
     tty->print("handle_wrong_method reresolving call to");
     callee_method->print_short_name(tty);
-    tty->print_cr(" code: " INTPTR_FORMAT, callee_method->code());
+    tty->print_cr(" code: " INTPTR_FORMAT, p2i(callee_method->code()));
   }
 #endif
 
@@ -1630,7 +1629,7 @@
   for (int i = 0; i < member_arg_pos; i++) {
     VMReg a =    regs_with_member_name[i].first();
     VMReg b = regs_without_member_name[i].first();
-    assert(a->value() == b->value(), "register allocation mismatch: a=%d, b=%d", a->value(), b->value());
+    assert(a->value() == b->value(), "register allocation mismatch: a=" INTX_FORMAT ", b=" INTX_FORMAT, a->value(), b->value());
   }
   assert(regs_with_member_name[member_arg_pos].first()->is_valid(), "bad member arg");
 }
@@ -1712,25 +1711,25 @@
         if (callee == cb || callee->is_adapter_blob()) {
           // static call or optimized virtual
           if (TraceCallFixup) {
-            tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", caller_pc);
+            tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
             moop->print_short_name(tty);
-            tty->print_cr(" to " INTPTR_FORMAT, entry_point);
+            tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point));
           }
           call->set_destination_mt_safe(entry_point);
         } else {
           if (TraceCallFixup) {
-            tty->print("failed to fixup callsite at " INTPTR_FORMAT " to compiled code for", caller_pc);
+            tty->print("failed to fixup callsite at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
             moop->print_short_name(tty);
-            tty->print_cr(" to " INTPTR_FORMAT, entry_point);
+            tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point));
           }
           // assert is too strong could also be resolve destinations.
           // assert(InlineCacheBuffer::contains(destination) || VtableStubs::contains(destination), "must be");
         }
       } else {
           if (TraceCallFixup) {
-            tty->print("already patched callsite at " INTPTR_FORMAT " to compiled code for", caller_pc);
+            tty->print("already patched callsite at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
             moop->print_short_name(tty);
-            tty->print_cr(" to " INTPTR_FORMAT, entry_point);
+            tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point));
           }
       }
     }
@@ -2834,8 +2833,8 @@
 
 void AdapterHandlerEntry::print_adapter_on(outputStream* st) const {
   st->print_cr("AHE@" INTPTR_FORMAT ": %s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
-               (intptr_t) this, fingerprint()->as_string(),
-               get_i2c_entry(), get_c2i_entry(), get_c2i_unverified_entry());
+               p2i(this), fingerprint()->as_string(),
+               p2i(get_i2c_entry()), p2i(get_c2i_entry()), p2i(get_c2i_unverified_entry()));
 
 }
 
--- a/hotspot/src/share/vm/runtime/signature.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/signature.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -32,8 +32,6 @@
 #include "oops/typeArrayKlass.hpp"
 #include "runtime/signature.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Implementation of SignatureIterator
 
 // Signature syntax:
@@ -209,7 +207,7 @@
         return;
         break;
       default:
-        tty->print_cr("*** parameter is %d", fingerprint & parameter_feature_mask);
+        tty->print_cr("*** parameter is " UINT64_FORMAT, fingerprint & parameter_feature_mask);
         tty->print_cr("*** fingerprint is " PTR64_FORMAT, saved_fingerprint);
         ShouldNotReachHere();
         break;
--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -25,8 +25,6 @@
 #include "precompiled.hpp"
 #include "runtime/stackValueCollection.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 jint StackValueCollection::int_at(int slot) const {
   intptr_t val =  at(slot)->get_int();
   jint ival = *((jint*) (&val));
--- a/hotspot/src/share/vm/runtime/sweeper.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/sweeper.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -43,8 +43,6 @@
 #include "utilities/ticks.inline.hpp"
 #include "utilities/xmlstream.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef ASSERT
 
 #define SWEEP(nm) record_sweep(nm, __LINE__)
@@ -62,12 +60,12 @@
 
   void print() {
       tty->print_cr("traversal = %d compile_id = %d %s uep = " PTR_FORMAT " vep = "
-                    PTR_FORMAT " state = %d traversal_mark %d line = %d",
+                    PTR_FORMAT " state = %d traversal_mark %ld line = %d",
                     traversal,
                     compile_id,
                     kind == NULL ? "" : kind,
-                    uep,
-                    vep,
+                    p2i(uep),
+                    p2i(vep),
                     state,
                     traversal_mark,
                     line);
@@ -223,7 +221,7 @@
     _total_time_this_sweep = Tickspan();
 
     if (PrintMethodFlushing) {
-      tty->print_cr("### Sweep: stack traversal %d", _traversals);
+      tty->print_cr("### Sweep: stack traversal %ld", _traversals);
     }
     Threads::nmethods_do(&mark_activation_closure);
 
@@ -482,7 +480,7 @@
 
 #ifdef ASSERT
   if(PrintMethodFlushing) {
-    tty->print_cr("### sweeper:      sweep time(%d): ", (jlong)sweep_time.value());
+    tty->print_cr("### sweeper:      sweep time(" JLONG_FORMAT "): ", sweep_time.value());
   }
 #endif
 
@@ -592,14 +590,14 @@
     if (nm->is_marked_for_reclamation()) {
       assert(!nm->is_locked_by_vm(), "must not flush locked nmethods");
       if (PrintMethodFlushing && Verbose) {
-        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), nm);
+        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), p2i(nm));
       }
       release_nmethod(nm);
       assert(result == None, "sanity");
       result = Flushed;
     } else {
       if (PrintMethodFlushing && Verbose) {
-        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm);
+        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), p2i(nm));
       }
       nm->mark_for_reclamation();
       // Keep track of code cache state change
@@ -619,7 +617,7 @@
         nm->clear_ic_stubs();
       }
       if (PrintMethodFlushing && Verbose) {
-        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
+        tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), p2i(nm));
       }
       // Code cache state change is tracked in make_zombie()
       nm->make_zombie();
@@ -636,7 +634,7 @@
   } else if (nm->is_unloaded()) {
     // Unloaded code, just make it a zombie
     if (PrintMethodFlushing && Verbose) {
-      tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm);
+      tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), p2i(nm));
     }
     if (nm->is_osr_method()) {
       SWEEP(nm);
@@ -743,7 +741,7 @@
         // Code cache state change is tracked in make_not_entrant()
         if (PrintMethodFlushing && Verbose) {
           tty->print_cr("### Nmethod %d/" PTR_FORMAT "made not-entrant: hotness counter %d/%d threshold %f",
-              nm->compile_id(), nm, nm->hotness_counter(), reset_val, threshold);
+              nm->compile_id(), p2i(nm), nm->hotness_counter(), reset_val, threshold);
         }
       }
     }
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -52,8 +52,6 @@
   #define NOINLINE
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // The "core" versions of monitor enter and exit reside in this file.
 // The interpreter and compilers contain specialized transliterated
 // variants of the enter-exit fast-path operations.  See i486.ad fast_lock(),
@@ -1417,7 +1415,7 @@
         if (object->is_instance()) {
           ResourceMark rm;
           tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
-                        (void *) object, (intptr_t) object->mark(),
+                        p2i(object), p2i(object->mark()),
                         object->klass()->external_name());
         }
       }
@@ -1465,7 +1463,7 @@
       if (object->is_instance()) {
         ResourceMark rm;
         tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
-                      (void *) object, (intptr_t) object->mark(),
+                      p2i(object), p2i(object->mark()),
                       object->klass()->external_name());
       }
     }
@@ -1529,7 +1527,7 @@
       if (obj->is_instance()) {
         ResourceMark rm;
         tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
-                      (void *) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
+                      p2i(obj), p2i(obj->mark()), obj->klass()->external_name());
       }
     }
 
@@ -1704,7 +1702,7 @@
         javaVFrame::print_locked_object_class_name(tty, obj, "locked");
         fatal("exiting JavaThread=" INTPTR_FORMAT
               " unexpectedly owns ObjectMonitor=" INTPTR_FORMAT,
-              THREAD, mid);
+              p2i(THREAD), p2i(mid));
       }
       (void)mid->complete_exit(CHECK);
     }
--- a/hotspot/src/share/vm/runtime/thread.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -112,8 +112,6 @@
 #include "runtime/rtmLocking.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef DTRACE_ENABLED
 
 // Only bother with this argument setup if dtrace is available
@@ -165,7 +163,7 @@
     if (TraceBiasedLocking) {
       if (aligned_addr != real_malloc_addr) {
         tty->print_cr("Aligned thread " INTPTR_FORMAT " to " INTPTR_FORMAT,
-                      real_malloc_addr, aligned_addr);
+                      p2i(real_malloc_addr), p2i(aligned_addr));
       }
     }
     ((Thread*) aligned_addr)->_real_malloc_address = real_malloc_addr;
@@ -799,7 +797,7 @@
     if (os::get_native_priority(this, &os_prio) == OS_OK) {
       st->print("os_prio=%d ", os_prio);
     }
-    st->print("tid=" INTPTR_FORMAT " ", this);
+    st->print("tid=" INTPTR_FORMAT " ", p2i(this));
     ext().print_on(st);
     osthread()->print_on(st);
   }
@@ -818,7 +816,7 @@
   else                                st->print("Thread");
 
   st->print(" [stack: " PTR_FORMAT "," PTR_FORMAT "]",
-            _stack_base - _stack_size, _stack_base);
+            p2i(_stack_base - _stack_size), p2i(_stack_base));
 
   if (osthread()) {
     st->print(" [id=%d]", osthread()->thread_id());
@@ -2042,10 +2040,10 @@
 
       if (TraceExceptions) {
         ResourceMark rm;
-        tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", this);
+        tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this));
         if (has_last_Java_frame()) {
           frame f = last_frame();
-          tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", f.pc(), f.sp());
+          tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp()));
         }
         tty->print_cr(" of type: %s", InstanceKlass::cast(_pending_async_exception->klass())->external_name());
       }
@@ -2619,7 +2617,7 @@
     if (fst.current()->should_be_deoptimized()) {
       if (LogCompilation && xtty != NULL) {
         nmethod* nm = fst.current()->cb()->as_nmethod_or_null();
-        xtty->elem("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'",
+        xtty->elem("deoptimized thread='%s' compile_id='%d'",
                    this->name(), nm != NULL ? nm->compile_id() : -1);
       }
 
@@ -2812,7 +2810,7 @@
     st->print(", id=%d", osthread()->thread_id());
   }
   st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")",
-            _stack_base - _stack_size, _stack_base);
+            p2i(_stack_base - _stack_size), p2i(_stack_base));
   st->print("]");
   return;
 }
@@ -3050,15 +3048,15 @@
   template <class T> inline void do_oop_work(T* p) {
     oop obj = oopDesc::load_decode_heap_oop(p);
     if (obj == NULL) return;
-    tty->print(INTPTR_FORMAT ": ", p);
+    tty->print(INTPTR_FORMAT ": ", p2i(p));
     if (obj->is_oop_or_null()) {
       if (obj->is_objArray()) {
-        tty->print_cr("valid objArray: " INTPTR_FORMAT, (oopDesc*) obj);
+        tty->print_cr("valid objArray: " INTPTR_FORMAT, p2i(obj));
       } else {
         obj->print();
       }
     } else {
-      tty->print_cr("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj);
+      tty->print_cr("invalid oop: " INTPTR_FORMAT, p2i(obj));
     }
     tty->cr();
   }
@@ -4016,7 +4014,7 @@
   ThreadService::add_thread(p, daemon);
 
   // Possible GC point.
-  Events::log(p, "Thread added: " INTPTR_FORMAT, p);
+  Events::log(p, "Thread added: " INTPTR_FORMAT, p2i(p));
 }
 
 void Threads::remove(JavaThread* p) {
@@ -4062,7 +4060,7 @@
   } // unlock Threads_lock
 
   // Since Events::log uses a lock, we grab it outside the Threads_lock
-  Events::log(p, "Thread exited: " INTPTR_FORMAT, p);
+  Events::log(p, "Thread exited: " INTPTR_FORMAT, p2i(p));
 }
 
 // Threads_lock must be held when this is called (or must be called during a safepoint)
@@ -4305,7 +4303,7 @@
 
     st->print("%s", is_current ? "=>" : "  ");
 
-    st->print(PTR_FORMAT, thread);
+    st->print(PTR_FORMAT, p2i(thread));
     st->print(" ");
     thread->print_on_error(st, buf, buflen);
     st->cr();
@@ -4318,7 +4316,7 @@
     found_current = found_current || is_current;
     st->print("%s", current == VMThread::vm_thread() ? "=>" : "  ");
 
-    st->print(PTR_FORMAT, VMThread::vm_thread());
+    st->print(PTR_FORMAT, p2i(VMThread::vm_thread()));
     st->print(" ");
     VMThread::vm_thread()->print_on_error(st, buf, buflen);
     st->cr();
@@ -4329,14 +4327,14 @@
     found_current = found_current || is_current;
     st->print("%s", is_current ? "=>" : "  ");
 
-    st->print(PTR_FORMAT, wt);
+    st->print(PTR_FORMAT, p2i(wt));
     st->print(" ");
     wt->print_on_error(st, buf, buflen);
     st->cr();
   }
   if (!found_current) {
     st->cr();
-    st->print("=>" PTR_FORMAT " (exited) ", current);
+    st->print("=>" PTR_FORMAT " (exited) ", p2i(current));
     current->print_on_error(st, buf, buflen);
     st->cr();
   }
--- a/hotspot/src/share/vm/runtime/unhandledOops.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/unhandledOops.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -31,8 +31,6 @@
 #include "runtime/unhandledOops.hpp"
 #include "utilities/globalDefinitions.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #ifdef CHECK_UNHANDLED_OOPS
 const int free_list_size = 256;
 
@@ -52,7 +50,7 @@
 void UnhandledOops::dump_oops(UnhandledOops *list) {
   for (int k = 0; k < list->_oop_list->length(); k++) {
     UnhandledOopEntry entry = list->_oop_list->at(k);
-    tty->print(" " INTPTR_FORMAT, entry._oop_ptr);
+    tty->print(" " INTPTR_FORMAT, p2i(entry._oop_ptr));
   }
   tty->cr();
 }
@@ -68,7 +66,7 @@
   _level ++;
   if (unhandled_oop_print) {
     for (int i=0; i<_level; i++) tty->print(" ");
-    tty->print_cr("r " INTPTR_FORMAT, op);
+    tty->print_cr("r " INTPTR_FORMAT, p2i(op));
   }
   UnhandledOopEntry entry(op, pc);
   _oop_list->push(entry);
@@ -105,7 +103,7 @@
   _level --;
   if (unhandled_oop_print) {
     for (int i=0; i<_level; i++) tty->print(" ");
-    tty->print_cr("u " INTPTR_FORMAT, op);
+    tty->print_cr("u " INTPTR_FORMAT, p2i(op));
   }
 
   int i = _oop_list->find_from_end(op, match_oop_entry);
@@ -122,9 +120,9 @@
     // anymore, it must not have gotten unregistered properly and it's a bug
     // in the unhandled oop generator.
     if(!_thread->is_in_stack((address)entry._oop_ptr)) {
-      tty->print_cr("oop_ptr is " INTPTR_FORMAT, (address)entry._oop_ptr);
+      tty->print_cr("oop_ptr is " INTPTR_FORMAT, p2i(entry._oop_ptr));
       tty->print_cr("thread is " INTPTR_FORMAT " from pc " INTPTR_FORMAT,
-                     (address)_thread, (address)entry._pc);
+                     p2i(_thread), p2i(entry._pc));
       assert(false, "heap is corrupted by the unhandled oop detector");
     }
     // Set unhandled oops to a pattern that will crash distinctively
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -46,8 +46,6 @@
 #include "runtime/vframeArray.hpp"
 #include "runtime/vframe_hp.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 vframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
 : _reg_map(reg_map), _thread(thread) {
   assert(fr != NULL, "must have frame");
@@ -146,7 +144,7 @@
 
 void javaVFrame::print_locked_object_class_name(outputStream* st, Handle obj, const char* lock_state) {
   if (obj.not_null()) {
-    st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
+    st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, p2i(obj()));
     if (obj->klass() == SystemDictionary::Class_klass()) {
       st->print_cr("(a java.lang.Class for %s)", java_lang_Class::as_external_name(obj()));
     } else {
@@ -186,7 +184,7 @@
     } else if (thread()->current_park_blocker() != NULL) {
       oop obj = thread()->current_park_blocker();
       Klass* k = obj->klass();
-      st->print_cr("\t- %s <" INTPTR_FORMAT "> (a %s)", "parking to wait for ", (address)obj, k->external_name());
+      st->print_cr("\t- %s <" INTPTR_FORMAT "> (a %s)", "parking to wait for ", p2i(obj), k->external_name());
     }
   }
 
@@ -583,7 +581,7 @@
 void entryVFrame::print() {
   vframe::print();
   tty->print_cr("C Chunk inbetween Java");
-  tty->print_cr("C     link " INTPTR_FORMAT, _fr.link());
+  tty->print_cr("C     link " INTPTR_FORMAT, p2i(_fr.link()));
 }
 
 
@@ -620,7 +618,7 @@
       tty->print("( null )");
     } else {
       monitor->owner()->print_value();
-      tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner());
+      tty->print("(owner=" INTPTR_FORMAT ")", p2i(monitor->owner()));
     }
     if (monitor->eliminated()) {
       if(is_compiled_frame()) {
@@ -641,7 +639,7 @@
   Method*    m = method();
   InstanceKlass*     k = m->method_holder();
   tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
-                _fr.sp(),  _fr.unextended_sp(), _fr.fp(), _fr.pc());
+                p2i(_fr.sp()),  p2i(_fr.unextended_sp()), p2i(_fr.fp()), p2i(_fr.pc()));
   tty->print("%s.%s", k->internal_name(), m->name()->as_C_string());
 
   if (!m->is_native()) {
--- a/hotspot/src/share/vm/runtime/vframeArray.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vframeArray.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -44,8 +44,6 @@
 #include "opto/runtime.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
 
 void vframeArrayElement::free_monitors(JavaThread* jt) {
@@ -415,7 +413,7 @@
     int bci = method()->bci_from(bcp);
     tty->print(" - %s", Bytecodes::name(code));
     tty->print(" @ bci %d ", bci);
-    tty->print_cr("sp = " PTR_FORMAT, iframe()->sp());
+    tty->print_cr("sp = " PTR_FORMAT, p2i(iframe()->sp()));
   }
 #endif // PRODUCT
 
@@ -605,7 +603,7 @@
 
 // Note: we cannot have print_on as const, as we allocate inside the method
 void vframeArray::print_on_2(outputStream* st)  {
-  st->print_cr(" - sp: " INTPTR_FORMAT, sp());
+  st->print_cr(" - sp: " INTPTR_FORMAT, p2i(sp()));
   st->print(" - thread: ");
   Thread::current()->print();
   st->print_cr(" - frame size: %d", frame_size());
@@ -615,7 +613,7 @@
 }
 
 void vframeArrayElement::print(outputStream* st) {
-  st->print_cr(" - interpreter_frame -> sp: " INTPTR_FORMAT, iframe()->sp());
+  st->print_cr(" - interpreter_frame -> sp: " INTPTR_FORMAT, p2i(iframe()->sp()));
 }
 
 void vframeArray::print_value_on(outputStream* st) const {
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -41,8 +41,6 @@
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Dummy VM operation to act as first element in our circular double-linked list
 class VM_Dummy: public VM_Operation {
   VMOp_Type type() const { return VMOp_Dummy; }
@@ -410,7 +408,7 @@
           !_cur_vm_operation->evaluate_concurrently()) {
         long stall = os::javaTimeMillis() - _cur_vm_operation->timestamp();
         if (stall > 0)
-          tty->print_cr("%s stall: %Ld",  _cur_vm_operation->name(), stall);
+          tty->print_cr("%s stall: %ld",  _cur_vm_operation->name(), stall);
       }
 
       while (!should_terminate() && _cur_vm_operation == NULL) {
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -42,8 +42,6 @@
 #include "services/threadService.hpp"
 #include "trace/tracing.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 #define VM_OP_NAME_INITIALIZE(name) #name,
 
 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
@@ -79,14 +77,14 @@
 }
 // Called by fatal error handler.
 void VM_Operation::print_on_error(outputStream* st) const {
-  st->print("VM_Operation (" PTR_FORMAT "): ", this);
+  st->print("VM_Operation (" PTR_FORMAT "): ", p2i(this));
   st->print("%s", name());
 
   const char* mode = mode_to_string(evaluation_mode());
   st->print(", mode: %s", mode);
 
   if (calling_thread()) {
-    st->print(", requested by thread " PTR_FORMAT, calling_thread());
+    st->print(", requested by thread " PTR_FORMAT, p2i(calling_thread()));
   }
 }
 
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -39,8 +39,6 @@
 #include "utilities/macros.hpp"
 #include "oops/objArrayOop.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 void DCmdRegistrant::register_dcmds(){
   // Registration of the diagnostic commands
   // First argument specifies which interfaces will export the command
@@ -695,12 +693,17 @@
     // command line with -D or by managmenent.properties
     // file.
 #define PUT_OPTION(a) \
-    if ( (a).is_set() ){ \
-        options.print(\
-               ( *((a).type()) == 'I' ) ? "%scom.sun.management.%s=%d" : "%scom.sun.management.%s=%s",\
-                comma, (a).name(), (a).value()); \
-        comma[0] = ','; \
-    }
+    do { \
+        if ( (a).is_set() ){ \
+            if ( *((a).type()) == 'I' ) { \
+                options.print("%scom.sun.management.%s=" JLONG_FORMAT, comma, (a).name(), (jlong)((a).value())); \
+            } else { \
+                options.print("%scom.sun.management.%s=%s", comma, (a).name(), (char*)((a).value())); \
+            } \
+            comma[0] = ','; \
+        }\
+    } while(0);
+
 
     PUT_OPTION(_config_file);
     PUT_OPTION(_jmxremote_port);
--- a/hotspot/src/share/vm/services/management.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/services/management.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -58,8 +58,6 @@
 #include "services/threadService.hpp"
 #include "utilities/macros.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 PerfVariable* Management::_begin_vm_creation_time = NULL;
 PerfVariable* Management::_end_vm_creation_time = NULL;
 PerfVariable* Management::_vm_init_done_time = NULL;
@@ -752,7 +750,7 @@
 
   if ((size_t)threshold > max_uintx) {
     stringStream st;
-    st.print("Invalid valid threshold value. Threshold value (" UINT64_FORMAT ") > max value of size_t (" SIZE_FORMAT ")", (size_t)threshold, max_uintx);
+    st.print("Invalid valid threshold value. Threshold value (" JLONG_FORMAT ") > max value of size_t (" UINTX_FORMAT ")", threshold, max_uintx);
     THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(), st.as_string(), -1);
   }
 
--- a/hotspot/src/share/vm/services/threadService.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/services/threadService.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -39,8 +39,6 @@
 #include "runtime/vm_operations.hpp"
 #include "services/threadService.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // TODO: we need to define a naming convention for perf counters
 // to distinguish counters for:
 //   - standard JSR174 use
@@ -508,7 +506,7 @@
   for (int i = 0; i < len; i++) {
     oop o = _locked_monitors->at(i);
     InstanceKlass* ik = InstanceKlass::cast(o->klass());
-    st->print_cr("\t- locked <" INTPTR_FORMAT "> (a %s)", (address)o, ik->external_name());
+    st->print_cr("\t- locked <" INTPTR_FORMAT "> (a %s)", p2i(o), ik->external_name());
   }
 
 }
@@ -732,7 +730,7 @@
   for (int i = 0; i < locks->length(); i++) {
     instanceOop obj = locks->at(i);
     InstanceKlass* ik = InstanceKlass::cast(obj->klass());
-    st->print_cr("\t- <" INTPTR_FORMAT "> (a %s)", (address)obj, ik->external_name());
+    st->print_cr("\t- <" INTPTR_FORMAT "> (a %s)", p2i(obj), ik->external_name());
   }
   st->cr();
 }
@@ -885,10 +883,10 @@
     st->print_cr("\"%s\":", currentThread->get_thread_name());
     const char* owner_desc = ",\n  which is held by";
     if (waitingToLockMonitor != NULL) {
-      st->print("  waiting to lock monitor " INTPTR_FORMAT, waitingToLockMonitor);
+      st->print("  waiting to lock monitor " INTPTR_FORMAT, p2i(waitingToLockMonitor));
       oop obj = (oop)waitingToLockMonitor->object();
       if (obj != NULL) {
-        st->print(" (object " INTPTR_FORMAT ", a %s)", (address)obj,
+        st->print(" (object " INTPTR_FORMAT ", a %s)", p2i(obj),
                    (InstanceKlass::cast(obj->klass()))->external_name());
 
         if (!currentThread->current_pending_monitor_is_from_java()) {
@@ -907,12 +905,12 @@
         // if it is not findable, then the previous currentThread is
         // blocked permanently.
         st->print("%s UNKNOWN_owner_addr=" PTR_FORMAT, owner_desc,
-                  (address)waitingToLockMonitor->owner());
+                  p2i(waitingToLockMonitor->owner()));
         continue;
       }
     } else {
       st->print("  waiting for ownable synchronizer " INTPTR_FORMAT ", (a %s)",
-                (address)waitingToLockBlocker,
+                p2i(waitingToLockBlocker),
                 (InstanceKlass::cast(waitingToLockBlocker->klass()))->external_name());
       assert(waitingToLockBlocker->is_a(SystemDictionary::abstract_ownable_synchronizer_klass()),
              "Must be an AbstractOwnableSynchronizer");
--- a/hotspot/src/share/vm/services/writeableFlags.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -89,10 +89,7 @@
       break;
   }
 
-  PRAGMA_DIAG_PUSH
-  PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
-  err_msg.print(buffer);
-  PRAGMA_DIAG_POP
+  err_msg.print("%s", buffer);
 }
 
 // set a boolean global flag
@@ -295,7 +292,8 @@
 }
 
 // a writeable flag setter accepting 'jvalue' values
-Flag::Error WriteableFlags::set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg) {
+Flag::Error WriteableFlags::set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags origin,
+                                                 FormatBuffer<80>& err_msg) {
   jvalue new_value = *(jvalue*)value;
   if (f->is_bool()) {
     bool bvalue = (new_value.z == JNI_TRUE ? true : false);
--- a/hotspot/src/share/vm/utilities/debug.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -78,8 +78,6 @@
 #  endif
 #endif // PRODUCT
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 FormatBufferResource::FormatBufferResource(const char * format, ...)
   : FormatBufferBase((char*)resource_allocate_bytes(FormatBufferBase::BufferSize)) {
   va_list argp;
@@ -524,7 +522,7 @@
     oop obj = oop(p);
     obj->print();
   } else {
-    tty->print(PTR_FORMAT, p);
+    tty->print(PTR_FORMAT, p2i(p));
   }
 }
 
@@ -559,7 +557,7 @@
     frame f = os::current_frame();
     RegisterMap reg_map(p);
     f = f.sender(&reg_map);
-    tty->print("(guessing starting frame id=%#p based on current fp)\n", f.id());
+    tty->print("(guessing starting frame id=" PTR_FORMAT " based on current fp)\n", p2i(f.id()));
     p->trace_stack_from(vframe::new_vframe(&f, &reg_map, p));
   pd_ps(f);
 #endif // PRODUCT
--- a/hotspot/src/share/vm/utilities/exceptions.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -35,8 +35,6 @@
 #include "utilities/events.hpp"
 #include "utilities/exceptions.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Implementation of ThreadShadow
 void check_ThreadShadow() {
   const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
@@ -144,7 +142,7 @@
                   "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
                   h_exception->print_value_string(),
                   message ? ": " : "", message ? message : "",
-                  (address)h_exception(), file, line, thread);
+                  p2i(h_exception()), file, line, p2i(thread));
   }
   // for AbortVMOnException flag
   NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
@@ -167,7 +165,7 @@
   if (LogEvents){
     Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
                           h_exception->print_value_string(), message ? ": " : "", message ? message : "",
-                          (address)h_exception(), file, line);
+                          p2i(h_exception()), file, line);
   }
 }
 
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Oct 09 08:46:44 2015 +0000
@@ -60,9 +60,6 @@
 #ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
 #define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
 #endif
-#ifndef PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-#endif
 #ifndef ATTRIBUTE_PRINTF
 #define ATTRIBUTE_PRINTF(fmt, vargs)
 #endif
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Fri Oct 09 08:46:44 2015 +0000
@@ -301,10 +301,6 @@
 #define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
 #endif
 
-#ifndef __clang_major__
-#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC _Pragma("GCC diagnostic ignored \"-Wformat\"") _Pragma("GCC diagnostic error \"-Wformat-nonliteral\"") _Pragma("GCC diagnostic error \"-Wformat-security\"")
-#endif
-
 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
 #define TEMPLATE_TABLE_BUG
 #endif
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Fri Oct 09 09:00:33 2015 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Fri Oct 09 08:46:44 2015 +0000
@@ -45,8 +45,6 @@
 #include "utilities/top.hpp"
 #include "utilities/vmError.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // List of environment variables that should be reported in error log file.
 const char *env_list[] = {
   // All platforms
@@ -284,14 +282,14 @@
   // error handler after a secondary crash works.
   STEP(20, "(test secondary crash 1)")
     if (_verbose && TestCrashInErrorHandler != 0) {
-      st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
+      st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
 
   STEP(30, "(test secondary crash 2)")
     if (_verbose && TestCrashInErrorHandler != 0) {
-      st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
+      st->print_cr("Will crash now (TestCrashInErrorHandler=" UINTX_FORMAT ")...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
@@ -360,7 +358,7 @@
      if (os::exception_name(_id, buf, sizeof(buf))) {
        st->print("%s", buf);
        st->print(" (0x%x)", _id);                // signal number
-       st->print(" at pc=" PTR_FORMAT, _pc);
+       st->print(" at pc=" PTR_FORMAT, p2i(_pc));
      } else {
        if (should_report_bug(_id)) {
          st->print("Internal Error");
@@ -495,7 +493,7 @@
      // current thread
      if (_verbose) {
        if (_thread) {
-         st->print("Current thread (" PTR_FORMAT "):  ", _thread);
+         st->print("Current thread (" PTR_FORMAT "):  ", p2i(_thread));
          _thread->print_on_error(st, buf, sizeof(buf));
          st->cr();
        } else {
@@ -534,13 +532,13 @@
        }
 
        address stack_bottom = stack_top - stack_size;
-       st->print("[" PTR_FORMAT "," PTR_FORMAT "]", stack_bottom, stack_top);
+       st->print("[" PTR_FORMAT "," PTR_FORMAT "]", p2i(stack_bottom), p2i(stack_top));
 
        frame fr = _context ? os::fetch_frame_from_context(_context)
                            : os::current_frame();
 
        if (fr.sp()) {
-         st->print(",  sp=" PTR_FORMAT, fr.sp());
+         st->print(",  sp=" PTR_FORMAT, p2i(fr.sp()));
          size_t free_stack_size = pointer_delta(fr.sp(), stack_bottom, 1024);
          st->print(",  free space=" SIZE_FORMAT "k", free_stack_size);
        }
@@ -574,7 +572,7 @@
      if (_verbose && _thread && (_thread->is_Named_thread())) {
        JavaThread*  jt = ((NamedThread *)_thread)->processed_thread();
        if (jt != NULL) {
-         st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id());
+         st->print_cr("JavaThread " PTR_FORMAT " (nid = %d) was being processed", p2i(jt), jt->osthread()->thread_id());
          print_stack_trace(st, jt, buf, sizeof(buf), true);
        }
      }
@@ -686,7 +684,7 @@
        Universe::heap()->print_on_error(st);
        st->cr();
 
-       st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page());
+       st->print_cr("Polling page: " INTPTR_FORMAT, p2i(os::get_polling_page()));
        st->cr();
      }