File jdk9-gcc6.patch of Package java-9-openjdk
--- jdk9/hotspot/make/lib/CompileJvm.gmk 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/make/lib/CompileJvm.gmk 2016-12-09 09:09:29.230552379 +0100
@@ -181,6 +181,11 @@
# default.
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
+JVM_CXXFLAGS := $(JVM_CFLAGS)
+ifeq ($(TOOLCHAIN_TYPE), gcc)
+ JVM_CXXFLAGS += -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse
+endif
+
################################################################################
# Now set up the actual compilation of the main hotspot native library
@@ -196,6 +201,7 @@
CFLAGS := $(JVM_CFLAGS), \
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
+ CXXFLAGS := $(JVM_CXXFLAGS), \
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_clang := delete-non-virtual-dtor dynamic-class-memaccess \
empty-body format logical-op-parentheses parentheses \
--- jdk9/hotspot/src/cpu/x86/vm/assembler_x86.cpp 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/src/cpu/x86/vm/assembler_x86.cpp 2016-12-09 09:09:29.230552379 +0100
@@ -188,10 +188,9 @@
// Address. An index of 4 (rsp) corresponds to having no index, so convert
// that to noreg for the Address constructor.
Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) {
- RelocationHolder rspec;
- if (disp_reloc != relocInfo::none) {
- rspec = Relocation::spec_simple(disp_reloc);
- }
+ RelocationHolder rspec = (disp_reloc == relocInfo::none)
+ ? RelocationHolder::none
+ : rspec = Relocation::spec_simple(disp_reloc);
bool valid_index = index != rsp->encoding();
if (valid_index) {
Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp));
--- jdk9/hotspot/src/share/vm/c1/c1_Instruction.hpp 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/src/share/vm/c1/c1_Instruction.hpp 2016-12-09 09:09:29.230552379 +0100
@@ -348,9 +348,7 @@
public:
void* operator new(size_t size) throw() {
Compilation* c = Compilation::current();
- void* res = c->arena()->Amalloc(size);
- ((Instruction*)res)->_id = c->get_next_id();
- return res;
+ return c->arena()->Amalloc(size);
}
static const int no_bci = -99;
@@ -426,6 +424,7 @@
check_state(state_before);
assert(type != NULL && (!type->is_constant() || type_is_constant), "type must exist");
update_exception_state(_state_before);
+ _id = Compilation::current()->get_next_id();
}
// accessors
@@ -1681,6 +1680,9 @@
#ifndef PRODUCT
set_printable_bci(bci);
#endif
+ Compilation* c = Compilation::current();
+ _id = c->get_next_id();
+ _block_id = c->get_next_block_id();
}
// accessors
--- jdk9/hotspot/src/share/vm/code/relocInfo.hpp 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/src/share/vm/code/relocInfo.hpp 2016-12-09 09:09:29.230552379 +0100
@@ -839,7 +839,7 @@
}
-inline RelocationHolder::RelocationHolder(Relocation* r) {
+inline RelocationHolder::RelocationHolder(Relocation* r) : _relocbuf() {
// wordwise copy from r (ok if it copies garbage after r)
for (int i = 0; i < _relocbuf_size; i++) {
_relocbuf[i] = ((void**)r)[i];
--- jdk9/hotspot/src/share/vm/oops/oop.inline.hpp 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/src/share/vm/oops/oop.inline.hpp 2016-12-09 09:09:29.230552379 +0100
@@ -565,7 +565,7 @@
// used only for asserts
bool oopDesc::is_oop_or_null(bool ignore_mark_word) const {
- return this == NULL ? true : is_oop(ignore_mark_word);
+ return (this == NULL) || is_oop(ignore_mark_word);
}
#ifndef PRODUCT
--- jdk9/hotspot/src/share/vm/opto/type.cpp 2016-12-01 22:40:08.000000000 +0100
+++ jdk9/hotspot/src/share/vm/opto/type.cpp 2016-12-09 09:09:29.230552379 +0100
@@ -50,7 +50,7 @@
// Array which maps compiler types to Basic Types
Type::TypeInfo Type::_type_info[Type::lastype] = {
- { Bad, T_ILLEGAL, "bad", false, Node::NotAMachineReg, relocInfo::none }, // Bad
+ { Bad, T_ILLEGAL, "bad", false, (int)Node::NotAMachineReg, relocInfo::none }, // Bad
{ Control, T_ILLEGAL, "control", false, 0, relocInfo::none }, // Control
{ Bottom, T_VOID, "top", false, 0, relocInfo::none }, // Top
{ Bad, T_INT, "int:", false, Op_RegI, relocInfo::none }, // Int
@@ -58,8 +58,8 @@
{ Half, T_VOID, "half", false, 0, relocInfo::none }, // Half
{ Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop
{ Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass
- { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple
- { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array
+ { Bad, T_ILLEGAL, "tuple:", false, (int)Node::NotAMachineReg, relocInfo::none }, // Tuple
+ { Bad, T_ARRAY, "array:", false, (int)Node::NotAMachineReg, relocInfo::none }, // Array
#ifdef SPARC
{ Bad, T_ILLEGAL, "vectors:", false, 0, relocInfo::none }, // VectorS
--- jdk9/jdk/make/lib/Awt2dLibraries.gmk 2016-11-30 06:58:29.000000000 +0100
+++ jdk9/jdk/make/lib/Awt2dLibraries.gmk 2016-12-09 09:09:29.230552379 +0100
@@ -393,6 +393,11 @@
# The fast floor code loses precision.
LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
+# Avoid warning for GCC 6
+ifeq ($(TOOLCHAIN_TYPE), gcc)
+ LCMS_CFLAGS += -Wno-misleading-indentation
+endif
+
ifeq ($(USE_EXTERNAL_LCMS), true)
# If we're using an external library, we'll just need the wrapper part.
# By including it explicitly, all other files will be excluded.
--- jdk9/jdk/src/java.base/share/native/libfdlibm/e_asin.c 2016-11-30 06:58:29.000000000 +0100
+++ jdk9/jdk/src/java.base/share/native/libfdlibm/e_asin.c 2016-12-09 09:09:29.234552289 +0100
@@ -97,8 +97,9 @@
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e400000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
- } else
+ } else {
t = x*x;
+ }
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
--- jdk9/jdk/src/java.base/share/native/libfdlibm/k_rem_pio2.c 2016-11-30 06:58:29.000000000 +0100
+++ jdk9/jdk/src/java.base/share/native/libfdlibm/k_rem_pio2.c 2016-12-09 09:09:29.234552289 +0100
@@ -197,7 +197,9 @@
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ for (j=0,fw=0.0;j<=jx;j++) {
+ fw += x[j]*f[jx+i-j]; q[i] = fw;
+ }
}
jz = jk;