8196884: VS2017 Multiple Type Cast Conversion Compilation Errors
Summary: Change the type of symbolic constant badAddressVal and introduce specific casts to fix multiple type cast conversion compilation errors.
Reviewed-by: coleenp, kbarrett
--- a/src/hotspot/share/opto/buildOopMap.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/buildOopMap.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, 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
@@ -618,7 +618,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));
--- a/src/hotspot/share/opto/compile.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/compile.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, 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
@@ -2449,8 +2449,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);
}
--- a/src/hotspot/share/opto/gcm.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/gcm.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, 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
@@ -1486,7 +1486,7 @@
}
#endif
// Dead.
- _node_latency = (GrowableArray<uint> *)0xdeadbeef;
+ _node_latency = (GrowableArray<uint> *)((intptr_t)0xdeadbeef);
}
bool PhaseCFG::do_global_code_motion() {
--- a/src/hotspot/share/opto/idealGraphPrinter.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/idealGraphPrinter.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2017, 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
@@ -602,7 +602,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);
--- a/src/hotspot/share/opto/output.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/output.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2017, 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
@@ -2575,7 +2575,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;
--- a/src/hotspot/share/opto/split_if.cpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/opto/split_if.cpp Tue Feb 20 07:46:40 2018 -0500
@@ -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
@@ -292,7 +292,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
@@ -339,7 +339,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
--- a/src/hotspot/share/utilities/globalDefinitions.hpp Tue Feb 20 07:32:17 2018 -0500
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp Tue Feb 20 07:46:40 2018 -0500
@@ -943,8 +943,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 badStackSegVal = 0xCA; // value used to zap stack segments
const int badHandleValue = 0xBC; // value used to zap vm handle area