8076073: shared: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
authordavid
Fri, 27 Mar 2015 15:29:19 +0100
changeset 29800 fa5f7a2bf717
parent 29799 3ad47a56094a
child 29801 2e4a5be5a595
8076073: shared: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files Reviewed-by: stefank, brutisso
hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp
hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp
hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp
hotspot/src/share/vm/memory/defNewGeneration.cpp
hotspot/src/share/vm/memory/genCollectedHeap.cpp
hotspot/src/share/vm/memory/generation.cpp
hotspot/src/share/vm/memory/generation.hpp
hotspot/src/share/vm/memory/heapInspection.cpp
hotspot/src/share/vm/memory/metachunk.cpp
hotspot/src/share/vm/memory/metaspace.cpp
hotspot/src/share/vm/memory/referenceProcessor.cpp
hotspot/src/share/vm/memory/sharedHeap.cpp
hotspot/src/share/vm/memory/space.cpp
hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
hotspot/src/share/vm/memory/universe.cpp
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -32,8 +32,6 @@
 #include "oops/objArrayKlass.inline.hpp"
 #include "oops/oop.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 uint                    MarkSweep::_total_invocations = 0;
 
 Stack<oop, mtGC>              MarkSweep::_marking_stack;
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -31,8 +31,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/thread.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) {
   _lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true);
   _page_size = os::vm_page_size();
@@ -973,7 +971,7 @@
       break;
     }
     if (e != scan_end) {
-      assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, e, scan_end));
+      assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, p2i(e), p2i(scan_end)));
 
       if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
           && page_expected.size != 0) {
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -33,8 +33,6 @@
 #include "runtime/thread.hpp"
 #endif // INCLUDE_ALL_GCS
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
   assert(MutableSpace::alignment() % os::vm_page_size() == 0,
          "Space should be aligned");
@@ -253,7 +251,7 @@
 void MutableSpace::print_on(outputStream* st) const {
   MutableSpace::print_short_on(st);
   st->print_cr(" [" INTPTR_FORMAT "," INTPTR_FORMAT "," INTPTR_FORMAT ")",
-                 bottom(), top(), end());
+                 p2i(bottom()), p2i(top()), p2i(end()));
 }
 
 void MutableSpace::verify() {
--- a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -27,8 +27,6 @@
 #include "memory/space.inline.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Catch-all file for utility classes
 
 #ifndef PRODUCT
@@ -86,7 +84,7 @@
   assert(ZapUnusedHeapArea, "Mangling should not be in use");
 #ifdef ASSERT
   if(TraceZapUnusedHeapArea) {
-    gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", mr.start(), mr.end());
+    gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end()));
   }
   Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord);
   if(TraceZapUnusedHeapArea) {
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -49,8 +49,6 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/stack.inline.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 //
 // DefNewGeneration functions.
 
@@ -137,7 +135,7 @@
   if (TraceScavenge) {
     ResourceMark rm;
     gclog_or_tty->print_cr("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s",
-                           klass,
+                           p2i(klass),
                            klass->external_name(),
                            klass->has_modified_oops() ? "true" : "false");
   }
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -1337,7 +1337,7 @@
   // back a time later than 'now'.
   jlong retVal = now - tolgc_cl.time();
   if (retVal < 0) {
-    NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);)
+    NOT_PRODUCT(warning("time warp: " JLONG_FORMAT, retVal);)
     return 0;
   }
   return retVal;
--- a/hotspot/src/share/vm/memory/generation.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/generation.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -42,8 +42,6 @@
 #include "utilities/copy.hpp"
 #include "utilities/events.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
   _level(level),
   _ref_processor(NULL) {
@@ -103,9 +101,9 @@
   st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
              capacity()/K, used()/K);
   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
-              _virtual_space.low_boundary(),
-              _virtual_space.high(),
-              _virtual_space.high_boundary());
+              p2i(_virtual_space.low_boundary()),
+              p2i(_virtual_space.high()),
+              p2i(_virtual_space.high_boundary()));
 }
 
 void Generation::print_summary_info() { print_summary_info_on(tty); }
--- a/hotspot/src/share/vm/memory/generation.hpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/generation.hpp	Fri Mar 27 15:29:19 2015 +0100
@@ -399,7 +399,7 @@
     // have to guard against non-monotonicity.
     NOT_PRODUCT(
       if (now < _time_of_last_gc) {
-        warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, (int64_t)_time_of_last_gc, (int64_t)now);
+        warning("time warp: " JLONG_FORMAT " to " JLONG_FORMAT, _time_of_last_gc, now);
       }
     )
     return _time_of_last_gc;
--- a/hotspot/src/share/vm/memory/heapInspection.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -38,8 +38,6 @@
 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #endif // INCLUDE_ALL_GCS
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // HeapInspection
 
 inline KlassInfoEntry::~KlassInfoEntry() {
@@ -100,8 +98,8 @@
 
   // simplify the formatting (ILP32 vs LP64) - always cast the numbers to 64-bit
   st->print_cr(INT64_FORMAT_W(13) "  " UINT64_FORMAT_W(13) "  %s",
-               (jlong)  _instance_count,
-               (julong) _instance_words * HeapWordSize,
+               (int64_t)_instance_count,
+               (uint64_t)_instance_words * HeapWordSize,
                name());
 }
 
@@ -240,8 +238,8 @@
 
 void KlassInfoHisto::print_elements(outputStream* st) const {
   // simplify the formatting (ILP32 vs LP64) - store the sum in 64-bit
-  jlong total = 0;
-  julong totalw = 0;
+  int64_t total = 0;
+  uint64_t totalw = 0;
   for(int i=0; i < elements()->length(); i++) {
     st->print("%4d: ", i+1);
     elements()->at(i)->print_on(st);
@@ -451,7 +449,7 @@
   if (loader_oop == NULL) {
     st->print("null");
   } else {
-    st->print(INTPTR_FORMAT, klass->class_loader_data());
+    st->print(INTPTR_FORMAT, p2i(klass->class_loader_data()));
   }
 }
 
@@ -557,13 +555,13 @@
         }
 
         if (csv_format) {
-          st->print("%d,%d", e->index(), super_index);
+          st->print("%ld,%d", e->index(), super_index);
           for (int c=0; c<KlassSizeStats::_num_columns; c++) {
             if (selected[c]) {st->print("," JULONG_FORMAT, col_table[c]);}
           }
           st->print(",%s",e->name());
         } else {
-          st->print("%5d %5d", e->index(), super_index);
+          st->print("%5ld %5d", e->index(), super_index);
           for (int c=0; c<KlassSizeStats::_num_columns; c++) {
             if (selected[c]) {print_julong(st, width_table[c], col_table[c]);}
           }
--- a/hotspot/src/share/vm/memory/metachunk.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/metachunk.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -28,8 +28,6 @@
 #include "utilities/copy.hpp"
 #include "utilities/debug.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 class VirtualSpaceNode;
 
 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
@@ -92,7 +90,7 @@
   st->print_cr("Metachunk:"
                " bottom " PTR_FORMAT " top " PTR_FORMAT
                " end " PTR_FORMAT " size " SIZE_FORMAT,
-               bottom(), _top, end(), word_size());
+               p2i(bottom()), p2i(_top), p2i(end()), word_size());
   if (Verbose) {
     st->print_cr("    used " SIZE_FORMAT " free " SIZE_FORMAT,
                  used_word_size(), free_word_size());
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -49,8 +49,6 @@
 #include "utilities/debug.hpp"
 #include "utilities/macros.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary;
 typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary;
 
@@ -388,7 +386,7 @@
 #define assert_is_ptr_aligned(ptr, alignment) \
   assert(is_ptr_aligned(ptr, alignment),      \
     err_msg(PTR_FORMAT " is not aligned to "  \
-      SIZE_FORMAT, ptr, alignment))
+      SIZE_FORMAT, p2i(ptr), alignment))
 
 #define assert_is_size_aligned(size, alignment) \
   assert(is_size_aligned(size, alignment),      \
@@ -800,7 +798,7 @@
   _container_count++;
   assert(_container_count == container_count_slow(),
          err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT
-                 " container_count_slow() " SIZE_FORMAT,
+                 " container_count_slow() %u",
                  _container_count, container_count_slow()));
 }
 
@@ -813,7 +811,7 @@
 void VirtualSpaceNode::verify_container_count() {
   assert(_container_count == container_count_slow(),
     err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT
-            " container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow()));
+            " container_count_slow() %u", _container_count, container_count_slow()));
 }
 #endif
 
@@ -916,7 +914,7 @@
 
   if (!is_available(chunk_word_size)) {
     if (TraceMetadataChunkAllocation) {
-      gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available %d words ", chunk_word_size);
+      gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
       // Dump some information about the virtual space that is nearly full
       print_on(gclog_or_tty);
     }
@@ -989,7 +987,7 @@
 
     assert(reserved()->start() == (HeapWord*) _rs.base(),
       err_msg("Reserved start was not set properly " PTR_FORMAT
-        " != " PTR_FORMAT, reserved()->start(), _rs.base()));
+        " != " PTR_FORMAT, p2i(reserved()->start()), p2i(_rs.base())));
     assert(reserved()->word_size() == _rs.size() / BytesPerWord,
       err_msg("Reserved size was not set properly " SIZE_FORMAT
         " != " SIZE_FORMAT, reserved()->word_size(),
@@ -1003,13 +1001,13 @@
   size_t used = used_words_in_vs();
   size_t capacity = capacity_words_in_vs();
   VirtualSpace* vs = virtual_space();
-  st->print_cr("   space @ " PTR_FORMAT " " SIZE_FORMAT "K, %3d%% used "
+  st->print_cr("   space @ " PTR_FORMAT " " SIZE_FORMAT "K, " SIZE_FORMAT_W(3) "%% used "
            "[" PTR_FORMAT ", " PTR_FORMAT ", "
            PTR_FORMAT ", " PTR_FORMAT ")",
-           vs, capacity / K,
+           p2i(vs), capacity / K,
            capacity == 0 ? 0 : used * 100 / capacity,
-           bottom(), top(), end(),
-           vs->high_boundary());
+           p2i(bottom()), p2i(top()), p2i(end()),
+           p2i(vs->high_boundary()));
 }
 
 #ifdef ASSERT
@@ -1812,7 +1810,7 @@
     if (TraceMetadataChunkAllocation && Verbose) {
       gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list "
                              PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT,
-                             free_list, chunk, chunk->word_size());
+                             p2i(free_list), p2i(chunk), chunk->word_size());
     }
   } else {
     chunk = humongous_dictionary()->get_chunk(
@@ -1872,7 +1870,7 @@
     }
     gclog_or_tty->print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk "
                         PTR_FORMAT "  size " SIZE_FORMAT " count " SIZE_FORMAT " ",
-                        this, chunk, chunk->word_size(), list_count);
+                        p2i(this), p2i(chunk), chunk->word_size(), list_count);
     locked_print_free_chunks(gclog_or_tty);
   }
 
@@ -2019,7 +2017,7 @@
   for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) {
     Metachunk* chunk = chunks_in_use(i);
     st->print("SpaceManager: %s " PTR_FORMAT,
-                 chunk_size_name(i), chunk);
+                 chunk_size_name(i), p2i(chunk));
     if (chunk != NULL) {
       st->print_cr(" free " SIZE_FORMAT,
                    chunk->free_word_size());
@@ -2130,8 +2128,8 @@
   for (ChunkIndex i = ZeroIndex;
        i < NumberOfInUseLists ;
        i = next_chunk_index(i) ) {
-    st->print_cr("  chunks_in_use " PTR_FORMAT " chunk size " PTR_FORMAT,
-                 chunks_in_use(i),
+    st->print_cr("  chunks_in_use " PTR_FORMAT " chunk size " SIZE_FORMAT,
+                 p2i(chunks_in_use(i)),
                  chunks_in_use(i) == NULL ? 0 : chunks_in_use(i)->word_size());
   }
   st->print_cr("    waste:  Small " SIZE_FORMAT " Medium " SIZE_FORMAT
@@ -2194,7 +2192,7 @@
   }
   _current_chunk = NULL;
   if (TraceMetadataChunkAllocation && Verbose) {
-    gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, this);
+    gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, p2i(this));
   }
 }
 
@@ -2238,7 +2236,7 @@
   dec_total_from_size_metrics();
 
   if (TraceMetadataChunkAllocation && Verbose) {
-    gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, this);
+    gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, p2i(this));
     locked_print_chunks_in_use_on(gclog_or_tty);
   }
 
@@ -2258,7 +2256,7 @@
 
   for (ChunkIndex i = ZeroIndex; i < HumongousIndex; i = next_chunk_index(i)) {
     if (TraceMetadataChunkAllocation && Verbose) {
-      gclog_or_tty->print_cr("returned %d %s chunks to freelist",
+      gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s chunks to freelist",
                              sum_count_in_chunks_in_use(i),
                              chunk_size_name(i));
     }
@@ -2266,7 +2264,7 @@
     chunk_manager()->return_chunks(i, chunks);
     set_chunks_in_use(i, NULL);
     if (TraceMetadataChunkAllocation && Verbose) {
-      gclog_or_tty->print_cr("updated freelist count %d %s",
+      gclog_or_tty->print_cr("updated freelist count " SSIZE_FORMAT " %s",
                              chunk_manager()->free_chunks(i)->count(),
                              chunk_size_name(i));
     }
@@ -2279,7 +2277,7 @@
 
   // Humongous chunks
   if (TraceMetadataChunkAllocation && Verbose) {
-    gclog_or_tty->print_cr("returned %d %s humongous chunks to dictionary",
+    gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s humongous chunks to dictionary",
                             sum_count_in_chunks_in_use(HumongousIndex),
                             chunk_size_name(HumongousIndex));
     gclog_or_tty->print("Humongous chunk dictionary: ");
@@ -2293,14 +2291,14 @@
 #endif
     if (TraceMetadataChunkAllocation && Verbose) {
       gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ",
-                          humongous_chunks,
+                          p2i(humongous_chunks),
                           humongous_chunks->word_size());
     }
     assert(humongous_chunks->word_size() == (size_t)
            align_size_up(humongous_chunks->word_size(),
                              smallest_chunk_size()),
            err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT
-                   " granularity %d",
+                   " granularity " SIZE_FORMAT,
                    humongous_chunks->word_size(), smallest_chunk_size()));
     Metachunk* next_humongous_chunks = humongous_chunks->next();
     humongous_chunks->container()->dec_container_count();
@@ -2309,7 +2307,7 @@
   }
   if (TraceMetadataChunkAllocation && Verbose) {
     gclog_or_tty->cr();
-    gclog_or_tty->print_cr("updated dictionary count %d %s",
+    gclog_or_tty->print_cr("updated dictionary count " SIZE_FORMAT " %s",
                      chunk_manager()->humongous_dictionary()->total_count(),
                      chunk_size_name(HumongousIndex));
   }
@@ -2399,7 +2397,7 @@
 
   assert(new_chunk->is_empty(), "Not ready for reuse");
   if (TraceMetadataChunkAllocation && Verbose) {
-    gclog_or_tty->print("SpaceManager::add_chunk: %d) ",
+    gclog_or_tty->print("SpaceManager::add_chunk: " SIZE_FORMAT ") ",
                         sum_count_in_chunks_in_use());
     new_chunk->print_on(gclog_or_tty);
     chunk_manager()->locked_print_free_chunks(gclog_or_tty);
@@ -3097,7 +3095,7 @@
       metaspace_rs = ReservedSpace(compressed_class_space_size(),
                                    _reserve_alignment, large_pages);
       if (!metaspace_rs.is_reserved()) {
-        vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes",
+        vm_exit_during_initialization(err_msg("Could not allocate metaspace: " SIZE_FORMAT " bytes",
                                               compressed_class_space_size()));
       }
     }
@@ -3119,10 +3117,10 @@
   initialize_class_space(metaspace_rs);
 
   if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
-    gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT,
-                            Universe::narrow_klass_base(), Universe::narrow_klass_shift());
+    gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: %d",
+                            p2i(Universe::narrow_klass_base()), Universe::narrow_klass_shift());
     gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT,
-                           compressed_class_space_size(), metaspace_rs.base(), requested_addr);
+                           compressed_class_space_size(), p2i(metaspace_rs.base()), p2i(requested_addr));
   }
 }
 
@@ -3251,7 +3249,7 @@
       vm_exit_during_initialization("Unable to dump shared archive.",
           err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space ("
                   SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed "
-                  "klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(),
+                  "klass limit: " UINT64_FORMAT, cds_total, compressed_class_space_size(),
                   cds_total + compressed_class_space_size(), UnscaledClassSpaceMax));
     }
 
@@ -3262,7 +3260,7 @@
     Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom());
     if (TraceMetavirtualspaceAllocation && Verbose) {
       gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT,
-                             _space_list->current_virtual_space()->bottom());
+                             p2i(_space_list->current_virtual_space()->bottom()));
     }
 
     Universe::set_narrow_klass_shift(0);
@@ -3768,10 +3766,10 @@
 }
 
 void Metaspace::dump(outputStream* const out) const {
-  out->print_cr("\nVirtual space manager: " INTPTR_FORMAT, vsm());
+  out->print_cr("\nVirtual space manager: " INTPTR_FORMAT, p2i(vsm()));
   vsm()->dump(out);
   if (using_class_space()) {
-    out->print_cr("\nClass space manager: " INTPTR_FORMAT, class_vsm());
+    out->print_cr("\nClass space manager: " INTPTR_FORMAT, p2i(class_vsm()));
     class_vsm()->dump(out);
   }
 }
@@ -3932,13 +3930,13 @@
   assert(vsn.is_available(word_size), \
     err_msg(#word_size ": " PTR_FORMAT " bytes were not available in " \
             "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \
-            (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end()));
+            (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())));
 
 #define assert_is_available_negative(word_size) \
   assert(!vsn.is_available(word_size), \
     err_msg(#word_size ": " PTR_FORMAT " bytes should not be available in " \
             "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \
-            (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end()));
+            (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())));
 
   static void test_is_available_positive() {
     // Reserve some memory.
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -35,8 +35,6 @@
 #include "runtime/java.hpp"
 #include "runtime/jniHandles.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy      = NULL;
 bool             ReferenceProcessor::_pending_list_uses_discovered_field = false;
@@ -161,7 +159,7 @@
 
   NOT_PRODUCT(
   if (now < _soft_ref_timestamp_clock) {
-    warning("time warp: "INT64_FORMAT" to "INT64_FORMAT,
+    warning("time warp: " JLONG_FORMAT " to " JLONG_FORMAT,
             _soft_ref_timestamp_clock, now);
   }
   )
@@ -361,7 +359,7 @@
   // field.
   if (TraceReferenceGC && PrintGCDetails) {
     gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list "
-                           INTPTR_FORMAT, (address)refs_list.head());
+                           INTPTR_FORMAT, p2i(refs_list.head()));
   }
 
   oop obj = NULL;
@@ -375,7 +373,7 @@
       next_d = java_lang_ref_Reference::discovered(obj);
       if (TraceReferenceGC && PrintGCDetails) {
         gclog_or_tty->print_cr("        obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
-                               (void *)obj, (void *)next_d);
+                               p2i(obj), p2i(next_d));
       }
       assert(java_lang_ref_Reference::next(obj) == NULL,
              "Reference not active; should not be discovered");
@@ -402,7 +400,7 @@
       next_d = java_lang_ref_Reference::discovered(obj);
       if (TraceReferenceGC && PrintGCDetails) {
         gclog_or_tty->print_cr("        obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
-                               (void *)obj, (void *)next_d);
+                               p2i(obj), p2i(next_d));
       }
       assert(java_lang_ref_Reference::next(obj) == NULL,
              "The reference should not be enqueued");
@@ -565,7 +563,7 @@
         !policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) {
       if (TraceReferenceGC) {
         gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s"  ") by policy",
-                               (void *)iter.obj(), iter.obj()->klass()->internal_name());
+                               p2i(iter.obj()), iter.obj()->klass()->internal_name());
       }
       // Remove Reference object from list
       iter.remove();
@@ -582,9 +580,9 @@
   complete_gc->do_void();
   NOT_PRODUCT(
     if (PrintGCDetails && TraceReferenceGC) {
-      gclog_or_tty->print_cr(" Dropped %d dead Refs out of %d "
-        "discovered Refs by policy, from list " INTPTR_FORMAT,
-        iter.removed(), iter.processed(), (address)refs_list.head());
+      gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT
+        " discovered Refs by policy, from list " INTPTR_FORMAT,
+        iter.removed(), iter.processed(), p2i(refs_list.head()));
     }
   )
 }
@@ -604,7 +602,7 @@
     if (iter.is_referent_alive()) {
       if (TraceReferenceGC) {
         gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)",
-                               (void *)iter.obj(), iter.obj()->klass()->internal_name());
+                               p2i(iter.obj()), iter.obj()->klass()->internal_name());
       }
       // The referent is reachable after all.
       // Remove Reference object from list.
@@ -620,9 +618,9 @@
   }
   NOT_PRODUCT(
     if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
-      gclog_or_tty->print_cr(" Dropped %d active Refs out of %d "
-        "Refs in discovered list " INTPTR_FORMAT,
-        iter.removed(), iter.processed(), (address)refs_list.head());
+      gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT
+        " Refs in discovered list " INTPTR_FORMAT,
+        iter.removed(), iter.processed(), p2i(refs_list.head()));
     }
   )
 }
@@ -659,9 +657,9 @@
   complete_gc->do_void();
   NOT_PRODUCT(
     if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
-      gclog_or_tty->print_cr(" Dropped %d active Refs out of %d "
-        "Refs in discovered list " INTPTR_FORMAT,
-        iter.removed(), iter.processed(), (address)refs_list.head());
+      gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT
+        " Refs in discovered list " INTPTR_FORMAT,
+        iter.removed(), iter.processed(), p2i(refs_list.head()));
     }
   )
 }
@@ -690,7 +688,7 @@
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending",
                              clear_referent ? "cleared " : "",
-                             (void *)iter.obj(), iter.obj()->klass()->internal_name());
+                             p2i(iter.obj()), iter.obj()->klass()->internal_name());
     }
     assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference");
     iter.next();
@@ -807,11 +805,11 @@
   for (uint i = 0; i < _max_num_q; ++i) {
     total_refs += ref_lists[i].length();
     if (TraceReferenceGC && PrintGCDetails) {
-      gclog_or_tty->print("%d ", ref_lists[i].length());
+      gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length());
     }
   }
   if (TraceReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print_cr(" = %d", total_refs);
+    gclog_or_tty->print_cr(" = " SIZE_FORMAT, total_refs);
   }
   size_t avg_refs = total_refs / _num_q + 1;
   uint to_idx = 0;
@@ -877,11 +875,11 @@
   for (uint i = 0; i < _max_num_q; ++i) {
     balanced_total_refs += ref_lists[i].length();
     if (TraceReferenceGC && PrintGCDetails) {
-      gclog_or_tty->print("%d ", ref_lists[i].length());
+      gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length());
     }
   }
   if (TraceReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print_cr(" = %d", balanced_total_refs);
+    gclog_or_tty->print_cr(" = " SIZE_FORMAT, balanced_total_refs);
     gclog_or_tty->flush();
   }
   assert(total_refs == balanced_total_refs, "Balancing was incomplete");
@@ -923,7 +921,7 @@
   size_t total_list_count = total_count(refs_lists);
 
   if (PrintReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print(", %u refs", total_list_count);
+    gclog_or_tty->print(", " SIZE_FORMAT " refs", total_list_count);
   }
 
   // Phase 1 (soft refs only):
@@ -1016,7 +1014,7 @@
       ShouldNotReachHere();
   }
   if (TraceReferenceGC && PrintGCDetails) {
-    gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, list);
+    gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list));
   }
   return list;
 }
@@ -1043,14 +1041,14 @@
 
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
-                             (void *)obj, obj->klass()->internal_name());
+                             p2i(obj), obj->klass()->internal_name());
     }
   } else {
     // If retest was non NULL, another thread beat us to it:
     // The reference has already been discovered...
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
-                             (void *)obj, obj->klass()->internal_name());
+                             p2i(obj), obj->klass()->internal_name());
     }
   }
 }
@@ -1065,7 +1063,7 @@
   assert(da ? referent->is_oop() : referent->is_oop_or_null(),
          err_msg("Bad referent " INTPTR_FORMAT " found in Reference "
                  INTPTR_FORMAT " during %satomic discovery ",
-                 (void *)referent, (void *)obj, da ? "" : "non-"));
+                 p2i(referent), p2i(obj), da ? "" : "non-"));
 }
 #endif
 
@@ -1145,7 +1143,7 @@
     // The reference has already been discovered...
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
-                             (void *)obj, obj->klass()->internal_name());
+                             p2i(obj), obj->klass()->internal_name());
     }
     if (RefDiscoveryPolicy == ReferentBasedDiscovery) {
       // assumes that an object is not processed twice;
@@ -1203,7 +1201,7 @@
 
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)",
-                                (void *)obj, obj->klass()->internal_name());
+                                p2i(obj), obj->klass()->internal_name());
     }
   }
   assert(obj->is_oop(), "Discovered a bad reference");
@@ -1314,7 +1312,7 @@
       // active; we need to trace and mark its cohort.
       if (TraceReferenceGC) {
         gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)",
-                               (void *)iter.obj(), iter.obj()->klass()->internal_name());
+                               p2i(iter.obj()), iter.obj()->klass()->internal_name());
       }
       // Remove Reference object from list
       iter.remove();
@@ -1337,9 +1335,9 @@
 
   NOT_PRODUCT(
     if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) {
-      gclog_or_tty->print_cr(" Dropped %d Refs out of %d "
-        "Refs in discovered list " INTPTR_FORMAT,
-        iter.removed(), iter.processed(), (address)refs_list.head());
+      gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT
+        " Refs in discovered list " INTPTR_FORMAT,
+        iter.removed(), iter.processed(), p2i(refs_list.head()));
     }
   )
 }
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -35,8 +35,6 @@
 #include "utilities/copy.hpp"
 #include "utilities/workgroup.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 SharedHeap* SharedHeap::_sh;
 
 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
--- a/hotspot/src/share/vm/memory/space.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/space.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -44,8 +44,6 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
                                                 HeapWord* top_obj) {
   if (top_obj != NULL) {
@@ -456,20 +454,20 @@
 void Space::print_on(outputStream* st) const {
   print_short_on(st);
   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ")",
-                bottom(), end());
+                p2i(bottom()), p2i(end()));
 }
 
 void ContiguousSpace::print_on(outputStream* st) const {
   print_short_on(st);
   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
-                bottom(), top(), end());
+                p2i(bottom()), p2i(top()), p2i(end()));
 }
 
 void OffsetTableContigSpace::print_on(outputStream* st) const {
   print_short_on(st);
   st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
                 INTPTR_FORMAT ", " INTPTR_FORMAT ")",
-              bottom(), top(), _offsets.threshold(), end());
+              p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
 }
 
 void ContiguousSpace::verify() const {
@@ -592,7 +590,7 @@
 HeapWord* ContiguousSpace::block_start_const(const void* p) const {
   assert(MemRegion(bottom(), end()).contains(p),
          err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
-                  p, bottom(), end()));
+                  p2i(p), p2i(bottom()), p2i(end())));
   if (p >= top()) {
     return top();
   } else {
@@ -603,7 +601,7 @@
       cur += oop(cur)->size();
     }
     assert(oop(last)->is_oop(),
-           err_msg(PTR_FORMAT " should be an object start", last));
+           err_msg(PTR_FORMAT " should be an object start", p2i(last)));
     return last;
   }
 }
@@ -611,15 +609,15 @@
 size_t ContiguousSpace::block_size(const HeapWord* p) const {
   assert(MemRegion(bottom(), end()).contains(p),
          err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
-                  p, bottom(), end()));
+                  p2i(p), p2i(bottom()), p2i(end())));
   HeapWord* current_top = top();
   assert(p <= current_top,
          err_msg("p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT,
-                  p, current_top));
+                  p2i(p), p2i(current_top)));
   assert(p == current_top || oop(p)->is_oop(),
          err_msg("p (" PTR_FORMAT ") is not a block start - "
                  "current_top: " PTR_FORMAT ", is_oop: %s",
-                 p, current_top, BOOL_TO_STR(oop(p)->is_oop())));
+                 p2i(p), p2i(current_top), BOOL_TO_STR(oop(p)->is_oop())));
   if (p < current_top) {
     return oop(p)->size();
   } else {
--- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -31,8 +31,6 @@
 #include "runtime/thread.inline.hpp"
 #include "utilities/copy.hpp"
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Thread-Local Edens support
 
 // static member initialization
@@ -154,7 +152,7 @@
   if (PrintTLAB && Verbose) {
     gclog_or_tty->print("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]"
                         " refills %d  alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT "\n",
-                        myThread(), myThread()->osthread()->thread_id(),
+                        p2i(myThread()), myThread()->osthread()->thread_id(),
                         _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size);
   }
   set_desired_size(aligned_new_size);
@@ -263,7 +261,7 @@
                       " slow allocs: %d  refill waste: " SIZE_FORMAT "B"
                       " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
                       " slow: %dB fast: %dB\n",
-                      tag, thrd, thrd->osthread()->thread_id(),
+                      tag, p2i(thrd), thrd->osthread()->thread_id(),
                       _desired_size / (K / HeapWordSize),
                       _slow_allocations, _refill_waste_limit * HeapWordSize,
                       _allocation_fraction.average(),
--- a/hotspot/src/share/vm/memory/universe.cpp	Fri Mar 27 15:27:14 2015 +0100
+++ b/hotspot/src/share/vm/memory/universe.cpp	Fri Mar 27 15:29:19 2015 +0100
@@ -84,8 +84,6 @@
 #include "classfile/sharedClassUtil.hpp"
 #endif
 
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
 // Known objects
 Klass* Universe::_boolArrayKlassObj                 = NULL;
 Klass* Universe::_byteArrayKlassObj                 = NULL;
@@ -792,12 +790,12 @@
 void Universe::print_compressed_oops_mode() {
   tty->cr();
   tty->print("heap address: " PTR_FORMAT ", size: " SIZE_FORMAT " MB",
-              Universe::heap()->base(), Universe::heap()->reserved_region().byte_size()/M);
+              p2i(Universe::heap()->base()), Universe::heap()->reserved_region().byte_size()/M);
 
   tty->print(", Compressed Oops mode: %s", narrow_oop_mode_to_string(narrow_oop_mode()));
 
   if (Universe::narrow_oop_base() != 0) {
-    tty->print(": " PTR_FORMAT, Universe::narrow_oop_base());
+    tty->print(": " PTR_FORMAT, p2i(Universe::narrow_oop_base()));
   }
 
   if (Universe::narrow_oop_shift() != 0) {