Description of problem: We're getting some serious crashes in WebKit that were traced to GCC 5 no longer honoring the aligned attribute on a complicated typedef: typedef double Matrix4[4][4] __attribute__((aligned (16))); ^ That worked in GCC 4.9, but no longer works in GCC 5.0. Declaring instances of Matrix4 with alignas does work: alignas(16) Matrix4 m_matrix; See https://bugs.webkit.org/show_bug.cgi?id=142333#c20 for full details. Sorry I don't have any sane minimal reproducer (besides "wait four hours for WebKit to compile then visit youtube.com"), as I'm using an F21 machine right now. I'm just reporting this in case you think a bad bug report is better than no report at all. I will mark this bug needinfo on myself as a reminder to try to construct a small reproducer.
(In reply to Michael Catanzaro from comment #0) > Description of problem: We're getting some serious crashes in WebKit that > were traced to GCC 5 no longer honoring the aligned attribute on a > complicated typedef: > > typedef double Matrix4[4][4] __attribute__((aligned (16))); > > ^ That worked in GCC 4.9, but no longer works in GCC 5.0. Hm, it works in general. This test does NOT demonstrate the bug; it works fine with both versions of GCC so long as the attribute is present on the typedef: #include <stdio.h> typedef double Matrix4[4][4] __attribute__((aligned (16))); struct s { char a, b, c; // random variables to throw off alignment Matrix4 m; }; int main () { struct s s; Matrix4 m; char c; // again just trying to throw off alignment Matrix4 mm; printf ("Last digit should be 0: %p\n", s.m); printf ("Last digit should be 0: %p\n", m); printf ("Last digit should be 0: %p\n", mm); return 0; } So I'm not sure what is causing the problem. I guess the thing to do is try to work backwards from the WebKit code. This will be a pain. :(
Created attachment 1011289 [details] Preprocessed TransformationMatrix.cpp file Attached is the preprocessed file where the problem manifests. The Matrix4 type is defined on line 98480. At the bottom of the file are two static_assert statements that test the alignment of the TransformationMatrix and TransformationMatrix::Matrix4 types, expecting 16 as the result. Both fail when compiling with g++-5 on Debian: $ g++-5 -std=c++11 -c TransformationMatrix.E.cpp
This looks similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48138 which suggests there be dragons here, although that doesn't explain what changed between GCC 4.9 and 5.0. Note "but the core problem seems to be that alignments on typedefs aren't supported" from the upstream bug can't be correct, as http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html introduces the attribute by demonstrating its use on a typedef.
gcc-5.0.1-0.1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/gcc-5.0.1-0.1.fc22
gcc-5.0.1-0.1.fc22, libtool-2.4.2-33.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.