Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Build problem when using 5.1 branch (possibly applies elsewhere): (2 Items)
   
Build problem when using 5.1 branch (possibly applies elsewhere)  
Hi,
The following program does not compile (linux host, qnx target) when using
the gcc 5.1 branch:

#include <immintrin.h>

template <typename T> T func(const T &a, const T &b) {
        return a + b;
}

template <> int func<int>(const int &a, const int &b) {
        return a-b;
}

template <> __m128 func<__m128>(const __m128 &a, const __m128 &b) {
        return _mm_add_ps(a,b);
}


The specialization on __m128 fails with an error about __vector type
attributes.

I've traced this to the backported patches from

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50800

(revision 987)
http://community.qnx.com/viewvc/tools/gcc/trunk/gcc/cp/tree.c?view=markup&revision=987&root=core-dev-tools&system=
exsy1011

Reverting those changes fixes the build problem. There are probably related
patches that need to be added for the above code to work; but I could not
easily determine what changes were needed (something to do with stripping
certain kinds of attributes).
Attachment: HTML sf-attachment-mime32482 1.72 KB
Re: Build problem when using 5.1 branch (possibly applies elsewhere)  
I believe this was fixed when we merged 5.3 into trunk, along with many other bug fixes. I suggest using that branch.