This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"SSE register return with SSE disabled" for unused functionality


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]