Merge
authorkvn
Wed, 05 Jul 2017 20:16:26 -0700
changeset 46633 5b87fe93ef6d
parent 46632 cef226af6c02 (current diff)
parent 46631 80fb47701dba (diff)
child 46634 f0fb6b3c47d2
Merge
hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
hotspot/src/share/vm/runtime/arguments.cpp
--- a/hotspot/make/gensrc/GensrcAdlc.gmk	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/make/gensrc/GensrcAdlc.gmk	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@
       OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
       PROGRAM := adlc, \
       DEBUG_SYMBOLS := false, \
-      DISABLED_WARNINGS_clang := parentheses tautological-compare, \
+      DISABLED_WARNINGS_clang := tautological-compare, \
       DISABLED_WARNINGS_solstudio := notemsource, \
   ))
 
--- a/hotspot/make/lib/CompileGtest.gmk	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/make/lib/CompileGtest.gmk	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,8 @@
 	$(call create-mapfile)
 endif
 
-# Disabling switch warning for clang because of test source.
+# Disabling undef, switch, format-nonliteral and tautological-undefined-compare
+# warnings for clang because of test source.
 
 # Note: On AIX, the gtest test classes linked into the libjvm.so push the TOC
 # size beyond 64k, so we need to link with bigtoc. However, this means that
--- a/hotspot/make/lib/CompileJvm.gmk	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/make/lib/CompileJvm.gmk	Wed Jul 05 20:16:26 2017 -0700
@@ -218,9 +218,7 @@
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
-    DISABLED_WARNINGS_clang := delete-non-virtual-dtor dynamic-class-memaccess \
-        empty-body format logical-op-parentheses parentheses \
-        parentheses-equality switch tautological-compare, \
+    DISABLED_WARNINGS_clang := tautological-compare, \
     DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
         1540-1088 1500-010, \
     ASFLAGS := $(JVM_ASFLAGS), \
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1160,6 +1160,8 @@
         __ xorptr(dest->as_register(), dest->as_register());
       }
       break;
+   default:
+     break;
   }
 
   PatchingStub* patch = NULL;
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -649,8 +649,8 @@
     case doubleTag:  do_ArithmeticOp_FPU(x);  return;
     case longTag:    do_ArithmeticOp_Long(x); return;
     case intTag:     do_ArithmeticOp_Int(x);  return;
+    default:         ShouldNotReachHere();    return;
   }
-  ShouldNotReachHere();
 }
 
 
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -826,6 +826,9 @@
     case lir_fld:
       assert(false, "operations only inserted by FpuStackAllocator");
       break;
+
+    default:
+      break;
   }
 }
 #endif
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,6 +92,8 @@
       }
       break;
     }
+    default:
+      break;
   }
 }
 
--- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -121,7 +121,8 @@
     case T_CHAR:    slow_case_addr = jni_GetCharField_addr();    break;
     case T_SHORT:   slow_case_addr = jni_GetShortField_addr();   break;
     case T_INT:     slow_case_addr = jni_GetIntField_addr();     break;
-    case T_LONG:    slow_case_addr = jni_GetLongField_addr();
+    case T_LONG:    slow_case_addr = jni_GetLongField_addr();    break;
+    default:                                                     break;
   }
   // tail call
   __ jump (ExternalAddress(slow_case_addr));
@@ -215,7 +216,8 @@
   address slow_case_addr = NULL;
   switch (type) {
     case T_FLOAT:     slow_case_addr = jni_GetFloatField_addr();  break;
-    case T_DOUBLE:    slow_case_addr = jni_GetDoubleField_addr();
+    case T_DOUBLE:    slow_case_addr = jni_GetDoubleField_addr(); break;
+    default:                                                      break;
   }
   // tail call
   __ jump (ExternalAddress(slow_case_addr));
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -894,7 +894,7 @@
 void MacroAssembler::print_state64(int64_t pc, int64_t regs[]) {
   ttyLocker ttyl;
   FlagSetting fs(Debugging, true);
-  tty->print_cr("rip = 0x%016lx", pc);
+  tty->print_cr("rip = 0x%016lx", (intptr_t)pc);
 #ifndef PRODUCT
   tty->cr();
   findpc(pc);
@@ -923,13 +923,13 @@
   int64_t* rsp = (int64_t*) regs[11];
   int64_t* dump_sp = rsp;
   for (int col1 = 0; col1 < 8; col1++) {
-    tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (int64_t)dump_sp);
+    tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (intptr_t)dump_sp);
     os::print_location(tty, *dump_sp++);
   }
   for (int row = 0; row < 25; row++) {
-    tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (int64_t)dump_sp);
+    tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (intptr_t)dump_sp);
     for (int col = 0; col < 4; col++) {
-      tty->print(" 0x%016lx", *dump_sp++);
+      tty->print(" 0x%016lx", (intptr_t)*dump_sp++);
     }
     tty->cr();
   }
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -715,8 +715,8 @@
   if (((ubyte_at(0) & NativeTstRegMem::instruction_rex_prefix_mask) == NativeTstRegMem::instruction_rex_prefix &&
        ubyte_at(1) == NativeTstRegMem::instruction_code_memXregl &&
        (ubyte_at(2) & NativeTstRegMem::modrm_mask) == NativeTstRegMem::modrm_reg) ||
-      ubyte_at(0) == NativeTstRegMem::instruction_code_memXregl &&
-      (ubyte_at(1) & NativeTstRegMem::modrm_mask) == NativeTstRegMem::modrm_reg) {
+      (ubyte_at(0) == NativeTstRegMem::instruction_code_memXregl &&
+       (ubyte_at(1) & NativeTstRegMem::modrm_mask) == NativeTstRegMem::modrm_reg)) {
     NOT_JVMCI(assert(Assembler::is_polling_page_far(), "unexpected poll encoding");)
     return true;
   }
--- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -2622,6 +2622,7 @@
   switch (code) {
   case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
   case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
+  default: break;
   }
 
   assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
@@ -3287,6 +3288,7 @@
     case Bytecodes::_fast_dputfield: __ pop(dtos); break;
     case Bytecodes::_fast_fputfield: __ pop(ftos); break;
     case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
+    default: break;
     }
     __ bind(L2);
   }
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1380,7 +1380,7 @@
 #endif
     log->cr();
     log->print("Allocation");
-    if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) {
+    if (AllocatePrefetchStyle <= 0 || (UseSSE == 0 && !supports_3dnow_prefetch())) {
       log->print_cr(": no prefetching");
     } else {
       log->print(" prefetching: ");
--- a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -689,8 +689,8 @@
 // attach to a process/thread specified by "pid"
 static bool ptrace_attach(pid_t pid) {
   int res;
-  if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
-    print_error("ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
+  if ((res = ptrace(PT_ATTACHEXC, pid, 0, 0)) < 0) {
+    print_error("ptrace(PT_ATTACHEXC, %d) failed with %d\n", pid, res);
     return false;
   } else {
     return ptrace_waitpid(pid);
--- a/hotspot/src/os/aix/vm/decoder_aix.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/os/aix/vm/decoder_aix.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,7 @@
   AIXDecoder() {
     _decoder_status = no_error;
   }
-  ~AIXDecoder() {}
+  virtual ~AIXDecoder() {}
 
   virtual bool can_decode_C_frame_in_vm() const { return true; }
 
--- a/hotspot/src/os/bsd/vm/decoder_machO.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/os/bsd/vm/decoder_machO.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 class MachODecoder : public AbstractDecoder {
  public:
   MachODecoder() { }
-  ~MachODecoder() { }
+  virtual ~MachODecoder() { }
   virtual bool can_decode_C_frame_in_vm() const {
     return true;
   }
@@ -55,4 +55,3 @@
 #endif
 
 #endif // OS_BSD_VM_DECODER_MACHO_HPP
-
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1564,7 +1564,7 @@
 
 int _print_dll_info_cb(const char * name, address base_address, address top_address, void * param) {
   outputStream * out = (outputStream *) param;
-  out->print_cr(PTR_FORMAT " \t%s", base_address, name);
+  out->print_cr(INTPTR_FORMAT " \t%s", (intptr_t)base_address, name);
   return 0;
 }
 
@@ -2118,9 +2118,9 @@
 
 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,
-          os::errno_name(err), err);
+  warning("INFO: os::commit_memory(" INTPTR_FORMAT ", " SIZE_FORMAT
+          ", %d) failed; error='%s' (errno=%d)", (intptr_t)addr, size, exec,
+           os::errno_name(err), err);
 }
 
 // NOTE: Bsd kernel does not really reserve the pages for us.
@@ -3630,12 +3630,12 @@
   Dl_info dlinfo;
   memset(&dlinfo, 0, sizeof(dlinfo));
   if (dladdr(addr, &dlinfo) != 0) {
-    st->print(PTR_FORMAT ": ", addr);
+    st->print(INTPTR_FORMAT ": ", (intptr_t)addr);
     if (dlinfo.dli_sname != NULL && dlinfo.dli_saddr != NULL) {
       st->print("%s+%#x", dlinfo.dli_sname,
-                addr - (intptr_t)dlinfo.dli_saddr);
+                (uint)((uintptr_t)addr - (uintptr_t)dlinfo.dli_saddr));
     } else if (dlinfo.dli_fbase != NULL) {
-      st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
+      st->print("<offset %#x>", (uint)((uintptr_t)addr - (uintptr_t)dlinfo.dli_fbase));
     } else {
       st->print("<absolute address>");
     }
@@ -3643,7 +3643,7 @@
       st->print(" in %s", dlinfo.dli_fname);
     }
     if (dlinfo.dli_fbase != NULL) {
-      st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
+      st->print(" at " INTPTR_FORMAT, (intptr_t)dlinfo.dli_fbase);
     }
     st->cr();
 
--- a/hotspot/src/os/windows/vm/decoder_windows.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/os/windows/vm/decoder_windows.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
 
 public:
   WindowsDecoder();
-  ~WindowsDecoder() { uninitialize(); };
+  virtual ~WindowsDecoder() { uninitialize(); };
 
   bool can_decode_C_frame_in_vm() const;
   bool demangle(const char* symbol, char *buf, int buflen);
@@ -105,4 +105,3 @@
 #endif
 
 #endif // OS_WINDOWS_VM_DECODER_WINDOWS_HPP
-
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -979,50 +979,50 @@
   const ucontext_t *uc = (const ucontext_t*)context;
   st->print_cr("Registers:");
 #ifdef AMD64
-  st->print(  "RAX=" INTPTR_FORMAT, uc->context_rax);
-  st->print(", RBX=" INTPTR_FORMAT, uc->context_rbx);
-  st->print(", RCX=" INTPTR_FORMAT, uc->context_rcx);
-  st->print(", RDX=" INTPTR_FORMAT, uc->context_rdx);
+  st->print(  "RAX=" INTPTR_FORMAT, (intptr_t)uc->context_rax);
+  st->print(", RBX=" INTPTR_FORMAT, (intptr_t)uc->context_rbx);
+  st->print(", RCX=" INTPTR_FORMAT, (intptr_t)uc->context_rcx);
+  st->print(", RDX=" INTPTR_FORMAT, (intptr_t)uc->context_rdx);
   st->cr();
-  st->print(  "RSP=" INTPTR_FORMAT, uc->context_rsp);
-  st->print(", RBP=" INTPTR_FORMAT, uc->context_rbp);
-  st->print(", RSI=" INTPTR_FORMAT, uc->context_rsi);
-  st->print(", RDI=" INTPTR_FORMAT, uc->context_rdi);
+  st->print(  "RSP=" INTPTR_FORMAT, (intptr_t)uc->context_rsp);
+  st->print(", RBP=" INTPTR_FORMAT, (intptr_t)uc->context_rbp);
+  st->print(", RSI=" INTPTR_FORMAT, (intptr_t)uc->context_rsi);
+  st->print(", RDI=" INTPTR_FORMAT, (intptr_t)uc->context_rdi);
   st->cr();
-  st->print(  "R8 =" INTPTR_FORMAT, uc->context_r8);
-  st->print(", R9 =" INTPTR_FORMAT, uc->context_r9);
-  st->print(", R10=" INTPTR_FORMAT, uc->context_r10);
-  st->print(", R11=" INTPTR_FORMAT, uc->context_r11);
+  st->print(  "R8 =" INTPTR_FORMAT, (intptr_t)uc->context_r8);
+  st->print(", R9 =" INTPTR_FORMAT, (intptr_t)uc->context_r9);
+  st->print(", R10=" INTPTR_FORMAT, (intptr_t)uc->context_r10);
+  st->print(", R11=" INTPTR_FORMAT, (intptr_t)uc->context_r11);
   st->cr();
-  st->print(  "R12=" INTPTR_FORMAT, uc->context_r12);
-  st->print(", R13=" INTPTR_FORMAT, uc->context_r13);
-  st->print(", R14=" INTPTR_FORMAT, uc->context_r14);
-  st->print(", R15=" INTPTR_FORMAT, uc->context_r15);
+  st->print(  "R12=" INTPTR_FORMAT, (intptr_t)uc->context_r12);
+  st->print(", R13=" INTPTR_FORMAT, (intptr_t)uc->context_r13);
+  st->print(", R14=" INTPTR_FORMAT, (intptr_t)uc->context_r14);
+  st->print(", R15=" INTPTR_FORMAT, (intptr_t)uc->context_r15);
   st->cr();
-  st->print(  "RIP=" INTPTR_FORMAT, uc->context_rip);
-  st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_flags);
-  st->print(", ERR=" INTPTR_FORMAT, uc->context_err);
+  st->print(  "RIP=" INTPTR_FORMAT, (intptr_t)uc->context_rip);
+  st->print(", EFLAGS=" INTPTR_FORMAT, (intptr_t)uc->context_flags);
+  st->print(", ERR=" INTPTR_FORMAT, (intptr_t)uc->context_err);
   st->cr();
-  st->print("  TRAPNO=" INTPTR_FORMAT, uc->context_trapno);
+  st->print("  TRAPNO=" INTPTR_FORMAT, (intptr_t)uc->context_trapno);
 #else
-  st->print(  "EAX=" INTPTR_FORMAT, uc->context_eax);
-  st->print(", EBX=" INTPTR_FORMAT, uc->context_ebx);
-  st->print(", ECX=" INTPTR_FORMAT, uc->context_ecx);
-  st->print(", EDX=" INTPTR_FORMAT, uc->context_edx);
+  st->print(  "EAX=" INTPTR_FORMAT, (intptr_t)uc->context_eax);
+  st->print(", EBX=" INTPTR_FORMAT, (intptr_t)uc->context_ebx);
+  st->print(", ECX=" INTPTR_FORMAT, (intptr_t)uc->context_ecx);
+  st->print(", EDX=" INTPTR_FORMAT, (intptr_t)uc->context_edx);
   st->cr();
-  st->print(  "ESP=" INTPTR_FORMAT, uc->context_esp);
-  st->print(", EBP=" INTPTR_FORMAT, uc->context_ebp);
-  st->print(", ESI=" INTPTR_FORMAT, uc->context_esi);
-  st->print(", EDI=" INTPTR_FORMAT, uc->context_edi);
+  st->print(  "ESP=" INTPTR_FORMAT, (intptr_t)uc->context_esp);
+  st->print(", EBP=" INTPTR_FORMAT, (intptr_t)uc->context_ebp);
+  st->print(", ESI=" INTPTR_FORMAT, (intptr_t)uc->context_esi);
+  st->print(", EDI=" INTPTR_FORMAT, (intptr_t)uc->context_edi);
   st->cr();
-  st->print(  "EIP=" INTPTR_FORMAT, uc->context_eip);
-  st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_eflags);
+  st->print(  "EIP=" INTPTR_FORMAT, (intptr_t)uc->context_eip);
+  st->print(", EFLAGS=" INTPTR_FORMAT, (intptr_t)uc->context_eflags);
 #endif // AMD64
   st->cr();
   st->cr();
 
   intptr_t *sp = (intptr_t *)os::Bsd::ucontext_get_sp(uc);
-  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
+  st->print_cr("Top of Stack: (sp=" INTPTR_FORMAT ")", (intptr_t)sp);
   print_hex_dump(st, (address)sp, (address)(sp + 8*sizeof(intptr_t)), sizeof(intptr_t));
   st->cr();
 
@@ -1030,7 +1030,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::Bsd::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
+  st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", (intptr_t)pc);
   print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
 }
 
--- a/hotspot/src/share/vm/adlc/adlparse.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/adlc/adlparse.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3485,8 +3485,8 @@
   skipws();
   if (_curchar != ')') {
     // Parse primary, secondary, and tertiary opcodes, if provided.
-    if ( ((primary = get_ident_or_literal_constant("primary opcode")) == NULL) ) {
-        parse_err(SYNERR, "primary hex opcode expected at %c\n", _curchar);
+    if ( (primary = get_ident_or_literal_constant("primary opcode")) == NULL ) {
+          parse_err(SYNERR, "primary hex opcode expected at %c\n", _curchar);
         return NULL;
     }
     skipws();
@@ -3494,7 +3494,7 @@
       next_char();
       skipws();
       // Parse secondary opcode
-      if ( ((secondary = get_ident_or_literal_constant("secondary opcode")) == NULL) ) {
+      if ( (secondary = get_ident_or_literal_constant("secondary opcode")) == NULL ) {
         parse_err(SYNERR, "secondary hex opcode expected at %c\n", _curchar);
         return NULL;
       }
@@ -3503,7 +3503,7 @@
         next_char();
         skipws();
         // Parse tertiary opcode
-        if ( ((tertiary = get_ident_or_literal_constant("tertiary opcode")) == NULL) ) {
+        if ( (tertiary = get_ident_or_literal_constant("tertiary opcode")) == NULL ) {
           parse_err(SYNERR,"tertiary hex opcode expected at %c\n", _curchar);
           return NULL;
         }
@@ -4773,8 +4773,7 @@
   skipws();                       // Skip whitespace before identifier
   start = end = _ptr;             // Start points at first character
   c = *end;                       // Grab character to test
-  while ((c >= '0') && (c <= '9')
-         || ((c == '-') && (end == start))) {
+  while ((c >= '0' && c <= '9') || (c == '-' && end == start)) {
     end++;                        // Increment end pointer
     c = *end;                     // Grab character to test
   }
@@ -4812,7 +4811,7 @@
   if( (first == '=') || (first == '!') || (first == '<') || (first == '>') ) {
     next_char();
     char second = *_ptr;          // the second character
-    if( (second == '=') ) {
+    if( second == '=' ) {
       next_char();
       char tmp  = *_ptr;
       *_ptr = '\0';               // NULL terminate
--- a/hotspot/src/share/vm/adlc/archDesc.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/adlc/archDesc.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -307,8 +307,8 @@
     // Find result type for match
     const char *result  = instr->reduce_result();
 
-    if ( instr->is_ideal_branch() && instr->label_position() == -1 ||
-        !instr->is_ideal_branch() && instr->label_position() != -1) {
+    if (( instr->is_ideal_branch() && instr->label_position() == -1) ||
+        (!instr->is_ideal_branch() && instr->label_position() != -1)) {
       syntax_err(instr->_linenum, "%s: Only branches to a label are supported\n", rootOp);
     }
 
--- a/hotspot/src/share/vm/adlc/output_c.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/adlc/output_c.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -3146,8 +3146,8 @@
         instr->has_temps() ||
         instr->is_mach_constant() ||
         instr->needs_constant_base() ||
-        instr->_matrule != NULL &&
-        instr->num_opnds() != instr->num_unique_opnds() )
+        (instr->_matrule != NULL &&
+         instr->num_opnds() != instr->num_unique_opnds()) )
       defineExpand(_CPP_EXPAND_file._fp, instr);
     // If there is an explicit peephole rule, build it
     if ( instr->peepholes() )
@@ -3878,7 +3878,7 @@
     // Insert operands that are not in match-rule.
     // Only insert a DEF if the do_care flag is set
     comp_list.reset();
-    while ( comp = comp_list.post_match_iter() ) {
+    while ( (comp = comp_list.post_match_iter()) ) {
       // Check if we don't care about DEFs or KILLs that are not USEs
       if ( dont_care && (! comp->isa(Component::USE)) ) {
         continue;
--- a/hotspot/src/share/vm/adlc/output_h.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/adlc/output_h.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1844,8 +1844,8 @@
         instr->has_temps() ||
         instr->is_mach_constant() ||
         instr->needs_constant_base() ||
-        instr->_matrule != NULL &&
-        instr->num_opnds() != instr->num_unique_opnds() ) {
+        (instr->_matrule != NULL &&
+         instr->num_opnds() != instr->num_unique_opnds()) ) {
       fprintf(fp,"  virtual MachNode      *Expand(State *state, Node_List &proj_list, Node* mem);\n");
     }
 
--- a/hotspot/src/share/vm/asm/assembler.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/asm/assembler.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -258,6 +258,7 @@
       switch (dcon->type) {
       case T_INT:     dcon->value = (intptr_t) ((int_fn_t)    dcon->value_fn)(); break;
       case T_ADDRESS: dcon->value = (intptr_t) ((address_fn_t)dcon->value_fn)(); break;
+      default:        break;
       }
     }
   }
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,10 +74,11 @@
     case Bytecodes::_lsub: set_constant(jlong_cast(0)); return;
     case Bytecodes::_iand: // fall through
     case Bytecodes::_land: // fall through
-    case Bytecodes::_ior:  // fall through
+    case Bytecodes::_ior : // fall through
     case Bytecodes::_lor : set_canonical(x->x()); return;
     case Bytecodes::_ixor: set_constant(0); return;
     case Bytecodes::_lxor: set_constant(jlong_cast(0)); return;
+    default              : break;
     }
   }
 
@@ -114,6 +115,7 @@
             case Bytecodes::_iand: set_constant(a & b); return;
             case Bytecodes::_ior : set_constant(a | b); return;
             case Bytecodes::_ixor: set_constant(a ^ b); return;
+            default              : break;
           }
         }
         break;
@@ -139,10 +141,13 @@
             case Bytecodes::_land: set_constant(a & b); return;
             case Bytecodes::_lor : set_constant(a | b); return;
             case Bytecodes::_lxor: set_constant(a ^ b); return;
+            default              : break;
           }
         }
         break;
-      // other cases not implemented (must be extremely careful with floats & doubles!)
+      default:
+        // other cases not implemented (must be extremely careful with floats & doubles!)
+        break;
     }
   }
   // make sure constant is on the right side, if any
@@ -161,6 +166,7 @@
               //       corresponds to Java semantics!
             case Bytecodes::_iand: set_constant(0); return;
             case Bytecodes::_ior : set_canonical(x->x()); return;
+            default              : break;
           }
         }
         break;
@@ -174,9 +180,12 @@
               //       corresponds to Java semantics!
             case Bytecodes::_land: set_constant((jlong)0); return;
             case Bytecodes::_lor : set_canonical(x->x()); return;
+            default              : break;
           }
         }
         break;
+      default:
+        break;
     }
   }
 }
@@ -210,6 +219,7 @@
     case Bytecodes::_i2b: if (type == T_BYTE)  value = conv->value(); break;
     case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) value = conv->value(); break;
     case Bytecodes::_i2c: if (type == T_CHAR  || type == T_BYTE)  value = conv->value(); break;
+    default             : break;
     }
     // limit this optimization to current block
     if (value != NULL && in_current_block(conv)) {
@@ -303,6 +313,7 @@
     case Bytecodes::_i2b: if (type == T_BYTE)  value = conv->value(); break;
     case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) value = conv->value(); break;
     case Bytecodes::_i2c: if (type == T_CHAR  || type == T_BYTE) value = conv->value(); break;
+    default             : break;
     }
     // limit this optimization to current block
     if (value != NULL && in_current_block(conv)) {
@@ -351,6 +362,7 @@
           case Bytecodes::_ishl:  set_constant(value << shift); return;
           case Bytecodes::_ishr:  set_constant(value >> shift); return;
           case Bytecodes::_iushr: set_constant((value >> shift) & mask); return;
+          default:                break;
         }
       } else if (t->tag() == longTag) {
         jlong value = t->as_LongConstant()->value();
@@ -361,6 +373,7 @@
           case Bytecodes::_lshl:  set_constant(value << shift); return;
           case Bytecodes::_lshr:  set_constant(value >> shift); return;
           case Bytecodes::_lushr: set_constant((value >> shift) & mask); return;
+          default:                break;
         }
       }
     }
@@ -369,7 +382,7 @@
     switch (t2->tag()) {
       case intTag   : if (t2->as_IntConstant()->value() == 0)  set_canonical(x->x()); return;
       case longTag  : if (t2->as_LongConstant()->value() == (jlong)0)  set_canonical(x->x()); return;
-      default       : ShouldNotReachHere();
+      default       : ShouldNotReachHere(); return;
     }
   }
 }
@@ -402,6 +415,8 @@
         }
         break;
       }
+      default:
+        break;
     }
   } else if (x->x()->type()->is_constant() && x->y()->type()->is_constant()) {
     switch (x->x()->type()->tag()) {
@@ -444,8 +459,10 @@
           set_constant(1);
         break;
       }
+
+      default:
+        break;
     }
-
   }
 }
 
@@ -530,6 +547,8 @@
     }
     break;
   }
+  default:
+    break;
   }
 }
 
@@ -572,6 +591,7 @@
           case Bytecodes::_i2b: type = T_BYTE;  break;
           case Bytecodes::_i2s: type = T_SHORT; break;
           case Bytecodes::_i2c: type = T_CHAR;  break;
+          default             :                 break;
         }
       }
     }
@@ -581,6 +601,7 @@
       case Bytecodes::_i2b: if (type == T_BYTE)                    set_canonical(x->value()); break;
       case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) set_canonical(x->value()); break;
       case Bytecodes::_i2c: if (type == T_CHAR)                    set_canonical(x->value()); break;
+      default             :                                                                   break;
     }
   } else {
     Op2* op2 = x->value()->as_Op2();
@@ -591,6 +612,7 @@
         case Bytecodes::_i2b: safebits = 0x7f;   break;
         case Bytecodes::_i2s: safebits = 0x7fff; break;
         case Bytecodes::_i2c: safebits = 0xffff; break;
+        default             :                    break;
       }
       // When casting a masked integer to a smaller signed type, if
       // the mask doesn't include the sign bit the cast isn't needed.
@@ -669,9 +691,10 @@
     case If::leq: return x <= y;
     case If::gtr: return x >  y;
     case If::geq: return x >= y;
+    default:
+      ShouldNotReachHere();
+      return false;
   }
-  ShouldNotReachHere();
-  return false;
 }
 
 static bool is_safepoint(BlockEnd* x, BlockBegin* sux) {
@@ -756,6 +779,8 @@
               case Bytecodes::_dcmpl: case Bytecodes::_dcmpg:
                 set_canonical(x);
                 return;
+              default:
+                break;
             }
           }
           set_bci(cmp->state_before()->bci());
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -347,6 +347,9 @@
         current = NULL;
         break;
       }
+
+      default:
+        break;
     }
   }
 }
@@ -1488,6 +1491,8 @@
       x = append(new LogicOp(Bytecodes::_iand, x, mask));
       break;
     }
+    default:
+      break;
   }
 
   // Check to see whether we are inlining. If so, Return
@@ -1847,6 +1852,8 @@
     case Bytecodes::_invokehandle:
       code = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokespecial;
       break;
+    default:
+      break;
     }
   } else {
     if (bc_raw == Bytecodes::_invokehandle) {
@@ -1993,12 +2000,12 @@
 
   // check if we could do inlining
   if (!PatchALot && Inline && target->is_loaded() &&
-      (klass->is_initialized() || klass->is_interface() && target->holder()->is_initialized())
+      (klass->is_initialized() || (klass->is_interface() && target->holder()->is_initialized()))
       && !patch_for_appendix) {
     // callee is known => check if we have static binding
     if (code == Bytecodes::_invokestatic  ||
         code == Bytecodes::_invokespecial ||
-        code == Bytecodes::_invokevirtual && target->is_final_method() ||
+        (code == Bytecodes::_invokevirtual && target->is_final_method()) ||
         code == Bytecodes::_invokedynamic) {
       ciMethod* inline_target = (cha_monomorphic_target != NULL) ? cha_monomorphic_target : target;
       // static binding => check if callee is ok
--- a/hotspot/src/share/vm/c1/c1_Instruction.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -239,8 +239,8 @@
     case Bytecodes::_lmul: // fall through
     case Bytecodes::_fmul: // fall through
     case Bytecodes::_dmul: return true;
+    default              : return false;
   }
-  return false;
 }
 
 
@@ -250,8 +250,8 @@
     case Bytecodes::_ldiv: // fall through
     case Bytecodes::_irem: // fall through
     case Bytecodes::_lrem: return true;
+    default              : return false;
   }
-  return false;
 }
 
 
@@ -266,7 +266,7 @@
     case Bytecodes::_lor : // fall through
     case Bytecodes::_ixor: // fall through
     case Bytecodes::_lxor: break;
-    default              : ShouldNotReachHere();
+    default              : ShouldNotReachHere(); break;
   }
 #endif
   // all LogicOps are commutative
@@ -447,8 +447,9 @@
                 t1->is_loaded() && t2->is_loaded() &&
                 t1->constant_value() == t2->constant_value());
       }
+    default:
+      return false;
   }
-  return false;
 }
 
 Constant::CompareResult Constant::compare(Instruction::Condition cond, Value right) const {
@@ -471,6 +472,7 @@
     case If::leq: return x <= y ? cond_true : cond_false;
     case If::gtr: return x >  y ? cond_true : cond_false;
     case If::geq: return x >= y ? cond_true : cond_false;
+    default     : break;
     }
     break;
   }
@@ -484,6 +486,7 @@
     case If::leq: return x <= y ? cond_true : cond_false;
     case If::gtr: return x >  y ? cond_true : cond_false;
     case If::geq: return x >= y ? cond_true : cond_false;
+    default     : break;
     }
     break;
   }
@@ -495,6 +498,7 @@
       switch (cond) {
       case If::eql: return xvalue == yvalue ? cond_true : cond_false;
       case If::neq: return xvalue != yvalue ? cond_true : cond_false;
+      default     : break;
       }
     }
     break;
@@ -507,10 +511,13 @@
       switch (cond) {
       case If::eql: return xvalue == yvalue ? cond_true : cond_false;
       case If::neq: return xvalue != yvalue ? cond_true : cond_false;
+      default     : break;
       }
     }
     break;
   }
+  default:
+    break;
   }
   return not_comparable;
 }
--- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,9 +59,10 @@
     case If::geq: return ">=";
     case If::aeq: return "|>=|";
     case If::beq: return "|<=|";
+    default:
+      ShouldNotReachHere();
+      return NULL;
   }
-  ShouldNotReachHere();
-  return NULL;
 }
 
 
@@ -102,8 +103,8 @@
     case Bytecodes::_lor  : return "|";
     case Bytecodes::_ixor : // fall through
     case Bytecodes::_lxor : return "^";
+    default               : return Bytecodes::name(op);
   }
-  return Bytecodes::name(op);
 }
 
 
--- a/hotspot/src/share/vm/c1/c1_LIR.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -243,6 +243,8 @@
       assert(in_opr1()->is_valid() && in_opr2()->is_valid(), "must be valid");
       break;
 
+    default:
+      break;
     }
   }
 #endif
@@ -395,6 +397,8 @@
   case lir_return:
     assert(in_opr()->is_register() || in_opr()->is_illegal(), "must be");
     break;
+  default:
+    break;
   }
 }
 
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -394,7 +394,7 @@
 void LIRGenerator::walk(Value instr) {
   InstructionMark im(compilation(), instr);
   //stop walk when encounter a root
-  if (instr->is_pinned() && instr->as_Phi() == NULL || instr->operand()->is_valid()) {
+  if ((instr->is_pinned() && instr->as_Phi() == NULL) || instr->operand()->is_valid()) {
     assert(instr->operand() != LIR_OprFact::illegalOpr || instr->as_Constant() != NULL, "this root has not yet been visited");
   } else {
     assert(instr->subst() == instr, "shouldn't have missed substitution");
@@ -1434,6 +1434,8 @@
       case T_OBJECT:
         if (c->as_jobject() != other->as_jobject()) continue;
         break;
+      default:
+        break;
       }
       return _reg_for_constants.at(i);
     }
@@ -2804,6 +2806,8 @@
     case T_CHAR:
       t = T_INT;
       break;
+    default:
+      break;
     }
 
     LIR_Opr dest = new_register(t);
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1104,6 +1104,8 @@
             return shouldHaveRegister;
           }
         }
+        default:
+          break;
       }
     } else {
       // FPU stack float instruction
@@ -1120,6 +1122,8 @@
             return shouldHaveRegister;
           }
         }
+        default:
+          break;
       }
     }
     // We want to sometimes use logical operations on pointers, in particular in GC barriers.
@@ -1142,6 +1146,8 @@
           return shouldHaveRegister;
         }
       }
+      default:
+        break;
     }
   }
 #endif // X86 S390
@@ -1247,6 +1253,8 @@
       }
       break;
     }
+    default:
+      break;
   }
 }
 
@@ -2373,6 +2381,8 @@
       case Bytecodes::_if_acmpne :
         assert(stack_end >= -Bytecodes::depth(code), "must have non-empty expression stack at if bytecode");
         break;
+      default:
+        break;
     }
   }
 }
@@ -3027,8 +3037,8 @@
       LIR_Opr src = move->in_opr();
       LIR_Opr dst = move->result_opr();
       if (dst == src ||
-          !dst->is_pointer() && !src->is_pointer() &&
-          src->is_same_register(dst)) {
+          (!dst->is_pointer() && !src->is_pointer() &&
+           src->is_same_register(dst))) {
         instructions->at_put(j, NULL);
         has_dead = true;
       }
--- a/hotspot/src/share/vm/c1/c1_ValueStack.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueStack.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -173,8 +173,8 @@
       case doubleTag : dpush(t); return;
       case objectTag : apush(t); return;
       case addressTag: rpush(t); return;
+      default        : ShouldNotReachHere(); return;
     }
-    ShouldNotReachHere();
   }
 
   Value ipop()                                   { return check(intTag    , _stack.pop()); }
@@ -192,9 +192,8 @@
       case doubleTag : return dpop();
       case objectTag : return apop();
       case addressTag: return rpop();
+      default        : ShouldNotReachHere(); return NULL;
     }
-    ShouldNotReachHere();
-    return NULL;
   }
 
   Values* pop_arguments(int argument_size);
--- a/hotspot/src/share/vm/c1/c1_ValueType.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueType.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -137,9 +137,9 @@
     case T_OBJECT : return objectType;
     case T_ADDRESS: return addressType;
     case T_ILLEGAL: return illegalType;
+    default       : ShouldNotReachHere();
+                    return illegalType;
   }
-  ShouldNotReachHere();
-  return illegalType;
 }
 
 
@@ -167,9 +167,9 @@
       }
       return new ObjectConstant(obj);
     }
+    default       : ShouldNotReachHere();
+                    return illegalType;
   }
-  ShouldNotReachHere();
-  return illegalType;
 }
 
 
@@ -184,7 +184,7 @@
     case metaDataTag:return T_METADATA;
     case addressTag: return T_ADDRESS;
     case illegalTag: return T_ILLEGAL;
+    default        : ShouldNotReachHere();
+                     return T_ILLEGAL;
   }
-  ShouldNotReachHere();
-  return T_ILLEGAL;
 }
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,6 +266,8 @@
     case Bytecodes::_invokehandle:
       code = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokespecial;
       break;
+    default:
+      break;
     }
   }
 
@@ -301,11 +303,11 @@
   // determine actual method (use CHA if necessary)
   ciMethod* inline_target = NULL;
   if (target->is_loaded() && klass->is_loaded()
-      && (klass->is_initialized() || klass->is_interface() && target->holder()->is_initialized())
+      && (klass->is_initialized() || (klass->is_interface() && target->holder()->is_initialized()))
       && target->is_loaded()) {
     if (code == Bytecodes::_invokestatic
         || code == Bytecodes::_invokespecial
-        || code == Bytecodes::_invokevirtual && target->is_final_method()) {
+        || (code == Bytecodes::_invokevirtual && target->is_final_method())) {
       inline_target = target;
     } else {
       inline_target = target->find_monomorphic_target(calling_klass, callee_holder, actual_recv);
@@ -342,7 +344,8 @@
 
     // record dependencies if at least one parameter retained stack-allocatable
     if (must_record_dependencies) {
-      if (code == Bytecodes::_invokeinterface || code == Bytecodes::_invokevirtual && !target->is_final_method()) {
+      if (code == Bytecodes::_invokeinterface ||
+          (code == Bytecodes::_invokevirtual && !target->is_final_method())) {
         _dependencies.append(actual_recv);
         _dependencies.append(inline_target);
       }
--- a/hotspot/src/share/vm/ci/ciArray.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciArray.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,8 @@
       ciObject* box = env->get_object(elem);
       return ciConstant(T_OBJECT, box);
     }
+  default:
+    break;
   }
   assert(ary->is_typeArray(), "");
   typeArrayOop tary = (typeArrayOop) ary;
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -797,6 +797,8 @@
           }
         }
         break;
+      default:
+        break;
       }
     }
 
--- a/hotspot/src/share/vm/ci/ciInstance.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciInstance.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -86,9 +86,10 @@
         return ciConstant(field_btype, CURRENT_ENV->get_object(o));
       }
     }
+    default:
+      fatal("no field value: %s", type2name(field_btype));
+      return ciConstant();
   }
-  fatal("no field value: %s", type2name(field_btype));
-  return ciConstant();
 }
 
 // ------------------------------------------------------------------
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -800,7 +800,7 @@
    // the vtable has not been setup, and the LinkResolver will fail.
    if (recv->is_array_klass()
         ||
-       InstanceKlass::cast(recv)->is_linked() && !exact_receiver->is_interface()) {
+       (InstanceKlass::cast(recv)->is_linked() && !exact_receiver->is_interface())) {
      if (holder()->is_interface()) {
        m = LinkResolver::resolve_interface_call_or_null(recv, link_info);
      } else {
@@ -1493,6 +1493,8 @@
       }
       break;
     }
+    default:
+      break;
   }
   assert(target_sig->count() - rbase == linker_sig->count() - sbase - has_appendix, "argument count mismatch");
   int arg_count = target_sig->count() - rbase;
--- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -245,6 +245,9 @@
           (void) make_block_at(s.next_bci());
         }
         break;
+
+      default:
+        break;
     }
   }
   //  End the last block
--- a/hotspot/src/share/vm/ci/ciMethodData.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodData.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -610,14 +610,10 @@
   int elements = (data_size() + extra_data_size()) / sizeof(intptr_t);
   out->print(" data %d", elements);
   for (int i = 0; i < elements; i++) {
-    // We could use INTPTR_FORMAT here but that's a zero justified
+    // We could use INTPTR_FORMAT here but that's zero justified
     // which makes comparing it with the SA version of this output
-    // harder.
-#ifdef _LP64
-    out->print(" 0x%" FORMAT64_MODIFIER "x", data()[i]);
-#else
-    out->print(" 0x%x", data()[i]);
-#endif
+    // harder. data()'s element type is intptr_t.
+    out->print(" " INTPTRNZ_FORMAT, data()[i]);
   }
 
   // The MDO contained oop references as ciObjects, so scan for those
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -757,7 +757,7 @@
     InstanceKlass* k = (InstanceKlass *)parse_klass(CHECK);
 
     if (k == NULL || ReplaySuppressInitializers == 0 ||
-        ReplaySuppressInitializers == 2 && k->class_loader() == NULL) {
+        (ReplaySuppressInitializers == 2 && k->class_loader() == NULL)) {
       return;
     }
 
--- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2192,9 +2192,10 @@
     case Bytecodes::_monitorexit:
       // We can assume monitors are matched in this analysis.
       return false;
+
+    default:
+      return true;
   }
-
-  return true;
 }
 
 // ------------------------------------------------------------------
--- a/hotspot/src/share/vm/classfile/classLoader.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -56,6 +56,7 @@
   ClassPathEntry* next() const {
     return (ClassPathEntry*) OrderAccess::load_ptr_acquire(&_next);
   }
+  virtual ~ClassPathEntry() {}
   void set_next(ClassPathEntry* next) {
     // may have unlocked readers, so ensure visibility.
     OrderAccess::release_store_ptr(&_next, next);
@@ -82,6 +83,7 @@
   const char* name() const { return _dir; }
   JImageFile* jimage() const { return NULL; }
   ClassPathDirEntry(const char* dir);
+  virtual ~ClassPathDirEntry() {}
   ClassFileStream* open_stream(const char* name, TRAPS);
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
@@ -120,7 +122,7 @@
   const char* name() const { return _zip_name; }
   JImageFile* jimage() const { return NULL; }
   ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append);
-  ~ClassPathZipEntry();
+  virtual ~ClassPathZipEntry();
   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
   u1* open_versioned_entry(const char* name, jint* filesize, TRAPS) NOT_CDS_RETURN_(NULL);
   ClassFileStream* open_stream(const char* name, TRAPS);
@@ -143,7 +145,7 @@
   const char* name() const { return _name == NULL ? "" : _name; }
   JImageFile* jimage() const { return _jimage; }
   ClassPathImageEntry(JImageFile* jimage, const char* name);
-  ~ClassPathImageEntry();
+  virtual ~ClassPathImageEntry();
   ClassFileStream* open_stream(const char* name, TRAPS);
 
   // Debugging
--- a/hotspot/src/share/vm/classfile/javaAssertions.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -197,13 +197,13 @@
 
   // First check options that apply to classes.  If we find a match we're done.
   OptionList* p;
-  if (p = match_class(classname)) {
+  if ((p = match_class(classname))) {
     trace(classname, "class", p->name(), p->enabled());
     return p->enabled();
   }
 
   // Now check packages, from most specific to least.
-  if (p = match_package(classname)) {
+  if ((p = match_package(classname))) {
     trace(classname, "package", p->name(), p->enabled());
     return p->enabled();
   }
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -3045,7 +3045,7 @@
   case T_BYTE:      st->print("%d", value->b);                      break;
   case T_SHORT:     st->print("%d", value->s);                      break;
   case T_INT:       st->print("%d", value->i);                      break;
-  case T_LONG:      st->print(INT64_FORMAT, value->j);              break;
+  case T_LONG:      st->print(JLONG_FORMAT, value->j);              break;
   case T_FLOAT:     st->print("%f", value->f);                      break;
   case T_DOUBLE:    st->print("%lf", value->d);                     break;
   default:          st->print("type %d?", type);                    break;
--- a/hotspot/src/share/vm/classfile/stackMapTableFormat.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/classfile/stackMapTableFormat.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@
     return ((address)this >= start &&
             (address)this < end &&
             (bci_addr() + sizeof(u2) <= end ||
-                !is_object() && !is_uninitialized()));
+             (!is_object() && !is_uninitialized())));
   }
 
   void print_on(outputStream* st) {
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -892,6 +892,7 @@
   case F_SN: fname = "native static "; break;
   case F_S:  fname = "static ";        break;
   case F_RNY:fname = "native synchronized "; break;
+  default:   break;
   }
   const char* kptr = strrchr(kname, '/');
   if (kptr != NULL)  kname = kptr + 1;
@@ -989,6 +990,8 @@
       declared_id = match_method_with_klass(m, vmSymbols::java_lang_Math());
       if (declared_id == actual_id)  return; // acceptable alias
       break;
+    default:
+        break;
     }
   }
 
--- a/hotspot/src/share/vm/code/compiledMethod.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/compiledMethod.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -255,6 +255,8 @@
           }
         break;
       }
+      default:
+        break;
     }
   }
 }
@@ -316,6 +318,7 @@
         case relocInfo::static_call_type:      return iter.static_call_reloc()->method_value();
         case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value();
         case relocInfo::virtual_call_type:     return iter.virtual_call_reloc()->method_value();
+        default:                               break;
       }
     }
   }
@@ -626,6 +629,9 @@
 
     case relocInfo::metadata_type:
       break; // nothing to do.
+
+    default:
+      break;
     }
   }
 
@@ -679,6 +685,9 @@
     case relocInfo::static_call_type:
       clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), is_alive, this);
       break;
+
+    default:
+      break;
     }
   }
 }
--- a/hotspot/src/share/vm/code/compressedStream.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/compressedStream.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,9 +39,9 @@
 // converts trailing zeroes (common in floats) to leading zeroes
 inline juint CompressedStream::reverse_int(juint i) {
   // Hacker's Delight, Figure 7-1
-  i = (i & 0x55555555) << 1 | (i >> 1) & 0x55555555;
-  i = (i & 0x33333333) << 2 | (i >> 2) & 0x33333333;
-  i = (i & 0x0f0f0f0f) << 4 | (i >> 4) & 0x0f0f0f0f;
+  i = (i & 0x55555555) << 1 | ((i >> 1) & 0x55555555);
+  i = (i & 0x33333333) << 2 | ((i >> 2) & 0x33333333);
+  i = (i & 0x0f0f0f0f) << 4 | ((i >> 4) & 0x0f0f0f0f);
   i = (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
   return i;
 }
--- a/hotspot/src/share/vm/code/debugInfo.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/debugInfo.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -188,7 +188,7 @@
 }
 
 void ConstantLongValue::print_on(outputStream* st) const {
-  st->print(INT64_FORMAT, value());
+  st->print(JLONG_FORMAT, value());
 }
 
 // ConstantDoubleValue
--- a/hotspot/src/share/vm/code/dependencies.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -272,6 +272,8 @@
   case exclusive_concrete_methods_2:
     swap = (x->ident() > x2->ident() && x->as_metadata()->as_method()->holder() != ctxk);
     break;
+  default:
+    break;
   }
   if (swap) { ciBaseObject* t = x; x = x2; x2 = t; }
 
@@ -420,7 +422,7 @@
       case 1: deps->sort(sort_dep_value_arg_1, 1); break;
       case 2: deps->sort(sort_dep_value_arg_2, 2); break;
       case 3: deps->sort(sort_dep_value_arg_3, 3); break;
-      default: ShouldNotReachHere();
+      default: ShouldNotReachHere(); break;
       }
     }
     return;
@@ -434,7 +436,7 @@
     case 1: deps->sort(sort_dep_arg_1, 1); break;
     case 2: deps->sort(sort_dep_arg_2, 2); break;
     case 3: deps->sort(sort_dep_arg_3, 3); break;
-    default: ShouldNotReachHere();
+    default: ShouldNotReachHere(); break;
     }
   }
 }
@@ -466,8 +468,9 @@
   case unique_concrete_method:
   case exclusive_concrete_methods_2:
     return x->as_metadata()->as_method()->holder();
+  default:
+    return NULL;  // let NULL be NULL
   }
-  return NULL;  // let NULL be NULL
 }
 
 Klass* Dependencies::ctxk_encoded_as_null(DepType dept, Metadata* x) {
@@ -480,8 +483,9 @@
   case exclusive_concrete_methods_2:
     assert(x->is_method(), "sanity");
     return ((Method*)x)->method_holder();
+  default:
+    return NULL;  // let NULL be NULL
   }
-  return NULL;  // let NULL be NULL
 }
 
 void Dependencies::encode_content_bytes() {
@@ -1459,7 +1463,7 @@
   //     overpass clause is false if k == NULL, implies return true if
   //     answer depends on overpass clause.
   return ! ( m == NULL || m -> is_static() || m -> is_abstract() ||
-             m->is_overpass() && k != NULL && k -> is_abstract() );
+             (m->is_overpass() && k != NULL && k -> is_abstract()) );
 }
 
 
@@ -1864,6 +1868,8 @@
         tty->print_cr("  context interface = %s", k->external_name());
       }
       break;
+    default:
+      break;
     }
   }
   if (nsup + nint != 0) {
--- a/hotspot/src/share/vm/code/nmethod.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -987,6 +987,8 @@
         }
         break;
       }
+      default:
+        break;
     }
   }
 }
@@ -2187,12 +2189,15 @@
         //verify_interrupt_point(iter.addr());
         break;
       case relocInfo::runtime_call_type:
-      case relocInfo::runtime_call_w_cp_type:
+      case relocInfo::runtime_call_w_cp_type: {
         address destination = iter.reloc()->value();
         // Right now there is no way to find out which entries support
         // an interrupt point.  It would be nice if we had this
         // information in a table.
         break;
+      }
+      default:
+        break;
     }
     assert(stub == NULL || stub_contains(stub), "static call stub outside stub section");
   }
@@ -2489,6 +2494,9 @@
         case relocInfo::poll_type:             return "poll";
         case relocInfo::poll_return_type:      return "poll_return";
         case relocInfo::type_mask:             return "type_bit_mask";
+
+        default:
+          break;
     }
   }
   return have_one ? "other" : NULL;
@@ -2674,6 +2682,8 @@
             else
               st->print("<UNKNOWN>");
           }
+        default:
+          break;
         }
       }
       st->print(" {reexecute=%d rethrow=%d return_oop=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop());
@@ -2842,6 +2852,8 @@
       st->print_cr("Static call at " INTPTR_FORMAT, p2i(iter.reloc()->addr()));
       CompiledDirectStaticCall::at(iter.reloc())->print();
       break;
+    default:
+      break;
     }
   }
 }
@@ -2981,4 +2993,3 @@
   return buf;
 }
 #endif
-
--- a/hotspot/src/share/vm/code/relocInfo.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/code/relocInfo.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -940,6 +940,8 @@
                  p2i(r->destination()), p2i(r->method_value()));
       break;
     }
+  default:
+    break;
   }
   tty->cr();
 }
--- a/hotspot/src/share/vm/compiler/compileTask.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/compiler/compileTask.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,8 +130,9 @@
       case Reason_InvocationCount:
       case Reason_Tiered:
         return !_is_blocking;
+      default:
+        return false;
     }
-    return false;
   }
 #if INCLUDE_JVMCI
   bool         has_waiter() const                { return _has_waiter; }
--- a/hotspot/src/share/vm/gc/g1/g1RootClosures.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1RootClosures.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,9 @@
 
 class G1RootClosures : public CHeapObj<mtGC> {
 public:
-  // Closures to process raw oops in the root set.
+  virtual ~G1RootClosures() {}
+
+// Closures to process raw oops in the root set.
   virtual OopClosure* weak_oops() = 0;
   virtual OopClosure* strong_oops() = 0;
 
--- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -893,4 +893,3 @@
   set_saved_mark_word(NULL);
   reset_bot();
 }
-
--- a/hotspot/src/share/vm/gc/g1/heapRegionType.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/g1/heapRegionType.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,9 @@
     case OldTag:
     case ArchiveTag:
       return true;
+    default:
+      return false;
   }
-  return false;
 }
 
 const char* HeapRegionType::get_str() const {
@@ -50,10 +51,10 @@
     case ContinuesHumongousTag: return "HUMC";
     case OldTag:                return "OLD";
     case ArchiveTag:            return "ARC";
+    default:
+      ShouldNotReachHere();
+      return NULL; // keep some compilers happy
   }
-  ShouldNotReachHere();
-  // keep some compilers happy
-  return NULL;
 }
 
 const char* HeapRegionType::get_short_str() const {
@@ -66,10 +67,10 @@
     case ContinuesHumongousTag: return "HC";
     case OldTag:                return "O";
     case ArchiveTag:            return "A";
+    default:
+      ShouldNotReachHere();
+      return NULL; // keep some compilers happy
   }
-  ShouldNotReachHere();
-  // keep some compilers happy
-  return NULL;
 }
 
 G1HeapRegionTraceType::Type HeapRegionType::get_trace_type() {
@@ -82,8 +83,8 @@
     case ContinuesHumongousTag: return G1HeapRegionTraceType::ContinuesHumongous;
     case OldTag:                return G1HeapRegionTraceType::Old;
     case ArchiveTag:            return G1HeapRegionTraceType::Archive;
+    default:
+      ShouldNotReachHere();
+      return G1HeapRegionTraceType::Free; // keep some compilers happy
   }
-  ShouldNotReachHere();
-  // keep some compilers happy
-  return G1HeapRegionTraceType::Free;
 }
--- a/hotspot/src/share/vm/gc/g1/ptrQueue.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/g1/ptrQueue.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -238,8 +238,9 @@
 bool PtrQueueSet::process_or_enqueue_complete_buffer(BufferNode* node) {
   if (Thread::current()->is_Java_thread()) {
     // We don't lock. It is fine to be epsilon-precise here.
-    if (_max_completed_queue == 0 || _max_completed_queue > 0 &&
-        _n_completed_buffers >= _max_completed_queue + _completed_queue_padding) {
+    if (_max_completed_queue == 0 ||
+        (_max_completed_queue > 0 &&
+          _n_completed_buffers >= _max_completed_queue + _completed_queue_padding)) {
       bool b = mut_process_buffer(node);
       if (b) {
         // True here means that the buffer hasn't been deallocated and the caller may reuse it.
--- a/hotspot/src/share/vm/gc/g1/sparsePRT.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/g1/sparsePRT.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,8 +120,8 @@
                 "_capacity too large");
 
   // This will put -1 == NullEntry in the key field of all entries.
-  memset(_entries, NullEntry, _num_entries * SparsePRTEntry::size());
-  memset(_buckets, NullEntry, _capacity * sizeof(int));
+  memset((void*)_entries, NullEntry, _num_entries * SparsePRTEntry::size());
+  memset((void*)_buckets, NullEntry, _capacity * sizeof(int));
   _free_list = NullEntry;
   _free_region = 0;
 }
--- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -315,7 +315,7 @@
         process_popped_location_depth(p);
       }
     }
-  } while (totally_drain && !tq->taskqueue_empty() || !tq->overflow_empty());
+  } while ((totally_drain && !tq->taskqueue_empty()) || !tq->overflow_empty());
 
   assert(!totally_drain || tq->taskqueue_empty(), "Sanity");
   assert(totally_drain || tq->size() <= _target_stack_size, "Sanity");
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,6 +136,7 @@
     case vmIntrinsics::_floatToRawIntBits:   return java_lang_Float_floatToRawIntBits;
     case vmIntrinsics::_longBitsToDouble:    return java_lang_Double_longBitsToDouble;
     case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
+    default:                                 break;
   }
 #endif // CC_INTERP
 
@@ -182,8 +183,9 @@
     case vmIntrinsics::_fmaD  : return java_lang_math_fmaD ;
     case vmIntrinsics::_fmaF  : return java_lang_math_fmaF ;
 
-    case vmIntrinsics::_Reference_get:
-                                return java_lang_ref_reference_get;
+    case vmIntrinsics::_Reference_get
+                              : return java_lang_ref_reference_get;
+    default                   : break;
   }
 
   // Accessor method?
--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,10 +70,11 @@
   case Bytecodes::_new:
     // (Could actually look at the class here, but the profit would be small.)
     return false;  // the rewrite is not always done
+
+  default:
+    // No other special cases.
+    return true;
   }
-
-  // No other special cases.
-  return true;
 }
 
 Bytecodes::Code Bytecodes::code_at(Method* method, int bci) {
@@ -119,9 +120,10 @@
       // return -1 otherwise
       return (len > 0 && len == (int)len) ? len : -1;
     }
+  default:
+    // Note: Length functions must return <=0 for invalid bytecodes.
+    return 0;
   }
-  // Note: Length functions must return <=0 for invalid bytecodes.
-  return 0;
 }
 
 // At a breakpoint instruction, this returns the breakpoint's length,
--- a/hotspot/src/share/vm/interpreter/invocationCounter.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/invocationCounter.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,18 +87,20 @@
   switch (state) {
     case wait_for_nothing            : return "wait_for_nothing";
     case wait_for_compile            : return "wait_for_compile";
+    default:
+      ShouldNotReachHere();
+      return NULL;
   }
-  ShouldNotReachHere();
-  return NULL;
 }
 
 const char* InvocationCounter::state_as_short_string(State state) {
   switch (state) {
     case wait_for_nothing            : return "not comp.";
     case wait_for_compile            : return "compileable";
+    default:
+      ShouldNotReachHere();
+      return NULL;
   }
-  ShouldNotReachHere();
-  return NULL;
 }
 
 
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -219,11 +219,12 @@
 #ifndef PRODUCT
 void CallInfo::print() {
   ResourceMark rm;
-  const char* kindstr = "unknown";
+  const char* kindstr;
   switch (_call_kind) {
-  case direct_call: kindstr = "direct"; break;
-  case vtable_call: kindstr = "vtable"; break;
-  case itable_call: kindstr = "itable"; break;
+  case direct_call: kindstr = "direct";  break;
+  case vtable_call: kindstr = "vtable";  break;
+  case itable_call: kindstr = "itable";  break;
+  default         : kindstr = "unknown"; break;
   }
   tty->print_cr("Call %s@%d %s", kindstr, _call_index,
                 _resolved_method.is_null() ? "(none)" : _resolved_method->name_and_sig_as_C_string());
@@ -1570,6 +1571,7 @@
     case Bytecodes::_invokehandle   : resolve_invokehandle   (result,       pool, index, CHECK); break;
     case Bytecodes::_invokedynamic  : resolve_invokedynamic  (result,       pool, index, CHECK); break;
     case Bytecodes::_invokeinterface: resolve_invokeinterface(result, recv, pool, index, CHECK); break;
+    default                         :                                                            break;
   }
   return;
 }
@@ -1598,6 +1600,7 @@
       break;
     default:
       fatal("bad call: %s", Bytecodes::name(byte));
+      break;
   }
 }
 
--- a/hotspot/src/share/vm/interpreter/rewriter.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/rewriter.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -140,6 +140,9 @@
         THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(),
                   "can't overwrite local 0 in Object.<init>");
         break;
+
+      default:
+        break;
     }
   }
 }
@@ -467,6 +470,8 @@
         case Bytecodes::_jsr_w          : nof_jsrs++;                   break;
         case Bytecodes::_monitorenter   : // fall through
         case Bytecodes::_monitorexit    : has_monitor_bytecodes = true; break;
+
+        default: break;
       }
     }
   }
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -599,10 +599,14 @@
           break;
         }
 
-        case Bytecodes::_invokedynamic:
+        case Bytecodes::_invokedynamic: {
           int cp_index = Bytes::get_native_u4((address) reconstituted_code->byte_at_addr(bci + 1));
           Bytes::put_Java_u4((address) reconstituted_code->byte_at_addr(bci + 1), (u4) cp_index);
           break;
+        }
+
+        default:
+          break;
       }
 
       // Not all ldc byte code are rewritten.
@@ -622,6 +626,9 @@
           Bytes::put_Java_u2((address) reconstituted_code->byte_at_addr(bci + 1), (u2) cp_index);
           break;
         }
+
+        default:
+          break;
       }
     }
   }
@@ -964,7 +971,7 @@
   // Only do exact lookup if receiver klass has been linked.  Otherwise,
   // the vtable has not been setup, and the LinkResolver will fail.
   if (recv_klass->is_array_klass() ||
-      InstanceKlass::cast(recv_klass)->is_linked() && !recv_klass->is_interface()) {
+      (InstanceKlass::cast(recv_klass)->is_linked() && !recv_klass->is_interface())) {
     if (resolved->is_interface()) {
       m = LinkResolver::resolve_interface_call_or_null(recv_klass, link_info);
     } else {
@@ -1239,7 +1246,9 @@
       case T_SHORT:
        value->s = (jshort) value->i;
        break;
-     }
+      default:
+        break;
+    }
     oop o = java_lang_boxing_object::create(jap.get_ret_type(), value, CHECK_NULL);
     return JNIHandles::make_local(THREAD, o);
   }
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -357,6 +357,8 @@
         }
       }
       break;
+    default:
+      break;
     }
   }
 
@@ -604,4 +606,3 @@
 
   return result;
 }
-
--- a/hotspot/src/share/vm/libadt/dict.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/libadt/dict.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@
   _size = 16;                   // Size is a power of 2
   _cnt = 0;                     // Dictionary is empty
   _bin = (bucket*)_arena->Amalloc_4(sizeof(bucket)*_size);
-  memset(_bin,0,sizeof(bucket)*_size);
+  memset((void*)_bin,0,sizeof(bucket)*_size);
 }
 
 Dict::Dict(CmpKey initcmp, Hash inithash, Arena *arena, int size)
@@ -91,7 +91,7 @@
   _size = i;                    // Size is a power of 2
   _cnt = 0;                     // Dictionary is empty
   _bin = (bucket*)_arena->Amalloc_4(sizeof(bucket)*_size);
-  memset(_bin,0,sizeof(bucket)*_size);
+  memset((void*)_bin,0,sizeof(bucket)*_size);
 }
 
 //------------------------------~Dict------------------------------------------
@@ -127,7 +127,7 @@
   uint oldsize = _size;
   _size <<= 1;                  // Double in size
   _bin = (bucket*)_arena->Arealloc(_bin, sizeof(bucket) * oldsize, sizeof(bucket) * _size);
-  memset(&_bin[oldsize], 0, oldsize * sizeof(bucket));
+  memset((void*)(&_bin[oldsize]), 0, oldsize * sizeof(bucket));
   // Rehash things to spread into new table
   for (uint i = 0; i < oldsize; i++) { // For complete OLD table do
     bucket *b = &_bin[i];              // Handy shortcut for _bin[i]
@@ -163,7 +163,7 @@
 // Deep copy a dictionary.
 Dict::Dict( const Dict &d ) : _size(d._size), _cnt(d._cnt), _hash(d._hash),_cmp(d._cmp), _arena(d._arena) {
   _bin = (bucket*)_arena->Amalloc_4(sizeof(bucket)*_size);
-  memcpy( _bin, d._bin, sizeof(bucket)*_size );
+  memcpy( (void*)_bin, (void*)d._bin, sizeof(bucket)*_size );
   for( uint i=0; i<_size; i++ ) {
     if( !_bin[i]._keyvals ) continue;
     _bin[i]._keyvals=(void**)_arena->Amalloc_4( sizeof(void *)*_bin[i]._max*2);
@@ -177,7 +177,7 @@
   if( _size < d._size ) {       // If must have more buckets
     _arena = d._arena;
     _bin = (bucket*)_arena->Arealloc( _bin, sizeof(bucket)*_size, sizeof(bucket)*d._size );
-    memset( &_bin[_size], 0, (d._size-_size)*sizeof(bucket) );
+    memset( (void*)(&_bin[_size]), 0, (d._size-_size)*sizeof(bucket) );
     _size = d._size;
   }
   uint i;
--- a/hotspot/src/share/vm/logging/logFileOutput.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/logging/logFileOutput.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -191,7 +191,7 @@
       success = Arguments::atojulong(value_str, &value);
       if (!success || (value > SIZE_MAX)) {
         errstream->print_cr("Invalid option: %s must be in range [0, "
-                            SIZE_FORMAT "]", FileSizeOptionKey, SIZE_MAX);
+                            SIZE_FORMAT "]", FileSizeOptionKey, (size_t)SIZE_MAX);
         success = false;
         break;
       }
@@ -436,4 +436,3 @@
              byte_size_in_proper_unit(_rotate_size),
              proper_unit_for_byte_size(_rotate_size));
 }
-
--- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,9 +45,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 template <class Chunk_t, class FreeList_t>
-size_t TreeChunk<Chunk_t, FreeList_t>::_min_tree_chunk_size = sizeof(TreeChunk<Chunk_t,  FreeList_t>)/HeapWordSize;
-
-template <class Chunk_t, class FreeList_t>
 TreeChunk<Chunk_t, FreeList_t>* TreeChunk<Chunk_t, FreeList_t>::as_TreeChunk(Chunk_t* fc) {
   // Do some assertion checking here.
   return (TreeChunk<Chunk_t, FreeList_t>*) fc;
--- a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -163,15 +163,17 @@
   Chunk_t* prev() const { return Chunk_t::prev(); }
   size_t size() const volatile { return Chunk_t::size(); }
 
-  static size_t min_size() {
-    return _min_tree_chunk_size;
-  }
+  static size_t min_size();
 
   // debugging
   void verify_tree_chunk_list() const;
   void assert_is_mangled() const;
 };
 
+template <class Chunk_t, class FreeList_t>
+size_t TreeChunk<Chunk_t, FreeList_t>::_min_tree_chunk_size = sizeof(TreeChunk<Chunk_t, FreeList_t>)/HeapWordSize;
+template <class Chunk_t, class FreeList_t>
+size_t TreeChunk<Chunk_t, FreeList_t>::min_size() { return _min_tree_chunk_size; }
 
 template <class Chunk_t, class FreeList_t>
 class BinaryTreeDictionary: public FreeBlockDictionary<Chunk_t> {
--- a/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -151,7 +151,7 @@
 FileMapInfo::FileMapInfo() {
   assert(_current_info == NULL, "must be singleton"); // not thread safe
   _current_info = this;
-  memset(this, 0, sizeof(FileMapInfo));
+  memset((void*)this, 0, sizeof(FileMapInfo));
   _file_offset = 0;
   _file_open = false;
   _header = SharedClassUtil::allocate_file_map_header();
--- a/hotspot/src/share/vm/memory/universe.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/memory/universe.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -874,10 +874,10 @@
       return "Non-zero disjoint base";
     case HeapBasedNarrowOop:
       return "Non-zero based";
+    default:
+      ShouldNotReachHere();
+      return "";
   }
-
-  ShouldNotReachHere();
-  return "";
 }
 
 
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1738,7 +1738,7 @@
     assert(size + ent_size <= cpool_size, "Size mismatch");
 
     *bytes = tag;
-    DBG(printf("#%03hd tag=%03hd, ", idx, tag));
+    DBG(printf("#%03hd tag=%03hd, ", (short)idx, (short)tag));
     switch(tag) {
       case JVM_CONSTANT_Invalid: {
         DBG(printf("JVM_CONSTANT_Invalid"));
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -389,6 +389,8 @@
       case Bytecodes::_invokedynamic:
         assert(f1->is_method(), "");
         return (Method*)f1;
+      default:
+        break;
       }
     }
   }
@@ -409,6 +411,8 @@
         }
       }
       break;
+    default:
+      break;
     }
   }
   return NULL;
--- a/hotspot/src/share/vm/oops/generateOopMap.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/generateOopMap.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -237,6 +237,8 @@
       case Bytecodes::_jsr_w:
         add_jsr(i.next_bci(), i.dest_w());
         break;
+      default:
+        break;
     }
   }
 }
@@ -430,6 +432,8 @@
         assert(!fellThrough, "should not happen");
         bb_mark_fct(this, bci + Bytecodes::length_for(bytecode), NULL);
         break;
+      default:
+        break;
     }
 
     if (possible_gc_point(&bcs))
@@ -489,6 +493,8 @@
             assert(!fell_through, "should not happen");
             reachable_basicblock(this, bci + Bytecodes::length_for(bytecode), &change);
             break;
+          default:
+            break;
         }
         if (fell_through) {
           // Mark successor as alive
@@ -1187,6 +1193,9 @@
         return;
       }
       break;
+
+    default:
+      break;
   }
 
   if (_has_exceptions) {
@@ -1272,24 +1281,38 @@
 void GenerateOopMap::print_current_state(outputStream   *os,
                                          BytecodeStream *currentBC,
                                          bool            detailed) {
-
   if (detailed) {
     os->print("     %4d vars     = ", currentBC->bci());
     print_states(os, vars(), _max_locals);
     os->print("    %s", Bytecodes::name(currentBC->code()));
-    switch(currentBC->code()) {
-      case Bytecodes::_invokevirtual:
-      case Bytecodes::_invokespecial:
-      case Bytecodes::_invokestatic:
-      case Bytecodes::_invokedynamic:
-      case Bytecodes::_invokeinterface:
-        int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache();
-        ConstantPool* cp      = method()->constants();
-        int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
-        int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
-        Symbol* signature     = cp->symbol_at(signatureIdx);
-        os->print("%s", signature->as_C_string());
+  } else {
+    os->print("    %4d  vars = '%s' ", currentBC->bci(),  state_vec_to_string(vars(), _max_locals));
+    os->print("     stack = '%s' ", state_vec_to_string(stack(), _stack_top));
+    if (_monitor_top != bad_monitors) {
+      os->print("  monitors = '%s'  \t%s", state_vec_to_string(monitors(), _monitor_top), Bytecodes::name(currentBC->code()));
+    } else {
+      os->print("  [bad monitor stack]");
     }
+  }
+
+  switch(currentBC->code()) {
+    case Bytecodes::_invokevirtual:
+    case Bytecodes::_invokespecial:
+    case Bytecodes::_invokestatic:
+    case Bytecodes::_invokedynamic:
+    case Bytecodes::_invokeinterface: {
+      int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache();
+      ConstantPool* cp      = method()->constants();
+      int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
+      int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
+      Symbol* signature     = cp->symbol_at(signatureIdx);
+      os->print("%s", signature->as_C_string());
+    }
+    default:
+      break;
+  }
+
+  if (detailed) {
     os->cr();
     os->print("          stack    = ");
     print_states(os, stack(), _stack_top);
@@ -1300,30 +1323,9 @@
     } else {
       os->print("          [bad monitor stack]");
     }
-    os->cr();
-  } else {
-    os->print("    %4d  vars = '%s' ", currentBC->bci(),  state_vec_to_string(vars(), _max_locals));
-    os->print("     stack = '%s' ", state_vec_to_string(stack(), _stack_top));
-    if (_monitor_top != bad_monitors) {
-      os->print("  monitors = '%s'  \t%s", state_vec_to_string(monitors(), _monitor_top), Bytecodes::name(currentBC->code()));
-    } else {
-      os->print("  [bad monitor stack]");
-    }
-    switch(currentBC->code()) {
-      case Bytecodes::_invokevirtual:
-      case Bytecodes::_invokespecial:
-      case Bytecodes::_invokestatic:
-      case Bytecodes::_invokedynamic:
-      case Bytecodes::_invokeinterface:
-        int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache();
-        ConstantPool* cp      = method()->constants();
-        int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
-        int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
-        Symbol* signature     = cp->symbol_at(signatureIdx);
-        os->print("%s", signature->as_C_string());
-    }
-    os->cr();
   }
+
+  os->cr();
 }
 
 // Sets the current state to be the state after executing the
@@ -2476,8 +2478,9 @@
     case Bytecodes::_astore:
       *index = itr->get_index();
       return true;
+    default:
+      return false;
   }
-  return false;
 }
 
 bool GenerateOopMap::is_aload(BytecodeStream *itr, int *index) {
@@ -2493,8 +2496,10 @@
     case Bytecodes::_aload:
       *index = itr->get_index();
       return true;
+
+    default:
+      return false;
   }
-  return false;
 }
 
 
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1078,7 +1078,7 @@
 void InstanceKlass::call_class_initializer(TRAPS) {
   if (ReplayCompiles &&
       (ReplaySuppressInitializers == 1 ||
-       ReplaySuppressInitializers >= 2 && class_loader() != NULL)) {
+       (ReplaySuppressInitializers >= 2 && class_loader() != NULL))) {
     // Hide the existence of the initializer for the purpose of replaying the compile
     return;
   }
--- a/hotspot/src/share/vm/oops/method.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/method.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -550,6 +550,9 @@
       case Bytecodes::_jsr_w:
         if( bcs.dest_w() < bcs.next_bci() ) _access_flags.set_has_loops();
         break;
+
+      default:
+        break;
     }
   }
   _access_flags.set_loops_flag_init();
@@ -1390,7 +1393,10 @@
   ConstMethod* newcm = newm->constMethod();
   int new_const_method_size = newm->constMethod()->size();
 
-  memcpy(newm(), m(), sizeof(Method));
+  // This works because the source and target are both Methods. Some compilers
+  // (e.g., clang) complain that the target vtable pointer will be stomped,
+  // so cast away newm()'s and m()'s Methodness.
+  memcpy((void*)newm(), (void*)m(), sizeof(Method));
 
   // Create shallow copy of ConstMethod.
   memcpy(newcm, m->constMethod(), sizeof(ConstMethod));
@@ -1513,6 +1519,8 @@
       klass_id = vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_Math);
       id = vmIntrinsics::find_id(klass_id, name_id, sig_id, flags);
       break;
+    default:
+      break;
     }
     break;
 
@@ -1524,6 +1532,9 @@
     if (is_static() != MethodHandles::is_signature_polymorphic_static(id))
       id = vmIntrinsics::_none;
     break;
+
+  default:
+    break;
   }
 
   if (id != vmIntrinsics::_none) {
--- a/hotspot/src/share/vm/oops/methodData.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -779,8 +779,9 @@
   case Bytecodes::_lookupswitch:
   case Bytecodes::_tableswitch:
     return variable_cell_count;
+  default:
+    return no_profile_data;
   }
-  return no_profile_data;
 }
 
 // Compute the size of the profiling information corresponding to
@@ -1048,6 +1049,8 @@
     cell_count = MultiBranchData::compute_cell_count(stream);
     tag = DataLayout::multi_branch_data_tag;
     break;
+  default:
+    break;
   }
   assert(tag == DataLayout::multi_branch_data_tag ||
          ((MethodData::profile_arguments() || MethodData::profile_return()) &&
--- a/hotspot/src/share/vm/opto/cfgnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -521,9 +521,9 @@
     // Loop node may have only one input because entry path
     // is removed in PhaseIdealLoop::Dominators().
     assert(!this->is_Loop() || cnt_orig <= 3, "Loop node should have 3 or less inputs");
-    if (this->is_Loop() && (del_it == LoopNode::EntryControl ||
-                            del_it == 0 && is_unreachable_region(phase)) ||
-       !this->is_Loop() && has_phis && is_unreachable_region(phase)) {
+    if ((this->is_Loop() && (del_it == LoopNode::EntryControl ||
+                             (del_it == 0 && is_unreachable_region(phase)))) ||
+        (!this->is_Loop() && has_phis && is_unreachable_region(phase))) {
       // Yes,  the region will be removed during the next step below.
       // Cut the backedge input and remove phis since no data paths left.
       // We don't cut outputs to other nodes here since we need to put them
@@ -1689,8 +1689,8 @@
       bool is_loop = (r->is_Loop() && r->req() == 3);
       // Then, check if there is a data loop when phi references itself directly
       // or through other data nodes.
-      if (is_loop && !uin->eqv_uncast(in(LoopNode::EntryControl)) ||
-         !is_loop && is_unsafe_data_reference(uin)) {
+      if ((is_loop && !uin->eqv_uncast(in(LoopNode::EntryControl))) ||
+          (!is_loop && is_unsafe_data_reference(uin))) {
         // Break this data loop to avoid creation of a dead loop.
         if (can_reshape) {
           return top;
--- a/hotspot/src/share/vm/opto/chaitin.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/chaitin.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1301,7 +1301,7 @@
       if( iscore < score ||
           (iscore == score && iarea > area && lrgs(lo_score)._was_spilled2) ||
           (iscore == score && iarea == area &&
-           ( (ibound && !bound) || ibound == bound && (icost < cost) )) ) {
+           ( (ibound && !bound) || (ibound == bound && (icost < cost)) )) ) {
         lo_score = i;
         score = iscore;
         area = iarea;
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3405,7 +3405,7 @@
           for (uint i = 0; i < in->outcnt(); i++) {
             Node* u = in->raw_out(i);
             if (!u->is_SafePoint() ||
-                 u->is_Call() && u->as_Call()->has_non_debug_use(n)) {
+                (u->is_Call() && u->as_Call()->has_non_debug_use(n))) {
               safe_to_skip = false;
             }
           }
@@ -3837,9 +3837,8 @@
   case T_ADDRESS: return (_v._value.l == other._v._value.l);
   case T_VOID:    return (_v._value.l == other._v._value.l);  // jump-table entries
   case T_METADATA: return (_v._metadata == other._v._metadata);
-  default: ShouldNotReachHere();
+  default: ShouldNotReachHere(); return false;
   }
-  return false;
 }
 
 static int type_to_size_in_bytes(BasicType t) {
@@ -3854,10 +3853,10 @@
   case T_VOID:
   case T_ADDRESS:
   case T_OBJECT:  return sizeof(jobject);
+  default:
+    ShouldNotReachHere();
+    return -1;
   }
-
-  ShouldNotReachHere();
-  return -1;
 }
 
 int Compile::ConstantTable::qsort_comparator(Constant* a, Constant* b) {
--- a/hotspot/src/share/vm/opto/compile.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/compile.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,13 +95,13 @@
  public:
 
   void set_idx(node_idx_t idx) {
-    _idx_clone_orig = _idx_clone_orig & CONST64(0xFFFFFFFF00000000) | idx;
+    _idx_clone_orig = (_idx_clone_orig & CONST64(0xFFFFFFFF00000000)) | idx;
   }
   node_idx_t idx() const { return (node_idx_t)(_idx_clone_orig & 0xFFFFFFFF); }
 
   void set_gen(int generation) {
     uint64_t g = (uint64_t)generation << 32;
-    _idx_clone_orig = _idx_clone_orig & 0xFFFFFFFF | g;
+    _idx_clone_orig = (_idx_clone_orig & 0xFFFFFFFF) | g;
   }
   int gen() const { return (int)(_idx_clone_orig >> 32); }
 
--- a/hotspot/src/share/vm/opto/connode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/connode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,9 +61,8 @@
     //   r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660
     // %%%% Stop using TypePtr::NULL_PTR to represent nulls:  use either TypeRawPtr::NULL_PTR
     // or else TypeOopPtr::NULL_PTR.  Then set Type::_basic_type[AnyPtr] = T_ILLEGAL
+  default:
+    ShouldNotReachHere();
+    return NULL;
   }
-  ShouldNotReachHere();
-  return NULL;
 }
-
-
--- a/hotspot/src/share/vm/opto/escape.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -512,11 +512,11 @@
       if (adr_type == NULL) {
         break; // skip dead nodes
       }
-      if (adr_type->isa_oopptr() ||
-          (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) &&
-                        (adr_type == TypeRawPtr::NOTNULL &&
-                         adr->in(AddPNode::Address)->is_Proj() &&
-                         adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
+      if (   adr_type->isa_oopptr()
+          || (   (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
+              && adr_type == TypeRawPtr::NOTNULL
+              && adr->in(AddPNode::Address)->is_Proj()
+              && adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
         delayed_worklist->push(n); // Process it later.
 #ifdef ASSERT
         assert(adr->is_AddP(), "expecting an AddP");
@@ -725,11 +725,11 @@
           opcode == Op_CompareAndExchangeN || opcode == Op_CompareAndExchangeP) {
         add_local_var_and_edge(n, PointsToNode::NoEscape, adr, NULL);
       }
-      if (adr_type->isa_oopptr() ||
-          (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) &&
-                        (adr_type == TypeRawPtr::NOTNULL &&
-                         adr->in(AddPNode::Address)->is_Proj() &&
-                         adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
+      if (   adr_type->isa_oopptr()
+          || (   (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
+              && adr_type == TypeRawPtr::NOTNULL
+              && adr->in(AddPNode::Address)->is_Proj()
+              && adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
         // Point Address to Value
         PointsToNode* adr_ptn = ptnode_adr(adr->_idx);
         assert(adr_ptn != NULL &&
@@ -1964,8 +1964,8 @@
   bool set2_has_unknown_ptr = ptn2->points_to(phantom_obj);
   bool set1_has_null_ptr    = ptn1->points_to(null_obj);
   bool set2_has_null_ptr    = ptn2->points_to(null_obj);
-  if (set1_has_unknown_ptr && set2_has_null_ptr ||
-      set2_has_unknown_ptr && set1_has_null_ptr) {
+  if ((set1_has_unknown_ptr && set2_has_null_ptr) ||
+      (set2_has_unknown_ptr && set1_has_null_ptr)) {
     // Check nullness of unknown object.
     return NULL;
   }
@@ -2624,7 +2624,7 @@
         continue;
       }
       tp = use->as_MemBar()->adr_type()->isa_ptr();
-      if (tp != NULL && C->get_alias_index(tp) == alias_idx ||
+      if ((tp != NULL && C->get_alias_index(tp) == alias_idx) ||
           alias_idx == general_idx) {
         continue; // Nothing to do
       }
--- a/hotspot/src/share/vm/opto/gcm.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/gcm.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -512,7 +512,7 @@
 #ifdef ASSERT
   if (load_alias_idx == Compile::AliasIdxBot && C->AliasLevel() > 0 &&
       (PrintOpto || VerifyAliases ||
-       PrintMiscellaneous && (WizardMode || Verbose))) {
+       (PrintMiscellaneous && (WizardMode || Verbose)))) {
     // Load nodes should not consume all of memory.
     // Reporting a bottom type indicates a bug in adlc.
     // If some particular type of node validly consumes all of memory,
@@ -931,7 +931,7 @@
   Node *n;
 
   // Walk over all the nodes from last to first
-  while (n = iter.next()) {
+  while ((n = iter.next())) {
     // Set the latency for the definitions of this instruction
     partial_latency_of_defs(n);
   }
@@ -1206,7 +1206,7 @@
   Node *self;
 
   // Walk over all the nodes from last to first
-  while (self = iter.next()) {
+  while ((self = iter.next())) {
     Block* early = get_block_for_node(self); // Earliest legal placement
 
     if (self->is_top()) {
@@ -1234,7 +1234,7 @@
         early->add_inst(self);
         continue;
         break;
-      case Op_CheckCastPP:
+      case Op_CheckCastPP: {
         // Don't move CheckCastPP nodes away from their input, if the input
         // is a rawptr (5071820).
         Node *def = self->in(1);
@@ -1247,6 +1247,9 @@
         }
         break;
       }
+      default:
+        break;
+      }
     }
 
     // Gather LCA of all uses
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -584,6 +584,8 @@
         ex_obj = env()->ClassCastException_instance();
       }
       break;
+    default:
+      break;
     }
     if (failing()) { stop(); return; }  // exception allocation might fail
     if (ex_obj != NULL) {
@@ -821,7 +823,7 @@
   if (cur_method != NULL && cur_bci != InvocationEntryBci) {
     Bytecodes::Code code = cur_method->java_code_at_bci(cur_bci);
     return Interpreter::bytecode_should_reexecute(code) ||
-           is_anewarray && code == Bytecodes::_multianewarray;
+           (is_anewarray && code == Bytecodes::_multianewarray);
     // Reexecute _multianewarray bytecode which was replaced with
     // sequence of [a]newarray. See Parse::do_multianewarray().
     //
@@ -1106,6 +1108,7 @@
   case Bytecodes::_aload_0:   assert(inputs == 0 && outputs == 1, ""); break;
   case Bytecodes::_return:    assert(inputs == 0 && outputs == 0, ""); break;
   case Bytecodes::_drem:      assert(inputs == 4 && outputs == 2, ""); break;
+  default:                    break;
   }
 #endif //ASSERT
 
@@ -1500,7 +1503,7 @@
     ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency, unaligned, mismatched);
   }
   ld = _gvn.transform(ld);
-  if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
+  if (((bt == T_OBJECT) && C->do_escape_analysis()) || C->eliminate_boxing()) {
     // Improve graph before escape analysis and boxing elimination.
     record_for_igvn(ld);
   }
@@ -2024,14 +2027,14 @@
   case Deoptimization::Action_make_not_entrant:
     C->set_trap_can_recompile(true);
     break;
-#ifdef ASSERT
   case Deoptimization::Action_none:
   case Deoptimization::Action_make_not_compilable:
     break;
   default:
+#ifdef ASSERT
     fatal("unknown action %d: %s", action, Deoptimization::trap_action_name(action));
+#endif
     break;
-#endif
   }
 
   if (TraceOptoParse) {
--- a/hotspot/src/share/vm/opto/ifg.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/ifg.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
   _adjs = (IndexSet*)_arena->Amalloc(sizeof(IndexSet)*maxlrg);
   // Also make empty live range structures
   _lrgs = (LRG *)_arena->Amalloc( maxlrg * sizeof(LRG) );
-  memset(_lrgs,0,sizeof(LRG)*maxlrg);
+  memset((void*)_lrgs,0,sizeof(LRG)*maxlrg);
   // Init all to empty
   for( uint i = 0; i < maxlrg; i++ ) {
     _adjs[i].initialize(maxlrg);
--- a/hotspot/src/share/vm/opto/ifnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/ifnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -672,6 +672,8 @@
               // lo unchanged
               hi = TypeInt::INT->_hi;
               break;
+            default:
+              break;
             }
             const TypeInt* rtn_t = TypeInt::make(lo, hi, cmp2_t->_widen);
             return rtn_t;
--- a/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -224,7 +224,7 @@
           continue;             // Not an memory op; skip it
         }
         if (val == base ||
-            val == index && val->bottom_type()->isa_narrowoop()) {
+            (val == index && val->bottom_type()->isa_narrowoop())) {
           break;                // Found it
         } else {
           continue;             // Skip it
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1991,6 +1991,8 @@
       case BoolTest::gt:          // x > y
       case BoolTest::ge:          // x >= y
         return (want_max ? xvalue : yvalue);
+      default:
+        break;
       }
     }
   }
@@ -2624,6 +2626,8 @@
       val = ConvL2X(val);
       val = _gvn.transform(new CastX2PNode(val));
       break;
+    default:
+      break;
     }
 
     if (type == T_OBJECT) {
@@ -6183,6 +6187,8 @@
     stubAddr = StubRoutines::aescrypt_decryptBlock();
     stubName = "aescrypt_decryptBlock";
     break;
+  default:
+    break;
   }
   if (stubAddr == NULL) return false;
 
@@ -6250,6 +6256,8 @@
     stubAddr = StubRoutines::cipherBlockChaining_decryptAESCrypt();
     stubName = "cipherBlockChaining_decryptAESCrypt";
     break;
+  default:
+    break;
   }
   if (stubAddr == NULL) return false;
 
--- a/hotspot/src/share/vm/opto/live.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/live.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -347,18 +347,18 @@
                     }
                   }
                 } else if( check->bottom_type()->is_ptr()->_offset == 0 ) {
-                  if(check->is_Proj() || check->is_Mach() &&
+                  if(check->is_Proj() || (check->is_Mach() &&
                      (check->as_Mach()->ideal_Opcode() == Op_CreateEx ||
                       check->as_Mach()->ideal_Opcode() == Op_ThreadLocal ||
                       check->as_Mach()->ideal_Opcode() == Op_CMoveP ||
                       check->as_Mach()->ideal_Opcode() == Op_CheckCastPP ||
 #ifdef _LP64
-                      UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_CastPP ||
-                      UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_DecodeN ||
-                      UseCompressedClassPointers && check->as_Mach()->ideal_Opcode() == Op_DecodeNKlass ||
+                      (UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_CastPP) ||
+                      (UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_DecodeN) ||
+                      (UseCompressedClassPointers && check->as_Mach()->ideal_Opcode() == Op_DecodeNKlass) ||
 #endif
                       check->as_Mach()->ideal_Opcode() == Op_LoadP ||
-                      check->as_Mach()->ideal_Opcode() == Op_LoadKlass)) {
+                      check->as_Mach()->ideal_Opcode() == Op_LoadKlass))) {
                     // Valid nodes
                   } else {
                     check->dump();
--- a/hotspot/src/share/vm/opto/loopPredicate.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/loopPredicate.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -662,9 +662,13 @@
   if (offset && (!offset->is_Con() || offset->get_int() != 0)){
     max_idx_expr = new AddINode(max_idx_expr, offset);
     register_new_node(max_idx_expr, ctrl);
-    if (TraceLoopPredicate)
-      if (offset->is_Con()) predString->print("+ %d ", offset->get_int());
-      else predString->print("+ offset ");
+    if (TraceLoopPredicate) {
+      if (offset->is_Con()) {
+        predString->print("+ %d ", offset->get_int());
+      } else {
+        predString->print("+ offset ");
+      }
+    }
   }
 
   CmpUNode* cmp = new CmpUNode(max_idx_expr, range);
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -208,7 +208,7 @@
 // inv1 - (x + inv2)  =>  ( inv1 - inv2) - x
 //
 Node* IdealLoopTree::reassociate_add_sub(Node* n1, PhaseIdealLoop *phase) {
-  if (!n1->is_Add() && !n1->is_Sub() || n1->outcnt() == 0) return NULL;
+  if ((!n1->is_Add() && !n1->is_Sub()) || n1->outcnt() == 0) return NULL;
   if (is_invariant(n1)) return NULL;
   int inv1_idx = is_invariant_addition(n1, phase);
   if (!inv1_idx) return NULL;
@@ -729,8 +729,8 @@
   // After unroll limit will be adjusted: new_limit = limit-stride.
   // Bailout if adjustment overflow.
   const TypeInt* limit_type = phase->_igvn.type(limit_n)->is_int();
-  if (stride_con > 0 && ((limit_type->_hi - stride_con) >= limit_type->_hi) ||
-      stride_con < 0 && ((limit_type->_lo - stride_con) <= limit_type->_lo))
+  if ((stride_con > 0 && ((limit_type->_hi - stride_con) >= limit_type->_hi)) ||
+      (stride_con < 0 && ((limit_type->_lo - stride_con) <= limit_type->_lo)))
     return false;  // overflow
 
   // Adjust body_size to determine if we unroll or not
@@ -1413,7 +1413,7 @@
     loop->dump_head();
   }
 
-  if (C->do_vector_loop() && (PrintOpto && VerifyLoopOptimizations || TraceLoopOpts)) {
+  if (C->do_vector_loop() && (PrintOpto && (VerifyLoopOptimizations || TraceLoopOpts))) {
     Arena* arena = Thread::current()->resource_area();
     Node_Stack stack(arena, C->live_nodes() >> 2);
     Node_List rpo_list;
@@ -1516,8 +1516,8 @@
         limit = new Opaque2Node( C, limit );
         register_new_node( limit, opaq_ctrl );
       }
-      if (stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo) ||
-          stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi)) {
+      if ((stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo)) ||
+          (stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi))) {
         // No underflow.
         new_limit = new SubINode(limit, stride);
       } else {
@@ -1652,7 +1652,7 @@
   loop->record_for_igvn();
 
 #ifndef PRODUCT
-  if (C->do_vector_loop() && (PrintOpto && VerifyLoopOptimizations || TraceLoopOpts)) {
+  if (C->do_vector_loop() && (PrintOpto && (VerifyLoopOptimizations || TraceLoopOpts))) {
     tty->print("\nnew loop after unroll\n");       loop->dump_head();
     for (uint i = 0; i < loop->_body.size(); i++) {
       loop->_body.at(i)->dump();
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -385,8 +385,8 @@
   // Phi must be of loop header; backedge must wrap to increment
   if (phi->region() != x)
     return false;
-  if (trunc1 == NULL && phi->in(LoopNode::LoopBackControl) != incr ||
-      trunc1 != NULL && phi->in(LoopNode::LoopBackControl) != trunc1) {
+  if ((trunc1 == NULL && phi->in(LoopNode::LoopBackControl) != incr) ||
+      (trunc1 != NULL && phi->in(LoopNode::LoopBackControl) != trunc1)) {
     return false;
   }
   Node *init_trip = phi->in(LoopNode::EntryControl);
@@ -430,11 +430,11 @@
   // through MININT to MAXINT, then bail out.
   if (bt == BoolTest::eq || // Bail out, but this loop trips at most twice!
       // Odd stride
-      bt == BoolTest::ne && stride_con != 1 && stride_con != -1 ||
+      (bt == BoolTest::ne && stride_con != 1 && stride_con != -1) ||
       // Count down loop rolls through MAXINT
-      (bt == BoolTest::le || bt == BoolTest::lt) && stride_con < 0 ||
+      ((bt == BoolTest::le || bt == BoolTest::lt) && stride_con < 0) ||
       // Count up loop rolls through MININT
-      (bt == BoolTest::ge || bt == BoolTest::gt) && stride_con > 0) {
+      ((bt == BoolTest::ge || bt == BoolTest::gt) && stride_con > 0)) {
     return false; // Bail out
   }
 
--- a/hotspot/src/share/vm/opto/loopopts.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/loopopts.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1910,7 +1910,7 @@
   }
   BoolNode* bl = iff->in(1)->as_Bool();
   Node* cmp = bl->in(1);
-  if (!cmp || cmp->Opcode() != Op_CmpI && cmp->Opcode() != Op_CmpU) {
+  if (!cmp || (cmp->Opcode() != Op_CmpI && cmp->Opcode() != Op_CmpU)) {
     return 0;
   }
   // Must have an invariant operand
--- a/hotspot/src/share/vm/opto/macro.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/macro.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1359,7 +1359,7 @@
   }
 
   if (C->env()->dtrace_alloc_probes() ||
-      !UseTLAB && (!Universe::heap()->supports_inline_contig_alloc())) {
+      (!UseTLAB && !Universe::heap()->supports_inline_contig_alloc())) {
     // Force slow-path allocation
     always_slow = true;
     initial_slow_test = NULL;
--- a/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1680,14 +1680,14 @@
       }
       const Type* mach_at = mach->adr_type();
       // DecodeN node consumed by an address may have different type
-      // then its input. Don't compare types for such case.
+      // than its input. Don't compare types for such case.
       if (m->adr_type() != mach_at &&
           (m->in(MemNode::Address)->is_DecodeNarrowPtr() ||
-           m->in(MemNode::Address)->is_AddP() &&
-           m->in(MemNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr() ||
-           m->in(MemNode::Address)->is_AddP() &&
-           m->in(MemNode::Address)->in(AddPNode::Address)->is_AddP() &&
-           m->in(MemNode::Address)->in(AddPNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr())) {
+           (m->in(MemNode::Address)->is_AddP() &&
+            m->in(MemNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr()) ||
+           (m->in(MemNode::Address)->is_AddP() &&
+            m->in(MemNode::Address)->in(AddPNode::Address)->is_AddP() &&
+            m->in(MemNode::Address)->in(AddPNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr()))) {
         mach_at = m->adr_type();
       }
       if (m->adr_type() != mach_at) {
--- a/hotspot/src/share/vm/opto/memnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -205,10 +205,10 @@
     assert(mphi->bottom_type() == Type::MEMORY, "memory phi required");
     const TypePtr *t = mphi->adr_type();
     if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM ||
-        t->isa_oopptr() && !t->is_oopptr()->is_known_instance() &&
-        t->is_oopptr()->cast_to_exactness(true)
-         ->is_oopptr()->cast_to_ptr_type(t_oop->ptr())
-         ->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop) {
+        (t->isa_oopptr() && !t->is_oopptr()->is_known_instance() &&
+         t->is_oopptr()->cast_to_exactness(true)
+           ->is_oopptr()->cast_to_ptr_type(t_oop->ptr())
+            ->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop)) {
       // clone the Phi with our address type
       result = mphi->split_out_instance(t_adr, igvn);
     } else {
@@ -321,7 +321,7 @@
 
   if (can_reshape && igvn != NULL &&
       (igvn->_worklist.member(address) ||
-       igvn->_worklist.size() > 0 && (t_adr != adr_type())) ) {
+       (igvn->_worklist.size() > 0 && t_adr != adr_type())) ) {
     // The address's base and type may change when the address is processed.
     // Delay this mem node transformation until the address is processed.
     phase->is_IterGVN()->_worklist.push(this);
@@ -821,6 +821,9 @@
       load = new LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency);
     }
     break;
+  default:
+    // ShouldNotReachHere(); ???
+    break;
   }
   assert(load != NULL, "LoadNode should have been created");
   if (unaligned) {
@@ -1203,7 +1206,7 @@
     // of the original value. It is done in split_through_phi().
     return NULL;
   } else if (base->is_Load() ||
-             base->is_DecodeN() && base->in(1)->is_Load()) {
+             (base->is_DecodeN() && base->in(1)->is_Load())) {
     // Eliminate the load of boxed value for integer types from the cache
     // array by deriving the value from the index into the array.
     // Capture the offset of the load and then reverse the computation.
@@ -1227,10 +1230,10 @@
         Node* elements[4];
         int shift = exact_log2(type2aelembytes(T_OBJECT));
         int count = address->unpack_offsets(elements, ARRAY_SIZE(elements));
-        if ((count >  0) && elements[0]->is_Con() &&
-            ((count == 1) ||
-             (count == 2) && elements[1]->Opcode() == Op_LShiftX &&
-                             elements[1]->in(2) == phase->intcon(shift))) {
+        if (count > 0 && elements[0]->is_Con() &&
+            (count == 1 ||
+             (count == 2 && elements[1]->Opcode() == Op_LShiftX &&
+                            elements[1]->in(2) == phase->intcon(shift)))) {
           ciObjArray* array = base_type->const_oop()->as_obj_array();
           // Fetch the box object cache[0] at the base of the array and get its value
           ciInstance* box = array->obj_at(0)->as_instance();
@@ -2364,9 +2367,10 @@
     {
       return new StorePNode(ctl, mem, adr, adr_type, val, mo);
     }
+  default:
+    ShouldNotReachHere();
+    return (StoreNode*)NULL;
   }
-  ShouldNotReachHere();
-  return (StoreNode*)NULL;
 }
 
 StoreLNode* StoreLNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo) {
@@ -4306,8 +4310,9 @@
   if( base_memory()->is_MergeMem() ) {
     MergeMemNode *new_mbase = base_memory()->as_MergeMem();
     Node *m = phase->transform(new_mbase);  // Rollup any cycles
-    if( m != NULL && (m->is_top() ||
-        m->is_MergeMem() && m->as_MergeMem()->base_memory() == empty_mem) ) {
+    if( m != NULL &&
+        (m->is_top() ||
+         (m->is_MergeMem() && m->as_MergeMem()->base_memory() == empty_mem)) ) {
       // propagate rollup of dead cycle to self
       set_req(Compile::AliasIdxBot, empty_mem);
     }
--- a/hotspot/src/share/vm/opto/mulnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/mulnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,9 +88,9 @@
     // Check for dead loop
     int   op1 = mul1->Opcode();
     if( phase->eqv( mul1, this ) || phase->eqv( in(2), this ) ||
-        ( op1 == mul_opcode() || op1 == add_opcode() ) &&
-        ( phase->eqv( mul1->in(1), this ) || phase->eqv( mul1->in(2), this ) ||
-          phase->eqv( mul1->in(1), mul1 ) || phase->eqv( mul1->in(2), mul1 ) ) )
+        ( ( op1 == mul_opcode() || op1 == add_opcode() ) &&
+          ( phase->eqv( mul1->in(1), this ) || phase->eqv( mul1->in(2), this ) ||
+            phase->eqv( mul1->in(1), mul1 ) || phase->eqv( mul1->in(2), mul1 ) ) ) )
       assert(false, "dead loop in MulNode::Ideal");
 #endif
 
--- a/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/output.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2719,7 +2719,7 @@
     // Kill projections on a branch should appear to occur on the
     // branch, not afterwards, so grab the masks from the projections
     // and process them.
-    if (n->is_MachBranch() || n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_Jump) {
+    if (n->is_MachBranch() || (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_Jump)) {
       for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
         Node* use = n->fast_out(i);
         if (use->is_Proj()) {
--- a/hotspot/src/share/vm/opto/parse1.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/parse1.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -657,7 +657,7 @@
       NOT_PRODUCT(blocks_parsed++);
 
       progress = true;
-      if (block->is_loop_head() || block->is_handler() || has_irreducible && !block->is_ready()) {
+      if (block->is_loop_head() || block->is_handler() || (has_irreducible && !block->is_ready())) {
         // Not all preds have been parsed.  We must build phis everywhere.
         // (Note that dead locals do not get phis built, ever.)
         ensure_phis_everywhere();
@@ -746,6 +746,8 @@
   case T_BOOLEAN:
     v = gvn->transform(new AndINode(v, gvn->intcon(0x1)));
     break;
+  default:
+    break;
   }
   return v;
 }
--- a/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2148,6 +2148,8 @@
       case Bytecodes::_ifeq:
         // If this is a backwards branch in the bytecodes, add Safepoint
         maybe_add_safepoint(iter().next_get_dest());
+      default:
+        break;
       }
     }
     b = pop_pair();
--- a/hotspot/src/share/vm/opto/parseHelper.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/parseHelper.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -283,7 +283,7 @@
   assert(will_link, "_new: typeflow responsibility");
 
   // Should initialize, or throw an InstantiationError?
-  if (!klass->is_initialized() && !klass->is_being_initialized() ||
+  if ((!klass->is_initialized() && !klass->is_being_initialized()) ||
       klass->is_abstract() || klass->is_interface() ||
       klass->name() == ciSymbol::java_lang_Class() ||
       iter().is_unresolved_klass()) {
--- a/hotspot/src/share/vm/opto/phaseX.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -395,7 +395,7 @@
   // Unlock all nodes upon replacement of table.
   if (&nh == this)  return;
   if (_table != (Node**)badAddress)  clear();
-  memcpy(this, &nh, sizeof(*this));
+  memcpy((void*)this, (void*)&nh, sizeof(*this));
   // Do not increment hash_lock counts again.
   // Instead, be sure we never again use the source table.
   ((NodeHash*)&nh)->_table = (Node**)badAddress;
@@ -694,6 +694,7 @@
   case Type::Top:  return (ConNode*) C->top();
   case Type::Int:  return intcon( t->is_int()->get_con() );
   case Type::Long: return longcon( t->is_long()->get_con() );
+  default:         break;
   }
   if (t->is_zero_type())
     return zerocon(t->basic_type());
@@ -1675,6 +1676,8 @@
   case Type::Long:
     assert(t0->isa_long()->_widen <= t->isa_long()->_widen, "widen increases");
     break;
+  default:
+    break;
   }
   return true;
 }
--- a/hotspot/src/share/vm/opto/reg_split.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/reg_split.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -80,9 +80,9 @@
   int num_regs = RegMask::num_registers(ireg);
   bool is_vect = RegMask::is_vector(ireg);
   if( w_mask->overlap( *o_mask ) && // Overlap AND
-      ((num_regs == 1) // Single use or aligned
-        ||  is_vect    // or vector
-        || !is_vect && o_mask->is_aligned_pairs()) ) {
+      (num_regs == 1  // Single use or aligned
+        || is_vect    // or vector
+        || (!is_vect && o_mask->is_aligned_pairs())) ) {
     assert(!is_vect || o_mask->is_aligned_sets(num_regs), "vectors are aligned");
     // Don't come here for mis-aligned doubles
     w_o_mask = w_mask;
@@ -1033,7 +1033,7 @@
             if( !umask.is_AllStack() &&
                 (int)umask.Size() <= lrgs(useidx).num_regs() &&
                 (!def->rematerialize() ||
-                 !is_vect && umask.is_misaligned_pair())) {
+                 (!is_vect && umask.is_misaligned_pair()))) {
               // These need a Split regardless of overlap or pressure
               // SPLIT - NO DEF - NO CISC SPILL
               maxlrg = split_USE(MachSpillCopyNode::Bound, def,b,n,inpidx,maxlrg,dup,false, splits,slidx);
@@ -1188,7 +1188,7 @@
         bool is_vect = RegMask::is_vector(ireg);
         // Only split at Def if this is a HRP block or bound (and spilled once)
         if( !n->rematerialize() &&
-            (((dmask.is_bound(ireg) || !is_vect && dmask.is_misaligned_pair()) &&
+            (((dmask.is_bound(ireg) || (!is_vect && dmask.is_misaligned_pair())) &&
               (deflrg._direct_conflict || deflrg._must_spill)) ||
              // Check for LRG being up in a register and we are inside a high
              // pressure area.  Spill it down immediately.
--- a/hotspot/src/share/vm/opto/subnode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,9 +147,9 @@
 #ifdef ASSERT
   // Check for dead loop
   if( phase->eqv( in1, this ) || phase->eqv( in2, this ) ||
-      ( op1 == Op_AddI || op1 == Op_SubI ) &&
-      ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
-        phase->eqv( in1->in(1), in1  ) || phase->eqv( in1->in(2), in1 ) ) )
+      ( ( op1 == Op_AddI || op1 == Op_SubI ) &&
+        ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
+          phase->eqv( in1->in(1), in1  ) || phase->eqv( in1->in(2), in1 ) ) ) )
     assert(false, "dead loop in SubINode::Ideal");
 #endif
 
@@ -277,9 +277,9 @@
 #ifdef ASSERT
   // Check for dead loop
   if( phase->eqv( in1, this ) || phase->eqv( in2, this ) ||
-      ( op1 == Op_AddL || op1 == Op_SubL ) &&
-      ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
-        phase->eqv( in1->in(1), in1  ) || phase->eqv( in1->in(2), in1  ) ) )
+      ( ( op1 == Op_AddL || op1 == Op_SubL ) &&
+        ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
+          phase->eqv( in1->in(1), in1  ) || phase->eqv( in1->in(2), in1  ) ) ) )
     assert(false, "dead loop in SubLNode::Ideal");
 #endif
 
--- a/hotspot/src/share/vm/opto/superword.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/superword.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -325,6 +325,9 @@
             //       buckets for vectors on logicals as these were legacy.
             small_basic_type = true;
             break;
+
+          default:
+            break;
           }
         }
       }
@@ -752,13 +755,13 @@
       int vw = vector_width_in_bytes(s);
       assert(vw > 1, "sanity");
       SWPointer p(s, this, NULL, false);
-      if (cmp_ct.at(j) >  max_ct ||
-          cmp_ct.at(j) == max_ct &&
-            (vw >  max_vw ||
-             vw == max_vw &&
-              (data_size(s) <  min_size ||
-               data_size(s) == min_size &&
-                 (p.offset_in_bytes() < min_iv_offset)))) {
+      if ( cmp_ct.at(j) >  max_ct ||
+          (cmp_ct.at(j) == max_ct &&
+            ( vw >  max_vw ||
+             (vw == max_vw &&
+              ( data_size(s) <  min_size ||
+               (data_size(s) == min_size &&
+                p.offset_in_bytes() < min_iv_offset)))))) {
         max_ct = cmp_ct.at(j);
         max_vw = vw;
         max_idx = j;
@@ -775,13 +778,13 @@
         int vw = vector_width_in_bytes(s);
         assert(vw > 1, "sanity");
         SWPointer p(s, this, NULL, false);
-        if (cmp_ct.at(j) >  max_ct ||
-            cmp_ct.at(j) == max_ct &&
-              (vw >  max_vw ||
-               vw == max_vw &&
-                (data_size(s) <  min_size ||
-                 data_size(s) == min_size &&
-                   (p.offset_in_bytes() < min_iv_offset)))) {
+        if ( cmp_ct.at(j) >  max_ct ||
+            (cmp_ct.at(j) == max_ct &&
+              ( vw >  max_vw ||
+               (vw == max_vw &&
+                ( data_size(s) <  min_size ||
+                 (data_size(s) == min_size &&
+                  p.offset_in_bytes() < min_iv_offset)))))) {
           max_ct = cmp_ct.at(j);
           max_vw = vw;
           max_idx = j;
@@ -925,7 +928,7 @@
   // First, assign a dependence node to each memory node
   for (int i = 0; i < _block.length(); i++ ) {
     Node *n = _block.at(i);
-    if (n->is_Mem() || n->is_Phi() && n->bottom_type() == Type::MEMORY) {
+    if (n->is_Mem() || (n->is_Phi() && n->bottom_type() == Type::MEMORY)) {
       _dg.make_node(n);
     }
   }
@@ -1745,8 +1748,8 @@
   Node_List* in1_pk = _sw->my_pack(in1);
   Node_List* in2_pk = _sw->my_pack(in2);
 
-  if (in1_pk != NULL && in1_pk->size() != cmpd_pk->size()
-    || in2_pk != NULL && in2_pk->size() != cmpd_pk->size() ) {
+  if (  (in1_pk != NULL && in1_pk->size() != cmpd_pk->size())
+     || (in2_pk != NULL && in2_pk->size() != cmpd_pk->size()) ) {
     return false;
   }
 
@@ -4038,7 +4041,7 @@
     _next_idx = 0;
     _end_idx  = _n->outcnt();
     _dep_next = dg.dep(_n)->out_head();
-  } else if (_n->is_Mem() || _n->is_Phi() && _n->bottom_type() == Type::MEMORY) {
+  } else if (_n->is_Mem() || (_n->is_Phi() && _n->bottom_type() == Type::MEMORY)) {
     _next_idx = 0;
     _end_idx  = 0;
     _dep_next = dg.dep(_n)->out_head();
--- a/hotspot/src/share/vm/opto/superword.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/superword.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -599,7 +599,7 @@
   // Comparable?
   int cmp(SWPointer& q) {
     if (valid() && q.valid() &&
-        (_adr == q._adr || _base == _adr && q._base == q._adr) &&
+        (_adr == q._adr || (_base == _adr && q._base == q._adr)) &&
         _scale == q._scale   &&
         _invar == q._invar   &&
         _negate_invar == q._negate_invar) {
--- a/hotspot/src/share/vm/opto/type.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/type.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -269,9 +269,10 @@
       // Invalid ciConstant returned due to OutOfMemoryError in the CI
       assert(Compile::current()->env()->failing(), "otherwise should not see this");
       return NULL;
+    default:
+      // Fall through to failure
+      return NULL;
   }
-  // Fall through to failure
-  return NULL;
 }
 
 static ciConstant check_mismatched_access(ciConstant con, BasicType loadbt, bool is_unsigned) {
@@ -279,12 +280,14 @@
   switch (conbt) {
     case T_BOOLEAN: conbt = T_BYTE;   break;
     case T_ARRAY:   conbt = T_OBJECT; break;
+    default:                          break;
   }
   switch (loadbt) {
     case T_BOOLEAN:   loadbt = T_BYTE;   break;
     case T_NARROWOOP: loadbt = T_OBJECT; break;
     case T_ARRAY:     loadbt = T_OBJECT; break;
     case T_ADDRESS:   loadbt = T_OBJECT; break;
+    default:                             break;
   }
   if (conbt == loadbt) {
     if (is_unsigned && conbt == T_BYTE) {
@@ -1048,10 +1051,11 @@
   case FloatBot:
   case DoubleBot:
     return false;  // never a singleton, therefore never empty
+
+  default:
+    ShouldNotReachHere();
+    return false;
   }
-
-  ShouldNotReachHere();
-  return false;
 }
 
 //------------------------------dump_stats-------------------------------------
@@ -3964,6 +3968,8 @@
     st->print(":%s", ptr_msg[_ptr]);
     if( _klass_is_exact ) st->print(":exact");
     break;
+  default:
+    break;
   }
 
   if( _offset ) {               // Dump offset, if any
@@ -4080,6 +4086,9 @@
     case T_ILLEGAL:
     case T_VOID:
       etype = T_BYTE;           // will produce conservatively high value
+      break;
+    default:
+      break;
     }
     cache = res = arrayOopDesc::max_array_length(etype);
   }
@@ -4430,6 +4439,8 @@
     st->print(":%s", ptr_msg[_ptr]);
     if( _klass_is_exact ) st->print(":exact");
     break;
+  default:
+    break;
   }
 
   if( _offset != 0 ) {
@@ -5195,6 +5206,8 @@
     st->print(":%s", ptr_msg[_ptr]);
     if( _klass_is_exact ) st->print(":exact");
     break;
+  default:
+    break;
   }
 
   if( _offset ) {               // Dump offset, if any
--- a/hotspot/src/share/vm/opto/vectornode.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/opto/vectornode.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,8 @@
     case T_CHAR:
     case T_SHORT:     return Op_AddVS;
     case T_INT:       return Op_AddVI;
+    default:          ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_AddL:
     assert(bt == T_LONG, "must be");
     return Op_AddVL;
@@ -57,8 +57,8 @@
     case T_CHAR:
     case T_SHORT:  return Op_SubVS;
     case T_INT:    return Op_SubVI;
+    default:       ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_SubL:
     assert(bt == T_LONG, "must be");
     return Op_SubVL;
@@ -75,8 +75,8 @@
     case T_CHAR:
     case T_SHORT:  return Op_MulVS;
     case T_INT:    return Op_MulVI;
+    default:       ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_MulL:
     assert(bt == T_LONG, "must be");
     return Op_MulVL;
@@ -123,8 +123,8 @@
     case T_CHAR:
     case T_SHORT:  return Op_LShiftVS;
     case T_INT:    return Op_LShiftVI;
+      default:       ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_LShiftL:
     assert(bt == T_LONG, "must be");
     return Op_LShiftVL;
@@ -135,8 +135,8 @@
     case T_BYTE:   return Op_RShiftVB;
     case T_SHORT:  return Op_RShiftVS;
     case T_INT:    return Op_RShiftVI;
+    default:       ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_RShiftL:
     assert(bt == T_LONG, "must be");
     return Op_RShiftVL;
@@ -151,8 +151,8 @@
                              // a short value into int value with sign
                              // extension before a shift.
     case T_INT:    return Op_URShiftVI;
+    default:       ShouldNotReachHere(); return 0;
     }
-    ShouldNotReachHere();
   case Op_URShiftL:
     assert(bt == T_LONG, "must be");
     return Op_URShiftVL;
@@ -183,8 +183,10 @@
   case Op_StoreF:
   case Op_StoreD:
     return Op_StoreVector;
+
+  default:
+    return 0; // Unimplemented
   }
-  return 0; // Unimplemented
 }
 
 // Also used to check if the code generator
@@ -208,8 +210,9 @@
   case Op_URShiftI:
   case Op_URShiftL:
     return true;
+  default:
+    return false;
   }
-  return false;
 }
 
 // Check if input is loop invariant vector.
@@ -223,8 +226,9 @@
   case Op_ReplicateF:
   case Op_ReplicateD:
     return true;
+  default:
+    return false;
   }
-  return false;
 }
 
 // [Start, end) half-open range defining which operands are vectors
@@ -333,10 +337,10 @@
   case Op_AndV: return new AndVNode(n1, n2, vt);
   case Op_OrV:  return new OrVNode (n1, n2, vt);
   case Op_XorV: return new XorVNode(n1, n2, vt);
+  default:
+    fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
+    return NULL;
   }
-  fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
-  return NULL;
-
 }
 
 VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, Node* n3, uint vlen, BasicType bt) {
@@ -347,9 +351,10 @@
   switch (vopc) {
   case Op_FmaVD: return new FmaVDNode(n1, n2, n3, vt);
   case Op_FmaVF: return new FmaVFNode(n1, n2, n3, vt);
+  default:
+    fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
+    return NULL;
   }
-  fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
-  return NULL;
 }
 
 // Scalar promotion
@@ -372,9 +377,10 @@
     return new ReplicateFNode(s, vt);
   case T_DOUBLE:
     return new ReplicateDNode(s, vt);
+  default:
+    fatal("Type '%s' is not supported for vectors", type2name(bt));
+    return NULL;
   }
-  fatal("Type '%s' is not supported for vectors", type2name(bt));
-  return NULL;
 }
 
 VectorNode* VectorNode::shift_count(Node* shift, Node* cnt, uint vlen, BasicType bt) {
@@ -390,9 +396,10 @@
   case Op_URShiftI:
   case Op_URShiftL:
     return new RShiftCntVNode(cnt, vt);
+  default:
+    fatal("Missed vector creation for '%s'", NodeClassNames[shift->Opcode()]);
+    return NULL;
   }
-  fatal("Missed vector creation for '%s'", NodeClassNames[shift->Opcode()]);
-  return NULL;
 }
 
 // Return initial Pack node. Additional operands added with add_opd() calls.
@@ -413,9 +420,10 @@
     return new PackFNode(s, vt);
   case T_DOUBLE:
     return new PackDNode(s, vt);
+  default:
+    fatal("Type '%s' is not supported for vectors", type2name(bt));
+    return NULL;
   }
-  fatal("Type '%s' is not supported for vectors", type2name(bt));
-  return NULL;
 }
 
 // Create a binary tree form for Packs. [lo, hi) (half-open) range
@@ -426,7 +434,6 @@
     PackNode* pk = PackNode::make(in(lo), 2, vect_type()->element_basic_type());
     pk->add_opd(in(lo+1));
     return pk;
-
   } else {
     int mid = lo + ct/2;
     PackNode* n1 = binary_tree_pack(lo,  mid);
@@ -449,10 +456,11 @@
       return new PackDNode(n1, n2, TypeVect::make(T_DOUBLE, 2));
     case T_DOUBLE:
       return new Pack2DNode(n1, n2, TypeVect::make(T_DOUBLE, 2));
+    default:
+      fatal("Type '%s' is not supported for vectors", type2name(bt));
+      return NULL;
     }
-    fatal("Type '%s' is not supported for vectors", type2name(bt));
   }
-  return NULL;
 }
 
 // Return the vector version of a scalar load node.
@@ -492,9 +500,10 @@
     return new ExtractFNode(v, pos);
   case T_DOUBLE:
     return new ExtractDNode(v, pos);
+  default:
+    fatal("Type '%s' is not supported for vectors", type2name(bt));
+    return NULL;
   }
-  fatal("Type '%s' is not supported for vectors", type2name(bt));
-  return NULL;
 }
 
 int ReductionNode::opcode(int opc, BasicType bt) {
@@ -556,9 +565,10 @@
   case Op_MulReductionVL: return new MulReductionVLNode(ctrl, n1, n2);
   case Op_MulReductionVF: return new MulReductionVFNode(ctrl, n1, n2);
   case Op_MulReductionVD: return new MulReductionVDNode(ctrl, n1, n2);
+  default:
+    fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
+    return NULL;
   }
-  fatal("Missed vector creation for '%s'", NodeClassNames[vopc]);
-  return NULL;
 }
 
 bool ReductionNode::implemented(int opc, uint vlen, BasicType bt) {
@@ -570,4 +580,3 @@
   }
   return false;
 }
-
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -505,7 +505,7 @@
 
   Klass* k = java_lang_Class::as_Klass(mirror);
   // Make allowances for primitive classes ...
-  if (!(k != NULL || allow_primitive && java_lang_Class::is_primitive(mirror))) {
+  if (!(k != NULL || (allow_primitive && java_lang_Class::is_primitive(mirror)))) {
     ReportJNIFatalError(thr, fatal_class_not_a_class);
   }
   return k;
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -890,6 +890,8 @@
         }
         break;
         }
+      default:
+        break;
       }
     }
 
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Wed Jul 05 20:16:26 2017 -0700
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -182,7 +182,7 @@
 </xsl:text>
     </xsl:if>
   </xsl:for-each>
-  <xsl:text>  }
+  <xsl:text>  default: break; }
   // if it does not have a capability it is required
   return JNI_TRUE;
 }
@@ -1232,14 +1232,14 @@
   <xsl:param name="name"/>
   <xsl:text> </xsl:text>
   <xsl:value-of select="$name"/>
-  <xsl:text>=" INT64_FORMAT "</xsl:text>
+  <xsl:text>=" JLONG_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>=" INT64_FORMAT "</xsl:text>
+  <xsl:text>=" JLONG_FORMAT "</xsl:text>
 </xsl:template>
 
 <xsl:template match="size_t" mode="traceInFormat">
--- a/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEventController.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -471,6 +471,8 @@
     // no events allowed when dead
     now_enabled = 0;
     break;
+  default:
+    break;
   }
 
   // if anything changed do update
@@ -503,8 +505,8 @@
     return (jlong)0;
   }
 
-  jlong was_any_env_enabled = state->thread_event_enable()->_event_enabled.get_bits();
-  jlong any_env_enabled = 0;
+  julong was_any_env_enabled = state->thread_event_enable()->_event_enabled.get_bits();
+  julong any_env_enabled = 0;
 
   {
     // This iteration will include JvmtiEnvThreadStates whoses environments
@@ -561,10 +563,10 @@
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
 
   // event enabled for any thread in any environment
-  jlong was_any_env_thread_enabled = JvmtiEventController::_universal_global_event_enabled.get_bits();
-  jlong any_env_thread_enabled = 0;
+  julong was_any_env_thread_enabled = JvmtiEventController::_universal_global_event_enabled.get_bits();
+  julong any_env_thread_enabled = 0;
 
-  EC_TRACE(("[-] # recompute enabled - before " UINT64_FORMAT_X, was_any_env_thread_enabled));
+  EC_TRACE(("[-] # recompute enabled - before " JULONG_FORMAT_X, was_any_env_thread_enabled));
 
   // compute non-thread-filters events.
   // This must be done separately from thread-filtered events, since some
@@ -644,7 +646,7 @@
 
   }
 
-  EC_TRACE(("[-] # recompute enabled - after " UINT64_FORMAT_X, any_env_thread_enabled));
+  EC_TRACE(("[-] # recompute enabled - after " JULONG_FORMAT_X, any_env_thread_enabled));
 }
 
 
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -682,6 +682,8 @@
   case T_ARRAY:
     slot_type = T_OBJECT;
     break;
+  default:
+    break;
   };
   if (_type != slot_type) {
     _result = JVMTI_ERROR_TYPE_MISMATCH;
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -65,6 +65,7 @@
 
 class GrowableElement : public CHeapObj<mtInternal> {
 public:
+  virtual ~GrowableElement() {}
   virtual address getCacheValue()          =0;
   virtual bool equals(GrowableElement* e)  =0;
   virtual bool lessThan(GrowableElement *e)=0;
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -241,16 +241,16 @@
   if (log_is_enabled(Info, redefine, class, timer)) {
     // Used to have separate timers for "doit" and "all", but the timer
     // overhead skewed the measurements.
-    jlong doit_time = _timer_rsc_phase1.milliseconds() +
-                      _timer_rsc_phase2.milliseconds();
-    jlong all_time = _timer_vm_op_prologue.milliseconds() + doit_time;
+    julong doit_time = _timer_rsc_phase1.milliseconds() +
+                       _timer_rsc_phase2.milliseconds();
+    julong all_time = _timer_vm_op_prologue.milliseconds() + doit_time;
 
     log_info(redefine, class, timer)
-      ("vm_op: all=" UINT64_FORMAT "  prologue=" UINT64_FORMAT "  doit=" UINT64_FORMAT,
-       all_time, _timer_vm_op_prologue.milliseconds(), doit_time);
+      ("vm_op: all=" JULONG_FORMAT "  prologue=" JULONG_FORMAT "  doit=" JULONG_FORMAT,
+       all_time, (julong)_timer_vm_op_prologue.milliseconds(), doit_time);
     log_info(redefine, class, timer)
-      ("redefine_single_class: phase1=" UINT64_FORMAT "  phase2=" UINT64_FORMAT,
-       _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds());
+      ("redefine_single_class: phase1=" JULONG_FORMAT "  phase2=" JULONG_FORMAT,
+       (julong)_timer_rsc_phase1.milliseconds(), (julong)_timer_rsc_phase2.milliseconds());
   }
 }
 
@@ -1825,6 +1825,8 @@
           Bytes::put_Java_u2(p, new_index);
         }
       } break;
+      default:
+        break;
     }
   } // end for each bytecode
 
--- a/hotspot/src/share/vm/prims/methodComparator.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/methodComparator.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -252,6 +252,9 @@
       return false;
     break;
   }
+
+  default:
+    break;
   }
 
   return true;
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -357,9 +357,10 @@
   case vmIntrinsics::_linkToStatic:     return vmSymbols::linkToStatic_name();
   case vmIntrinsics::_linkToSpecial:    return vmSymbols::linkToSpecial_name();
   case vmIntrinsics::_linkToInterface:  return vmSymbols::linkToInterface_name();
+  default:
+    fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
+    return 0;
   }
-  fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
-  return 0;
 }
 
 Bytecodes::Code MethodHandles::signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id) {
@@ -382,9 +383,10 @@
   case vmIntrinsics::_linkToStatic:     return JVM_REF_invokeStatic;
   case vmIntrinsics::_linkToSpecial:    return JVM_REF_invokeSpecial;
   case vmIntrinsics::_linkToInterface:  return JVM_REF_invokeInterface;
+  default:
+    fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
+    return 0;
   }
-  fatal("unexpected intrinsic id: %d %s", iid, vmIntrinsics::name_at(iid));
-  return 0;
 }
 
 vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Symbol* name) {
@@ -400,6 +402,7 @@
   case vmSymbols::VM_SYMBOL_ENUM_NAME(linkToStatic_name):     return vmIntrinsics::_linkToStatic;
   case vmSymbols::VM_SYMBOL_ENUM_NAME(linkToSpecial_name):    return vmIntrinsics::_linkToSpecial;
   case vmSymbols::VM_SYMBOL_ENUM_NAME(linkToInterface_name):  return vmIntrinsics::_linkToInterface;
+  default:                                                    break;
   }
 
   // Cover the case of invokeExact and any future variants of invokeFoo.
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -112,7 +112,7 @@
              "raw [ptr+disp] must be consistent with oop::field_base");
     }
     jlong p_size = HeapWordSize * (jlong)(p->size());
-    assert(byte_offset < p_size, "Unsafe access: offset " INT64_FORMAT " > object's size " INT64_FORMAT, byte_offset, p_size);
+    assert(byte_offset < p_size, "Unsafe access: offset " INT64_FORMAT " > object's size " INT64_FORMAT, (int64_t)byte_offset, (int64_t)p_size);
   }
 #endif
 
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -400,7 +400,8 @@
     next_level = CompLevel_simple;
   } else {
     switch(cur_level) {
-    case CompLevel_aot: {
+      default: break;
+      case CompLevel_aot: {
       // If we were at full profile level, would we switch to full opt?
       if (common(p, method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) {
         next_level = CompLevel_full_optimization;
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -149,8 +149,8 @@
 static bool match_option(const JavaVMOption* option, const char** names, const char** tail,
   bool tail_allowed) {
   for (/* empty */; *names != NULL; ++names) {
-    if (match_option(option, *names, tail)) {
-      if (**tail == '\0' || tail_allowed && **tail == ':') {
+  if (match_option(option, *names, tail)) {
+      if (**tail == '\0' || (tail_allowed && **tail == ':')) {
         return true;
       }
     }
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -172,9 +172,10 @@
     case T_ARRAY  : // fall through
     case T_OBJECT:  return T_OBJECT;
 #endif
+    default:
+      ShouldNotReachHere();
+      return T_ILLEGAL;
   }
-  ShouldNotReachHere();
-  return T_ILLEGAL;
 }
 
 // ============ Virtual calls ============
--- a/hotspot/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1673,7 +1673,7 @@
         // the EntryList.  We can make tail access constant-time by converting to
         // a CDLL instead of using our current DLL.
         ObjectWaiter * tail;
-        for (tail = list; tail->_next != NULL; tail = tail->_next) /* empty */;
+        for (tail = list; tail->_next != NULL; tail = tail->_next) {}
         assert(tail != NULL && tail->_next == NULL, "invariant");
         tail->_next = iterator;
         iterator->_prev = tail;
--- a/hotspot/src/share/vm/runtime/perfData.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/perfData.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -288,7 +288,7 @@
     void *_valuep;
 
     PerfData(CounterNS ns, const char* name, Units u, Variability v);
-    ~PerfData();
+    virtual ~PerfData();
 
     // create the entry for the PerfData item in the PerfData memory region.
     // this region is maintained separately from the PerfData objects to
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -126,6 +126,8 @@
         case T_BYTE:
           value->s = (jshort) value->b;
           return;
+        default:
+          break;
       }
       break;  // fail
     case T_INT:
@@ -139,6 +141,8 @@
         case T_SHORT:
           value->i = (jint) value->s;
           return;
+        default:
+          break;
       }
       break;  // fail
     case T_LONG:
@@ -155,6 +159,8 @@
         case T_INT:
           value->j = (jlong) value->i;
           return;
+        default:
+          break;
       }
       break;  // fail
     case T_FLOAT:
@@ -174,6 +180,8 @@
         case T_LONG:
           value->f = (jfloat) value->j;
           return;
+        default:
+          break;
       }
       break;  // fail
     case T_DOUBLE:
@@ -196,6 +204,8 @@
         case T_LONG:
           value->d = (jdouble) value->j;
           return;
+        default:
+          break;
       }
       break;  // fail
     default:
--- a/hotspot/src/share/vm/runtime/relocator.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/relocator.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -247,6 +247,8 @@
           ShouldNotReachHere();
       }
     }
+    default:
+      break;
   }
   return instruction_length_at(bci);
 }
--- a/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -363,8 +363,8 @@
       if (safepoint_limit_time < current_time) {
         tty->print_cr("# SafepointSynchronize: Finished after "
                       INT64_FORMAT_W(6) " ms",
-                      ((current_time - safepoint_limit_time) / MICROUNITS +
-                       (jlong)SafepointTimeoutDelay));
+                      (int64_t)((current_time - safepoint_limit_time) / MICROUNITS +
+                                (jlong)SafepointTimeoutDelay));
       }
     }
 #endif
@@ -1268,11 +1268,11 @@
                INT64_FORMAT_W(7) " " INT64_FORMAT_W(7) " "
                INT64_FORMAT_W(7) " " INT64_FORMAT_W(7) " "
                INT64_FORMAT_W(7) " ] ",
-               sstats->_time_to_spin / MICROUNITS,
-               sstats->_time_to_wait_to_block / MICROUNITS,
-               sstats->_time_to_sync / MICROUNITS,
-               sstats->_time_to_do_cleanups / MICROUNITS,
-               sstats->_time_to_exec_vmop / MICROUNITS);
+               (int64_t)(sstats->_time_to_spin / MICROUNITS),
+               (int64_t)(sstats->_time_to_wait_to_block / MICROUNITS),
+               (int64_t)(sstats->_time_to_sync / MICROUNITS),
+               (int64_t)(sstats->_time_to_do_cleanups / MICROUNITS),
+               (int64_t)(sstats->_time_to_exec_vmop / MICROUNITS));
 
     if (need_to_track_page_armed_status) {
       tty->print(INT32_FORMAT_W(10) " ", sstats->_page_armed);
@@ -1320,10 +1320,10 @@
   tty->print_cr(UINT64_FORMAT_W(5) " VM operations coalesced during safepoint",
                 _coalesced_vmop_count);
   tty->print_cr("Maximum sync time  " INT64_FORMAT_W(5) " ms",
-                _max_sync_time / MICROUNITS);
+                (int64_t)(_max_sync_time / MICROUNITS));
   tty->print_cr("Maximum vm operation time (except for Exit VM operation)  "
                 INT64_FORMAT_W(5) " ms",
-                _max_vmop_time / MICROUNITS);
+                (int64_t)(_max_vmop_time / MICROUNITS));
 }
 
 // ------------------------------------------------------------------------------------------------
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1129,6 +1129,8 @@
                                               : Bytecodes::_invokevirtual;
           }
           break;
+        default:
+          break;
       }
     }
   } else {
@@ -1379,7 +1381,7 @@
     // which may happen when multiply alive nmethod (tiered compilation)
     // will be supported.
     if (!callee_method->is_old() &&
-        (callee == NULL || callee->is_in_use() && (callee_method->code() == callee))) {
+        (callee == NULL || (callee->is_in_use() && callee_method->code() == callee))) {
 #ifdef ASSERT
       // We must not try to patch to jump to an already unloaded method.
       if (dest_entry_point != 0) {
@@ -3168,4 +3170,3 @@
   }
   return activation;
 }
-
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -380,6 +380,8 @@
         }
       }
       break;
+    default:
+      break;
     }
   }
   return MIN2(next_level, (CompLevel)TieredStopAtLevel);
--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -138,10 +138,10 @@
     if( at(index  )->type() == T_INT &&
         index+1 < size() &&
         at(index+1)->type() == T_INT ) {
-      tty->print("  " INT64_FORMAT " (long)", long_at(index));
+      tty->print("  " INT64_FORMAT " (long)", (int64_t)long_at(index));
       tty->cr();
       tty->print("\t     %.15e (double)", double_at(index));
-      tty->print("  " PTR64_FORMAT " (longhex)", long_at(index));
+      tty->print("  " PTR64_FORMAT " (longhex)", (int64_t)long_at(index));
     }
     tty->cr();
   }
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -2892,7 +2892,7 @@
   st->print_raw("\" ");
   oop thread_oop = threadObj();
   if (thread_oop != NULL) {
-    st->print("#" INT64_FORMAT " ", java_lang_Thread::thread_id(thread_oop));
+    st->print("#" INT64_FORMAT " ", (int64_t)java_lang_Thread::thread_id(thread_oop));
     if (java_lang_Thread::is_daemon(thread_oop))  st->print("daemon ");
     st->print("prio=%d ", java_lang_Thread::priority(thread_oop));
   }
--- a/hotspot/src/share/vm/services/mallocSiteTable.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/services/mallocSiteTable.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -182,8 +182,9 @@
 MallocSite* MallocSiteTable::malloc_site(size_t bucket_idx, size_t pos_idx) {
   assert(bucket_idx < table_size, "Invalid bucket index");
   MallocSiteHashtableEntry* head = _table[bucket_idx];
-  for (size_t index = 0; index < pos_idx && head != NULL;
-    index ++, head = (MallocSiteHashtableEntry*)head->next());
+  for (size_t index = 0;
+       index < pos_idx && head != NULL;
+       index++, head = (MallocSiteHashtableEntry*)head->next()) {}
   assert(head != NULL, "Invalid position index");
   return head->data();
 }
@@ -256,5 +257,3 @@
   }
   _lock_state = ExclusiveLock;
 }
-
-
--- a/hotspot/src/share/vm/services/writeableFlags.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,6 +86,8 @@
       buffer_concat(buffer, "other, unspecified error related to setting the flag."); break;
     case Flag::SUCCESS:
       break;
+    default:
+      break;
   }
 
   err_msg.print("%s", buffer);
--- a/hotspot/src/share/vm/utilities/decoder.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/decoder.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
 
 class AbstractDecoder : public CHeapObj<mtInternal> {
 public:
+  virtual ~AbstractDecoder() {}
+
   // status code for decoding native C frame
   enum decoder_status {
          not_available = -10,  // real decoder is not available
@@ -82,7 +84,7 @@
     _decoder_status = not_available;
   }
 
-  ~NullDecoder() {};
+  virtual ~NullDecoder() {};
 
   virtual bool decode(address pc, char* buf, int buflen, int* offset,
                       const char* modulepath, bool demangle) {
--- a/hotspot/src/share/vm/utilities/decoder_elf.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/decoder_elf.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
     _opened_elf_files = NULL;
     _decoder_status = no_error;
   }
-  ~ElfDecoder();
+  virtual ~ElfDecoder();
 
   bool can_decode_C_frame_in_vm() const { return true; }
 
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -88,6 +88,9 @@
 #define PTR_FORMAT    "0x%08"  PRIxPTR
 #endif  // _LP64
 
+// Format pointers without leading zeros
+#define INTPTRNZ_FORMAT "0x%"  PRIxPTR
+
 #define INTPTR_FORMAT_W(width)   "%" #width PRIxPTR
 
 #define SSIZE_FORMAT             "%"   PRIdPTR
@@ -781,8 +784,8 @@
     case T_VOID   : return vtos;
     case T_ARRAY  : // fall through
     case T_OBJECT : return atos;
+    default       : return ilgl;
   }
-  return ilgl;
 }
 
 inline BasicType as_BasicType(TosState state) {
@@ -797,8 +800,8 @@
     case dtos : return T_DOUBLE;
     case atos : return T_OBJECT;
     case vtos : return T_VOID;
+    default   : return T_ILLEGAL;
   }
-  return T_ILLEGAL;
 }
 
 
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -241,7 +241,11 @@
 
 // Formatting.
 #ifdef _LP64
-#define FORMAT64_MODIFIER "l"
+# ifdef __APPLE__
+# define FORMAT64_MODIFIER "ll"
+# else
+# define FORMAT64_MODIFIER "l"
+# endif
 #else // !_LP64
 #define FORMAT64_MODIFIER "ll"
 #endif // _LP64
--- a/hotspot/src/share/vm/utilities/hashtable.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -100,8 +100,6 @@
   return false;
 }
 
-template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::_seed = 0;
-
 // Create a new table and using alternate hash code, populate the new table
 // with the existing elements.   This can be used to change the hash code
 // and could in the future change the size of the table.
@@ -207,7 +205,7 @@
       if (*top + entry_size() > end) {
         report_out_of_shared_space(SharedMiscData);
       }
-      *p = (BasicHashtableEntry<F>*)memcpy(*top, *p, entry_size());
+      *p = (BasicHashtableEntry<F>*)memcpy(*top, (void*)*p, entry_size());
       *top += entry_size();
     }
   }
@@ -287,7 +285,7 @@
   if (*top + len > end) {
     report_out_of_shared_space(SharedMiscData);
   }
-  _buckets = (HashtableBucket<F>*)memcpy(*top, _buckets, len);
+  _buckets = (HashtableBucket<F>*)memcpy(*top, (void*)_buckets, len);
   *top += len;
 }
 
--- a/hotspot/src/share/vm/utilities/hashtable.hpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.hpp	Wed Jul 05 20:16:26 2017 -0700
@@ -301,8 +301,8 @@
 
   // Function to move these elements into the new table.
   void move_to(RehashableHashtable<T, F>* new_table);
-  static bool use_alternate_hashcode()  { return _seed != 0; }
-  static juint seed()                    { return _seed; }
+  static bool use_alternate_hashcode();
+  static juint seed();
 
   static int literal_size(Symbol *symbol);
   static int literal_size(oop oop);
@@ -320,6 +320,9 @@
   static juint _seed;
 };
 
+template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::_seed = 0;
+template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::seed() { return _seed; };
+template <class T, MEMFLAGS F> bool  RehashableHashtable<T, F>::use_alternate_hashcode() { return _seed != 0; };
 
 // Versions of hashtable where two handles are used to compute the index.
 
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -297,6 +297,8 @@
         st->print_cr("#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress");
         st->print_cr("#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.");
         break;
+      default:
+        break;
     }
   }
   st->print_cr("# This output file may be truncated or incomplete.");
@@ -1332,12 +1334,14 @@
         st->print_raw("[timeout occurred during error reporting in step \"");
         st->print_raw(_current_step_info);
         st->print_cr("\"] after " INT64_FORMAT " s.",
-          (get_current_timestamp() - _step_start_time) / TIMESTAMP_TO_SECONDS_FACTOR);
+                     (int64_t)
+                     ((get_current_timestamp() - _step_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
       } else if (_reporting_did_timeout) {
         // We hit ErrorLogTimeout. Reporting will stop altogether. Let's wrap things
         // up, the process is about to be stopped by the WatcherThread.
         st->print_cr("------ Timeout during error reporting after " INT64_FORMAT " s. ------",
-          (get_current_timestamp() - _reporting_start_time) / TIMESTAMP_TO_SECONDS_FACTOR);
+                     (int64_t)
+                     ((get_current_timestamp() - _reporting_start_time) / TIMESTAMP_TO_SECONDS_FACTOR));
         st->flush();
         // Watcherthread is about to call os::die. Lets just wait.
         os::infinite_sleep();
--- a/hotspot/test/native/logging/test_logMessageTest.cpp	Wed Jul 05 18:14:48 2017 -0700
+++ b/hotspot/test/native/logging/test_logMessageTest.cpp	Wed Jul 05 20:16:26 2017 -0700
@@ -96,6 +96,8 @@
       break;
 LOG_LEVEL_LIST
 #undef LOG_LEVEL
+    default:
+      break;
     }
   }