Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vc fails with gcc 6 #125

Closed
axaith opened this issue May 10, 2016 · 8 comments
Closed

Vc fails with gcc 6 #125

axaith opened this issue May 10, 2016 · 8 comments
Assignees
Milestone

Comments

@axaith
Copy link

axaith commented May 10, 2016

Vc fails with gcc 6 like so:

common/storage.h:189:21: error: flexible array member in union
EntryType m[];

I tested a hello world program like this:

int main() { union { int a; int b[]; }; return 0; }

$ g++-5.3.0 -std=c++14 foo.cpp
$

$ g++-6.1.0 -std=c++14 foo.cpp
foo.cpp: In function ‘int main()’:
foo.cpp:3:26: error: flexible array member in union
$

@mattkretz mattkretz added this to the Vc 1.3 milestone May 12, 2016
@mattkretz mattkretz self-assigned this May 12, 2016
@tcanabrava
Copy link

tcanabrava commented May 18, 2016

just do entryType[0] instead of entryType[](I tried to post the diff here but this comment section is terrible) - I had to do this here to make it compile for krita.

@mattkretz
Copy link
Member

@tcanabrava Sadly this only resolves the compilation error. But it breaks the ABI of the type. I.e. after this change function arguments would be passed via the stack instead of via SIMD registers. This is a compatibility issue and a performance issue.
However, the solution may be much simpler: Forbid use of this variant of storage implementation and #ifdef it out altogether for GCC.

@peremato
Copy link

peremato commented Jun 8, 2016

Is there a new tag with these changes?

@mattkretz
Copy link
Member

Sorry, no. I have not even found time to fix it yet. But this one is high priority. Let's see.

mattkretz added a commit that referenced this issue Jun 14, 2016
GCC 6 refuses to compile this implementation strategy since it requires
non-standard `EntryType m[]` to keep the ABI.

Refs: gh-125
Signed-off-by: Matthias Kretz <kretz@kde.org>
mattkretz added a commit that referenced this issue Jun 14, 2016
- most importantly, the -Wignored-attributes warning is veeery noisy
since e.g. the use of __m128 as a template argument already triggers it.
So add -Wno-ignored-attributes to the compile flags
- #define Vc_TEMPLATES_DROP_ATTRIBUTES starting with GCC 6
- readd the may_alias attribute to the IntrinsicType in Storage<...,
AliasStrategy::VectorBuiltin>. GCC6 lost it since the vector type is
passed as a template argument.

Refs: gh-125
Signed-off-by: Matthias Kretz <kretz@kde.org>
mattkretz added a commit that referenced this issue Jun 14, 2016
Refs: gh-125
Signed-off-by: Matthias Kretz <kretz@kde.org>
mattkretz added a commit that referenced this issue Jun 14, 2016
Refs: gh-125
Signed-off-by: Matthias Kretz <kretz@kde.org>
@mattkretz
Copy link
Member

compiles and all tests pass on master now

@devsk
Copy link

devsk commented Oct 27, 2016

Is there a plan to get 1.3 out with this patch? The issue has been fixed for a while now and 1.3 milestone has no open issues. Why is it not being released? Apologies if these questions are silly and that information is readily available elsewhere.

@mattkretz
Copy link
Member

Yes, sorry for the long delay. I was/am working on this with high priority. I just closed/moved all 1.3 issues on Tuesday. There's a final failure lurking on the dashboard that I will hopefully fix today, and if all goes well we'll have a 1.3 release today (or tomorrow).

@devsk
Copy link

devsk commented Oct 28, 2016

Thank you so much for the update. Eagerly waiting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants