8196884: VS2017 Multiple Type Cast Conversion Compilation Errors
Change the type of symbolic constant badAddressVal and introduce specific casts to fix multiple type cast conversion compilation errors.
Reviewed-by: lfoltan, coleenp, kbarrett
diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp
index 9f2dd67..4f7c42e 100644
--- a/hotspot/src/share/vm/opto/buildOopMap.cpp
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -629,7 +629,7 @@
// last block as his only undone child, we can move the OopFlow from the
// pred to this block. Otherwise we have to grab a new OopFlow.
OopFlow *flow = NULL; // Flag for finding optimized flow
- Block *pred = (Block*)0xdeadbeef;
+ Block *pred = (Block*)((intptr_t)0xdeadbeef);
// Scan this block's preds to find a done predecessor
for (uint j = 1; j < b->num_preds(); j++) {
Block* p = _cfg->get_block_for_node(b->pred(j));
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index 439e55e..94af967 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -2392,8 +2392,8 @@
print_method(PHASE_FINAL_CODE);
// He's dead, Jim.
- _cfg = (PhaseCFG*)0xdeadbeef;
- _regalloc = (PhaseChaitin*)0xdeadbeef;
+ _cfg = (PhaseCFG*)((intptr_t)0xdeadbeef);
+ _regalloc = (PhaseChaitin*)((intptr_t)0xdeadbeef);
}
diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp
index c574998..a3e6b1a 100644
--- a/hotspot/src/share/vm/opto/gcm.cpp
+++ b/hotspot/src/share/vm/opto/gcm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -1375,7 +1375,7 @@
}
#endif
// Dead.
- _node_latency = (GrowableArray<uint> *)0xdeadbeef;
+ _node_latency = (GrowableArray<uint> *)((intptr_t)0xdeadbeef);
}
bool PhaseCFG::do_global_code_motion() {
diff --git a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
index b222526..65c1ac9 100644
--- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
+++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -612,7 +612,7 @@
}
#endif
- if (_chaitin && _chaitin != (PhaseChaitin *)0xdeadbeef) {
+ if (_chaitin && _chaitin != (PhaseChaitin *)((intptr_t)0xdeadbeef)) {
buffer[0] = 0;
_chaitin->dump_register(node, buffer);
print_prop("reg", buffer);
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
index 287d8d1..ebd68de 100644
--- a/hotspot/src/share/vm/opto/output.cpp
+++ b/hotspot/src/share/vm/opto/output.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -2687,7 +2687,7 @@
}
Node *kill = def; // Rename 'def' to more descriptive 'kill'
- debug_only( def = (Node*)0xdeadbeef; )
+ debug_only( def = (Node*)((intptr_t)0xdeadbeef); )
// After some number of kills there _may_ be a later def
Node *later_def = NULL;
diff --git a/hotspot/src/share/vm/opto/split_if.cpp b/hotspot/src/share/vm/opto/split_if.cpp
index f7f5529..94d680c 100644
--- a/hotspot/src/share/vm/opto/split_if.cpp
+++ b/hotspot/src/share/vm/opto/split_if.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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,7 +255,7 @@
Node *PhaseIdealLoop::spinup( Node *iff_dom, Node *new_false, Node *new_true, Node *use_blk, Node *def, small_cache *cache ) {
if (use_blk->is_top()) // Handle dead uses
return use_blk;
- Node *prior_n = (Node*)0xdeadbeef;
+ Node *prior_n = (Node*)((intptr_t)0xdeadbeef);
Node *n = use_blk; // Get path input
assert( use_blk != iff_dom, "" );
// Here's the "spinup" the dominator tree loop. Do a cache-check
@@ -302,7 +302,7 @@
}
// Update cache everywhere
- prior_n = (Node*)0xdeadbeef; // Reset IDOM walk
+ prior_n = (Node*)((intptr_t)0xdeadbeef); // Reset IDOM walk
n = use_blk; // Get path input
// Spin-up the idom tree again, basically doing path-compression.
// Insert cache entries along the way, so that if we ever hit this
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
index 58efd16..2fb6a3c 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
@@ -1038,8 +1038,8 @@
// Special constants for debugging
const jint badInt = -3; // generic "bad int" value
-const long badAddressVal = -2; // generic "bad address" value
-const long badOopVal = -1; // generic "bad oop" value
+const intptr_t badAddressVal = -2; // generic "bad address" value
+const intptr_t badOopVal = -1; // generic "bad oop" value
const intptr_t badHeapOopVal = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
const int badHandleValue = 0xBC; // value used to zap vm handle area
const int badResourceValue = 0xAB; // value used to zap resource area