changeset 50669:9da00197ff72

8203220: Introduce ATTRIBUTE_ALIGNED macro Reviewed-by: tschatzl, kbarrett
author pliden
date Wed, 16 May 2018 10:24:54 +0200
parents bf9177eac58d
children 63f8bc358cca
files src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp src/hotspot/cpu/x86/macroAssembler_x86_cos.cpp src/hotspot/cpu/x86/macroAssembler_x86_exp.cpp src/hotspot/cpu/x86/macroAssembler_x86_log.cpp src/hotspot/cpu/x86/macroAssembler_x86_log10.cpp src/hotspot/cpu/x86/macroAssembler_x86_pow.cpp src/hotspot/cpu/x86/macroAssembler_x86_sin.cpp src/hotspot/cpu/x86/macroAssembler_x86_tan.cpp src/hotspot/cpu/x86/stubRoutines_x86.cpp src/hotspot/share/utilities/globalDefinitions.hpp src/hotspot/share/utilities/globalDefinitions_gcc.hpp src/hotspot/share/utilities/globalDefinitions_sparcWorks.hpp src/hotspot/share/utilities/globalDefinitions_visCPP.hpp
diffstat 13 files changed, 139 insertions(+), 159 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp	Wed May 16 10:24:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +28,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 // Implementation of the platform-specific part of StubRoutines - for
 // a description of how to extend it, see the stubRoutines.hpp file.
@@ -52,8 +53,7 @@
 /**
  *  crc_table[] from jdk/src/share/native/java/util/zip/zlib-1.2.5/crc32.h
  */
-juint StubRoutines::aarch64::_crc_table[]
-                   __attribute__ ((aligned(4096))) =
+juint StubRoutines::aarch64::_crc_table[] ATTRIBUTE_ALIGNED(4096) =
 {
     // Table 0
     0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_cos.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_cos.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - COS()
@@ -181,7 +176,7 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(8) juint _ONE[] =
+ATTRIBUTE_ALIGNED(8) juint _ONE[] =
 {
     0x00000000UL, 0x3ff00000UL
 };
@@ -636,7 +631,7 @@
 #else
 // The 32 bit code is at most SSE2 compliant
 
-ALIGNED_(16) juint _static_const_table_cos[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_cos[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
     0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_exp.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_exp.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - EXP()
@@ -72,7 +67,7 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _cv[] =
+ATTRIBUTE_ALIGNED(16) juint _cv[] =
 {
     0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, 0xfefa0000UL,
     0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL, 0xbc9e3b3aUL, 0x3d1cf79aUL,
@@ -81,22 +76,22 @@
     0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL
 };
 
-ALIGNED_(16) juint _shifter[] =
+ATTRIBUTE_ALIGNED(16) juint _shifter[] =
 {
     0x00000000UL, 0x43380000UL, 0x00000000UL, 0x43380000UL
 };
 
-ALIGNED_(16) juint _mmask[] =
+ATTRIBUTE_ALIGNED(16) juint _mmask[] =
 {
     0xffffffc0UL, 0x00000000UL, 0xffffffc0UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint _bias[] =
+ATTRIBUTE_ALIGNED(16) juint _bias[] =
 {
     0x0000ffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint _Tbl_addr[] =
+ATTRIBUTE_ALIGNED(16) juint _Tbl_addr[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0e03754dUL,
     0x3cad7bbfUL, 0x3e778060UL, 0x00002c9aUL, 0x3567f613UL, 0x3c8cd252UL,
@@ -152,37 +147,37 @@
     0x000fa7c1UL
 };
 
-ALIGNED_(16) juint _ALLONES[] =
+ATTRIBUTE_ALIGNED(16) juint _ALLONES[] =
 {
     0xffffffffUL, 0xffffffffUL, 0xffffffffUL, 0xffffffffUL
 };
 
-ALIGNED_(16) juint _ebias[] =
+ATTRIBUTE_ALIGNED(16) juint _ebias[] =
 {
     0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3ff00000UL
 };
 
-ALIGNED_(4) juint _XMAX[] =
+ATTRIBUTE_ALIGNED(4) juint _XMAX[] =
 {
     0xffffffffUL, 0x7fefffffUL
 };
 
-ALIGNED_(4) juint _XMIN[] =
+ATTRIBUTE_ALIGNED(4) juint _XMIN[] =
 {
     0x00000000UL, 0x00100000UL
 };
 
-ALIGNED_(4) juint _INF[] =
+ATTRIBUTE_ALIGNED(4) juint _INF[] =
 {
     0x00000000UL, 0x7ff00000UL
 };
 
-ALIGNED_(4) juint _ZERO[] =
+ATTRIBUTE_ALIGNED(4) juint _ZERO[] =
 {
     0x00000000UL, 0x00000000UL
 };
 
-ALIGNED_(4) juint _ONE_val[] =
+ATTRIBUTE_ALIGNED(4) juint _ONE_val[] =
 {
     0x00000000UL, 0x3ff00000UL
 };
@@ -411,7 +406,7 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _static_const_table[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table[] =
 {
     0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL, 0xffffffc0UL,
     0x00000000UL, 0xffffffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_log.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_log.cpp	Wed May 16 10:24:54 2018 +0200
@@ -28,12 +28,7 @@
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
 #include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - LOG()
@@ -62,7 +57,7 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _L_tbl[] =
+ATTRIBUTE_ALIGNED(16) juint _L_tbl[] =
 {
     0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL,
     0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL,
@@ -170,12 +165,12 @@
     0x80000000UL
 };
 
-ALIGNED_(16) juint _log2[] =
+ATTRIBUTE_ALIGNED(16) juint _log2[] =
 {
     0xfefa3800UL, 0x3fa62e42UL, 0x93c76730UL, 0x3ceef357UL
 };
 
-ALIGNED_(16) juint _coeff[] =
+ATTRIBUTE_ALIGNED(16) juint _coeff[] =
 {
     0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL, 0x3d6fb175UL,
     0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL, 0x9999999aUL, 0x3fc99999UL,
@@ -367,7 +362,7 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _static_const_table_log[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_log[] =
 {
     0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL,
     0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_log10.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_log10.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - LOG10()
@@ -63,17 +58,17 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _HIGHSIGMASK_log10[] =
+ATTRIBUTE_ALIGNED(16) juint _HIGHSIGMASK_log10[] =
 {
     0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xffffe000UL
 };
 
-ALIGNED_(16) juint _LOG10_E[] =
+ATTRIBUTE_ALIGNED(16) juint _LOG10_E[] =
 {
     0x00000000UL, 0x3fdbc000UL, 0xbf2e4108UL, 0x3f5a7a6cUL
 };
 
-ALIGNED_(16) juint _L_tbl_log10[] =
+ATTRIBUTE_ALIGNED(16) juint _L_tbl_log10[] =
 {
     0x509f7800UL, 0x3fd34413UL, 0x1f12b358UL, 0x3d1fef31UL, 0x80333400UL,
     0x3fd32418UL, 0xc671d9d0UL, 0xbcf542bfUL, 0x51195000UL, 0x3fd30442UL,
@@ -181,12 +176,12 @@
     0x00000000UL
 };
 
-ALIGNED_(16) juint _log2_log10[] =
+ATTRIBUTE_ALIGNED(16) juint _log2_log10[] =
 {
     0x509f7800UL, 0x3f934413UL, 0x1f12b358UL, 0x3cdfef31UL
 };
 
-ALIGNED_(16) juint _coeff_log10[] =
+ATTRIBUTE_ALIGNED(16) juint _coeff_log10[] =
 {
     0xc1a5f12eUL, 0x40358874UL, 0x64d4ef0dUL, 0xc0089309UL, 0x385593b1UL,
     0xc025c917UL, 0xdc963467UL, 0x3ffc6a02UL, 0x7f9d3aa1UL, 0x4016ab9fUL,
@@ -387,7 +382,7 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _static_const_table_log10[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_log10[] =
 {
     0x509f7800UL, 0x3fd34413UL, 0x1f12b358UL, 0x3d1fef31UL, 0x80333400UL,
     0x3fd32418UL, 0xc671d9d0UL, 0xbcf542bfUL, 0x51195000UL, 0x3fd30442UL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_pow.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_pow.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION  - POW()
@@ -90,22 +85,22 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _HIGHSIGMASK[] =
+ATTRIBUTE_ALIGNED(16) juint _HIGHSIGMASK[] =
 {
     0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL
 };
 
-ALIGNED_(16) juint _LOG2_E[] =
+ATTRIBUTE_ALIGNED(16) juint _LOG2_E[] =
 {
     0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL
 };
 
-ALIGNED_(16) juint _HIGHMASK_Y[] =
+ATTRIBUTE_ALIGNED(16) juint _HIGHMASK_Y[] =
 {
     0x00000000UL, 0xfffffff8UL, 0x00000000UL, 0xffffffffUL
 };
 
-ALIGNED_(16) juint _T_exp[] =
+ATTRIBUTE_ALIGNED(16) juint _T_exp[] =
 {
     0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, 0xfa5abcbfUL,
     0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, 0x3ff0163dUL,
@@ -314,29 +309,29 @@
     0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL
 };
 
-ALIGNED_(16) juint _e_coeff[] =
+ATTRIBUTE_ALIGNED(16) juint _e_coeff[] =
 {
     0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL,
     0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL,
     0x00000000UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint _coeff_h[] =
+ATTRIBUTE_ALIGNED(16) juint _coeff_h[] =
 {
     0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL
 };
 
-ALIGNED_(16) juint _HIGHMASK_LOG_X[] =
+ATTRIBUTE_ALIGNED(16) juint _HIGHMASK_LOG_X[] =
 {
     0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xfffff800UL
 };
 
-ALIGNED_(8) juint _HALFMASK[] =
+ATTRIBUTE_ALIGNED(8) juint _HALFMASK[] =
 {
     0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL
 };
 
-ALIGNED_(16) juint _coeff_pow[] =
+ATTRIBUTE_ALIGNED(16) juint _coeff_pow[] =
 {
     0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL,
     0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL,
@@ -345,7 +340,7 @@
     0x486ececbUL, 0x3fc4635eUL, 0x412055ccUL, 0xbdd61bb2UL
 };
 
-ALIGNED_(16) juint _L_tbl_pow[] =
+ATTRIBUTE_ALIGNED(16) juint _L_tbl_pow[] =
 {
     0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x20000000UL,
     0x3feff00aUL, 0x96621f95UL, 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL,
@@ -760,12 +755,12 @@
     0x00000000UL, 0x80000000UL
 };
 
-ALIGNED_(8) juint _log2_pow[] =
+ATTRIBUTE_ALIGNED(8) juint _log2_pow[] =
 {
     0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, 0xbfe62e42UL
 };
 
-ALIGNED_(8) juint _DOUBLE2[] =
+ATTRIBUTE_ALIGNED(8) juint _DOUBLE2[] =
 {
     0x00000000UL, 0x40000000UL
 };
@@ -1862,7 +1857,7 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _static_const_table_pow[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_pow[] =
 {
     0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL,
     0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_sin.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_sin.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,15 +27,10 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "stubRoutines_x86.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - SIN()
@@ -183,22 +178,22 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint StubRoutines::x86::_ONEHALF[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_ONEHALF[] =
 {
     0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_P_2[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_P_2[] =
 {
     0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_SC_4[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_SC_4[] =
 {
     0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_Ctable[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_Ctable[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
     0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL,
@@ -305,22 +300,22 @@
     0x00000000UL, 0x3ff00000UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_SC_2[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_SC_2[] =
 {
     0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_SC_3[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_SC_3[] =
 {
     0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_SC_1[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_SC_1[] =
 {
     0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_PI_INV_TABLE[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_PI_INV_TABLE[] =
 {
     0x00000000UL, 0x00000000UL, 0xa2f9836eUL, 0x4e441529UL, 0xfc2757d1UL,
     0xf534ddc0UL, 0xdb629599UL, 0x3c439041UL, 0xfe5163abUL, 0xdebbc561UL,
@@ -333,52 +328,52 @@
     0xf0cfbc21UL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_PI_4[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_PI_4[] =
 {
     0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_PI32INV[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_PI32INV[] =
 {
     0x6dc9c883UL, 0x40245f30UL
 };
 
-ALIGNED_(8) juint _SHIFTER[] =
+ATTRIBUTE_ALIGNED(8) juint _SHIFTER[] =
 {
     0x00000000UL, 0x43380000UL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_SIGN_MASK[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_SIGN_MASK[] =
 {
     0x00000000UL, 0x80000000UL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_P_3[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_P_3[] =
 {
     0x2e037073UL, 0x3b63198aUL
 };
 
-ALIGNED_(8) juint _ALL_ONES[] =
+ATTRIBUTE_ALIGNED(8) juint _ALL_ONES[] =
 {
     0xffffffffUL, 0x3fefffffUL
 };
 
-ALIGNED_(8) juint _TWO_POW_55[] =
+ATTRIBUTE_ALIGNED(8) juint _TWO_POW_55[] =
 {
     0x00000000UL, 0x43600000UL
 };
 
-ALIGNED_(8) juint _TWO_POW_M55[] =
+ATTRIBUTE_ALIGNED(8) juint _TWO_POW_M55[] =
 {
     0x00000000UL, 0x3c800000UL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_P_1[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_P_1[] =
 {
     0x54400000UL, 0x3fb921fbUL
 };
 
-ALIGNED_(8) juint StubRoutines::x86::_NEG_ZERO[] =
+ATTRIBUTE_ALIGNED(8) juint StubRoutines::x86::_NEG_ZERO[] =
 {
     0x00000000UL, 0x80000000UL
 };
@@ -853,54 +848,54 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(8) juint _zero_none[] =
+ATTRIBUTE_ALIGNED(8) juint _zero_none[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL
 };
 
-ALIGNED_(4) juint __4onpi_d[] =
+ATTRIBUTE_ALIGNED(4) juint __4onpi_d[] =
 {
     0x6dc9c883UL, 0x3ff45f30UL
 };
 
-ALIGNED_(4) juint _TWO_32H[] =
+ATTRIBUTE_ALIGNED(4) juint _TWO_32H[] =
 {
     0x00000000UL, 0x41f80000UL
 };
 
-ALIGNED_(4) juint _pi04_3d[] =
+ATTRIBUTE_ALIGNED(4) juint _pi04_3d[] =
 {
     0x54442d00UL, 0x3fe921fbUL, 0x98cc5180UL, 0x3ce84698UL, 0xcbb5bf6cUL,
     0xb9dfc8f8UL
 };
 
-ALIGNED_(4) juint _pi04_5d[] =
+ATTRIBUTE_ALIGNED(4) juint _pi04_5d[] =
 {
     0x54400000UL, 0x3fe921fbUL, 0x1a600000UL, 0x3dc0b461UL, 0x2e000000UL,
     0x3b93198aUL, 0x25200000UL, 0x396b839aUL, 0x533e63a0UL, 0x37027044UL
 };
 
-ALIGNED_(4) juint _SCALE[] =
+ATTRIBUTE_ALIGNED(4) juint _SCALE[] =
 {
     0x00000000UL, 0x32600000UL
 };
 
-ALIGNED_(4) juint _zeros[] =
+ATTRIBUTE_ALIGNED(4) juint _zeros[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL
 };
 
-ALIGNED_(4) juint _pi04_2d[] =
+ATTRIBUTE_ALIGNED(4) juint _pi04_2d[] =
 {
     0x54400000UL, 0x3fe921fbUL, 0x1a626331UL, 0x3dc0b461UL
 };
 
-ALIGNED_(4) juint _TWO_12H[] =
+ATTRIBUTE_ALIGNED(4) juint _TWO_12H[] =
 {
     0x00000000UL, 0x40b80000UL
 };
 
-ALIGNED_(2) jushort __4onpi_31l[] =
+ATTRIBUTE_ALIGNED(2) jushort __4onpi_31l[] =
 {
     0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x836e, 0xa2f9,
     0x40d8, 0x0000, 0x0000, 0x0000, 0x2a50, 0x9c88, 0x40b7, 0x0000, 0x0000, 0x0000,
@@ -1629,29 +1624,29 @@
   ret(0);
 }
 
-ALIGNED_(16) juint StubRoutines::x86::_L_2il0floatpacket_0[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_L_2il0floatpacket_0[] =
 {
     0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_Pi4Inv[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_Pi4Inv[] =
 {
     0x6dc9c883UL, 0x3ff45f30UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_Pi4x3[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_Pi4x3[] =
 {
     0x54443000UL, 0xbfe921fbUL, 0x3b39a000UL, 0x3d373dcbUL, 0xe0e68948UL,
     0xba845c06UL
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_Pi4x4[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_Pi4x4[] =
 {
     0x54400000UL, 0xbfe921fbUL, 0x1a600000UL, 0xbdc0b461UL, 0x2e000000UL,
     0xbb93198aUL, 0x252049c1UL, 0xb96b839aUL
 };
 
-ALIGNED_(16) jushort _SP[] =
+ATTRIBUTE_ALIGNED(16) jushort _SP[] =
 {
     0xaaab, 0xaaaa, 0xaaaa, 0xaaaa, 0xbffc, 0x0000, 0x8887, 0x8888, 0x8888, 0x8888,
     0x3ff8, 0x0000, 0xc527, 0x0d00, 0x00d0, 0xd00d, 0xbff2, 0x0000, 0x45f6, 0xb616,
@@ -1660,7 +1655,7 @@
     0xbfd6, 0x0000, 0x8610, 0x307f, 0x62a1, 0xc921, 0x3fce, 0x0000
 };
 
-ALIGNED_(16) jushort _CP[] =
+ATTRIBUTE_ALIGNED(16) jushort _CP[] =
 {
     0x0000, 0x0000, 0x0000, 0x8000, 0xbffe, 0x0000, 0xaaa5, 0xaaaa, 0xaaaa, 0xaaaa,
     0x3ffa, 0x0000, 0x9c2f, 0x0b60, 0x60b6, 0xb60b, 0xbff5, 0x0000, 0xf024, 0x0cac,
@@ -1669,7 +1664,7 @@
     0xbfda, 0x0000, 0x3ac6, 0x0ba0, 0x07ce, 0xd585, 0x3fd2, 0x0000
 };
 
-ALIGNED_(16) juint StubRoutines::x86::_ones[] =
+ATTRIBUTE_ALIGNED(16) juint StubRoutines::x86::_ones[] =
 {
     0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0xbff00000UL
 };
@@ -2197,7 +2192,7 @@
   jmp(B1_15);
 }
 
-ALIGNED_(16) juint _static_const_table_sin[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_sin[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
     0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL,
--- a/src/hotspot/cpu/x86/macroAssembler_x86_tan.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_tan.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "precompiled.hpp"
 #include "asm/assembler.hpp"
 #include "asm/assembler.inline.hpp"
+#include "macroAssembler_x86.hpp"
 #include "runtime/stubRoutines.hpp"
-#include "macroAssembler_x86.hpp"
-
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
+#include "utilities/globalDefinitions.hpp"
 
 /******************************************************************************/
 //                     ALGORITHM DESCRIPTION - TAN()
@@ -107,42 +102,42 @@
 
 #ifdef _LP64
 // The 64 bit code is at most SSE2 compliant
-ALIGNED_(16) juint _ONEHALF_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _ONEHALF_tan[] =
 {
     0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL
 };
 
-ALIGNED_(16) juint _MUL16[] =
+ATTRIBUTE_ALIGNED(16) juint _MUL16[] =
 {
     0x00000000UL, 0x40300000UL, 0x00000000UL, 0x3ff00000UL
 };
 
-ALIGNED_(16) juint _sign_mask_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _sign_mask_tan[] =
 {
     0x00000000UL, 0x80000000UL, 0x00000000UL, 0x80000000UL
 };
 
-ALIGNED_(16) juint _PI32INV_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _PI32INV_tan[] =
 {
     0x6dc9c883UL, 0x3fe45f30UL, 0x6dc9c883UL, 0x40245f30UL
 };
 
-ALIGNED_(16) juint _P_1_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _P_1_tan[] =
 {
     0x54444000UL, 0x3fb921fbUL, 0x54440000UL, 0x3fb921fbUL
 };
 
-ALIGNED_(16) juint _P_2_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _P_2_tan[] =
 {
     0x67674000UL, 0xbd32e7b9UL, 0x4c4c0000UL, 0x3d468c23UL
 };
 
-ALIGNED_(16) juint _P_3_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _P_3_tan[] =
 {
     0x3707344aUL, 0x3aa8a2e0UL, 0x03707345UL, 0x3ae98a2eUL
 };
 
-ALIGNED_(16) juint _Ctable_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Ctable_tan[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x882c10faUL,
     0x3f9664f4UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
@@ -428,37 +423,37 @@
     0x00000000UL, 0x00000000UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint _MASK_35_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _MASK_35_tan[] =
 {
     0xfffc0000UL, 0xffffffffUL, 0x00000000UL, 0x00000000UL
 };
 
-ALIGNED_(16) juint _Q_11_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Q_11_tan[] =
 {
     0xb8fe4d77UL, 0x3f82609aUL
 };
 
-ALIGNED_(16) juint _Q_9_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Q_9_tan[] =
 {
     0xbf847a43UL, 0x3f9664a0UL
 };
 
-ALIGNED_(16) juint _Q_7_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Q_7_tan[] =
 {
     0x52c4c8abUL, 0x3faba1baUL
 };
 
-ALIGNED_(16) juint _Q_5_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Q_5_tan[] =
 {
     0x11092746UL, 0x3fc11111UL
 };
 
-ALIGNED_(16) juint _Q_3_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _Q_3_tan[] =
 {
     0x55555612UL, 0x3fd55555UL
 };
 
-ALIGNED_(16) juint _PI_INV_TABLE_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _PI_INV_TABLE_tan[] =
 {
     0x00000000UL, 0x00000000UL, 0xa2f9836eUL, 0x4e441529UL, 0xfc2757d1UL,
     0xf534ddc0UL, 0xdb629599UL, 0x3c439041UL, 0xfe5163abUL, 0xdebbc561UL,
@@ -471,32 +466,32 @@
     0xf0cfbc21UL
 };
 
-ALIGNED_(8) juint _PI_4_tan[] =
+ATTRIBUTE_ALIGNED(8) juint _PI_4_tan[] =
 {
     0x00000000UL, 0x3fe921fbUL, 0x4611a626UL, 0x3e85110bUL
 };
 
-ALIGNED_(8) juint _QQ_2_tan[] =
+ATTRIBUTE_ALIGNED(8) juint _QQ_2_tan[] =
 {
     0x676733afUL, 0x3d32e7b9UL
 };
 
-ALIGNED_(8) juint _ONE_tan[] =
+ATTRIBUTE_ALIGNED(8) juint _ONE_tan[] =
 {
     0x00000000UL, 0x3ff00000UL
 };
 
-ALIGNED_(8) juint _TWO_POW_55_tan[] =
+ATTRIBUTE_ALIGNED(8) juint _TWO_POW_55_tan[] =
 {
     0x00000000UL, 0x43600000UL
 };
 
-ALIGNED_(4) juint _TWO_POW_M55_tan[] =
+ATTRIBUTE_ALIGNED(4) juint _TWO_POW_M55_tan[] =
 {
     0x00000000UL, 0x3c800000UL
 };
 
-ALIGNED_(4) juint _NEG_ZERO_tan[] =
+ATTRIBUTE_ALIGNED(4) juint _NEG_ZERO_tan[] =
 {
     0x00000000UL, 0x80000000UL
 };
@@ -1064,21 +1059,21 @@
 }
 #else
 // The 32 bit code is at most SSE2 compliant
-ALIGNED_(16) jushort _TP[] =
+ATTRIBUTE_ALIGNED(16) jushort _TP[] =
 {
     0x4cd6, 0xaf6c, 0xc710, 0xc662, 0xbffd, 0x0000, 0x4b06, 0xb0ac, 0xd3b2, 0xcc2c,
     0x3ff9, 0x0000, 0x00e3, 0xc850, 0xaa28, 0x9533, 0xbff3, 0x0000, 0x2ff0, 0x466d,
     0x1a3b, 0xb266, 0x3fe5, 0x0000
 };
 
-ALIGNED_(16) jushort _TQ[] =
+ATTRIBUTE_ALIGNED(16) jushort _TQ[] =
 {
     0x399c, 0x8391, 0x154c, 0x94ca, 0xbfff, 0x0000, 0xb6a3, 0xc36a, 0x44e2, 0x8a2c,
     0x3ffe, 0x0000, 0xb70f, 0xd068, 0xa6ce, 0xe9dd, 0xbff9, 0x0000, 0x820f, 0x51ce,
     0x7d76, 0x9bff, 0x3ff3, 0x0000
 };
 
-ALIGNED_(16) jushort _GP[] =
+ATTRIBUTE_ALIGNED(16) jushort _GP[] =
 {
     0xaaab, 0xaaaa, 0xaaaa, 0xaaaa, 0xbffd, 0x0000, 0xb62f, 0x0b60, 0x60b6, 0xb60b,
     0xbff9, 0x0000, 0xdfa7, 0x08aa, 0x55e0, 0x8ab3, 0xbff6, 0x0000, 0x85a0, 0xa819,
@@ -1670,7 +1665,7 @@
   jmp(B1_15);
 }
 
-ALIGNED_(16) juint _static_const_table_tan[] =
+ATTRIBUTE_ALIGNED(16) juint _static_const_table_tan[] =
 {
     0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x882c10faUL,
     0x3f9664f4UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
--- a/src/hotspot/cpu/x86/stubRoutines_x86.cpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.cpp	Wed May 16 10:24:54 2018 +0200
@@ -27,14 +27,9 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
 #include "crc32c.h"
 
-#ifdef _MSC_VER
-#define ALIGNED_(x) __declspec(align(x))
-#else
-#define ALIGNED_(x) __attribute__ ((aligned(x)))
-#endif
-
 // Implementation of the platform-specific part of StubRoutines - for
 // a description of how to extend it, see the stubRoutines.hpp file.
 
@@ -275,7 +270,7 @@
   }
 }
 
-ALIGNED_(64) juint StubRoutines::x86::_k256[] =
+ATTRIBUTE_ALIGNED(64) juint StubRoutines::x86::_k256[] =
 {
     0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
     0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
@@ -298,10 +293,10 @@
 #ifdef _LP64
 // used in MacroAssembler::sha256_AVX2
 // dynamically built from _k256
-ALIGNED_(64) juint StubRoutines::x86::_k256_W[2*sizeof(StubRoutines::x86::_k256)];
+ATTRIBUTE_ALIGNED(64) juint StubRoutines::x86::_k256_W[2*sizeof(StubRoutines::x86::_k256)];
 
 // used in MacroAssembler::sha512_AVX2
-ALIGNED_(64) julong StubRoutines::x86::_k512_W[] =
+ATTRIBUTE_ALIGNED(64) julong StubRoutines::x86::_k512_W[] =
 {
     0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
     0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
--- a/src/hotspot/share/utilities/globalDefinitions.hpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp	Wed May 16 10:24:54 2018 +0200
@@ -39,6 +39,10 @@
 #define ALWAYSINLINE inline
 #endif
 
+#ifndef ATTRIBUTE_ALIGNED
+#define ATTRIBUTE_ALIGNED(x)
+#endif
+
 // This file holds all globally used constants & types, class (forward)
 // declarations and a few frequently used utility functions.
 
--- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp	Wed May 16 10:24:54 2018 +0200
@@ -272,4 +272,14 @@
 #define NOINLINE     __attribute__ ((noinline))
 #define ALWAYSINLINE inline __attribute__ ((always_inline))
 
+// Alignment
+//
+// NOTE! The "+0" below is a workaround for a known bug in older GCC versions
+// (known to fail with 4.6.0, fixed in 4.9.0). This bug affects systems such as
+// RedHat/Oracle Linux 7.5, which ships with GCC 4.8.5. For more details, see
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55382 and
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53017
+//
+#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x+0)))
+
 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
--- a/src/hotspot/share/utilities/globalDefinitions_sparcWorks.hpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/share/utilities/globalDefinitions_sparcWorks.hpp	Wed May 16 10:24:54 2018 +0200
@@ -258,4 +258,7 @@
 #define NOINLINE
 #define ALWAYSINLINE inline __attribute__((always_inline))
 
+// Alignment
+#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
+
 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
--- a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp	Tue May 15 19:26:00 2018 -0400
+++ b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp	Wed May 16 10:24:54 2018 +0200
@@ -169,4 +169,7 @@
 #define NOINLINE     __declspec(noinline)
 #define ALWAYSINLINE __forceinline
 
+// Alignment
+#define ATTRIBUTE_ALIGNED(x) __declspec(align(x))
+
 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_VISCPP_HPP