RFR: 8220283: ZGC fails to build on GCC 4.4.7: ATTRIBUTE_ALIGNED compatibility issue

Aleksey Shipilev shade at redhat.com
Thu Mar 7 17:40:05 UTC 2019


On 3/7/19 6:23 PM, Severin Gehwolf wrote:
> http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8220283/01/webrev/

Some background. After Severin reported this failure, I found this trick by pure chance, fiddling
with godbolt: https://godbolt.org/z/OmVQ-B

We should extend the "NOTE!" comment with this new knowledge, for instance:

 // 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
 //
 // GCC versions older than 4.6.4 would fail even with "+0", and needs additional
 // cast to typeof(x) to work around the similar bug.
 //
 #define ATTRIBUTE_ALIGNED(x) __attribute__((aligned((typeof(x))x+0)))

-Aleksey




More information about the hotspot-dev mailing list