# HG changeset patch
# User simonis
# Date 1466155884 -7200
#      Fri Jun 17 11:31:24 2016 +0200
# Node ID 4b40867e627dd9043bc67a4795caa9834ef69478
# Parent  3fc29347b27fdd2075e6ec6d80bb26ab2bf667c1
8158260, PR2991, RH1341258: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions
Summary: Adjust instruction generation. Includes portions of 8026049 for test case.
Reviewed-by: goetz
Contributed-by: gromero@linux.vnet.ibm.com, horii@jp.ibm.com

diff -Nru openjdk.orig/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp openjdk/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
--- openjdk.orig/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	2020-01-15 20:50:41.000000000 +0000
+++ openjdk/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp	2020-01-17 01:58:41.317259789 +0000
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2013, Red Hat Inc.
  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Red Hat Inc. 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
@@ -295,6 +295,11 @@
     UsePopCountInstruction = true;
   }
 
+  // This machine allows unaligned memory accesses
+  if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
+    FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
+  }
+
   if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
     UseMontgomeryMultiplyIntrinsic = true;
   }
