changeset 9899:de79964656fc

8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong Summary: The inline assembler for the S390 (S390 and not _LP64) has src and dst reversed thereby corrupting data Reviewed-by: shade
author mbalao
date Thu, 03 May 2018 04:16:52 +0100
parents ffd5260fe5ad
children 07a1135a3273
files src/os_cpu/linux_zero/vm/os_linux_zero.hpp
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed May 02 17:48:42 2018 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Thu May 03 04:16:52 2018 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2007, 2008, 2010 Red Hat, Inc.
+ * Copyright 2007, 2008, 2010, 2018, Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,10 +50,10 @@
                   : "Q"(*(volatile long*)src));
 #elif defined(S390) && !defined(_LP64)
     double tmp;
-    asm volatile ("ld  %0, 0(%1)\n"
-                  "std %0, 0(%2)\n"
-                  : "=r"(tmp)
-                  : "a"(src), "a"(dst));
+    asm volatile ("ld  %0, %2\n"
+                  "std %0, %1\n"
+                  : "=&f"(tmp), "=Q"(*(volatile double*)dst)
+                  : "Q"(*(volatile double*)src));
 #elif defined(__ARM_ARCH_7A__)
     jlong tmp;
     asm volatile ("ldrexd  %0, [%1]\n"