target specific option mismatch?

Ian Lance Taylor iant@google.com
Fri Apr 15 14:51:00 GMT 2011


Matthias Kretz <kretz@compeng.uni-frankfurt.de> writes:

> I experience a miscompile with GCC 4.6.0 (#48616) and was trying to implement 
> a workaround in my library, but no success. The bug is connected to use of the 
> XOP instruction set and -ftree-vectorize. So I thought I can just disable one 
> or both of those in the function where the miscompile happens. But that 
> function is a member of a template class and thus inlined. Apparently that 
> leads to neither "#pragma GCC optimize/target" nor 
> "__attribute__((optimize/target))" changing anything, or is that another bug?
>
> Anyway this is what I got:
>
> #define VC_WORKAROUND __attribute__((optimize("no-tree-vectorize"),target("no-
> xop")))
>
> template<> inline Vector<T> &VC_WORKAROUND VectorBase<T>::operator>>=(const 
> VectorBase<T> &x)
> {
>     for_all_vector_entries(i,
>             d.m(i) >>= x.d.m(i);
>             );
>     return *static_cast<Vector<T> *>(this);
> }
>
> vector.tcc:286:1: sorry, unimplemented: inlining failed in call to 
> ‘Vc::SSE::Vector<T>& Vc::SSE::VectorBase<T>::operator<<=(const 
> Vc::SSE::VectorBase<T>&) [with T = int]’: target specific option mismatch
>
>
> Any suggestions how to implement a workaround?

I have no suggestions for a workaround, but I don't think this should
fail with an error like this for a function that does not have the
always_inline attribute.  It should just not inline, and give a warning
with -Winline.  Please consider opening a bug report.  Thanks.

Ian



More information about the Gcc-help mailing list