"SSE register return with SSE disabled" for unused functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We want to use the -mno-sse option and similar when building driver code. We also would very much like to use some standard headers that (we suppose) can be used in freestanding environments (with some coercion if need be.) For example, <tuple>. However, an attempt to compile the following code with, say “g++ --std=c++11 -mno-sse”:

#include <tuple>

int main()
{
}

results in:

In file included from /usr/local/stow/gcc-4.8.0/include/c++/4.8.0/string:52:0,
                 from /usr/local/stow/gcc-4.8.0/include/c++/4.8.0/stdexcept:39,
                 from /usr/local/stow/gcc-4.8.0/include/c++/4.8.0/array:38,
                 from /usr/local/stow/gcc-4.8.0/include/c++/4.8.0/tuple:39,
                 from test.cpp:1:
/usr/local/stow/gcc-4.8.0/include/c++/4.8.0/bits/basic_string.h: In function âfloat std::stof(const string&, std::size_t*)â:
/usr/local/stow/gcc-4.8.0/include/c++/4.8.0/bits/basic_string.h:2851:46: error: SSE register return with SSE disabled
   stof(const string& __str, size_t* __idx = 0)

The definition of stof:

  inline float
  stof(const string& __str, size_t* __idx = 0)
  { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }

I assume this function is not necessary in the example (directly or indirectly). Is there a way to force the compiler to accept the inline definitions in these circumstances, and only reject them when it absolutely needs to generate code for them?

Similarly we may sometimes use our own headers for both kernel-land and user-land code, with inline functions inside that are used only in the right kind of environment. I know we can use preprocessor conditionals, but it would be nicer to have a compiler option for this.

Thanks,






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux