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

Severin Gehwolf sgehwolf at redhat.com
Fri Mar 8 08:54:22 UTC 2019


On Thu, 2019-03-07 at 16:09 -0500, Kim Barrett wrote:
> > On Mar 7, 2019, at 1:27 PM, Severin Gehwolf <sgehwolf at redhat.com> wrote:
> > 
> > On Thu, 2019-03-07 at 18:40 +0100, Aleksey Shipilev wrote:
> > > 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)))
> > 
> > Sure, makes sense. Thanks! Updated webrev:
> > http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8220283/02/webrev/
> > 
> > Could I get a second review for this, please?
> > 
> > Thanks,
> > Severin
> 
> Looks okay, but yuck! :(
> 
> Reviewed.

Thanks for the review, Kim!

Cheers,
Severin



More information about the hotspot-dev mailing list