This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/53190] CSE (?) CSEs asms
- From: "aj at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 May 2012 09:19:16 +0000
- Subject: [Bug rtl-optimization/53190] CSE (?) CSEs asms
- Auto-submitted: auto-generated
- References: <bug-53190-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53190
--- Comment #8 from Andreas Jaeger <aj at gcc dot gnu.org> 2012-05-03 09:19:16 UTC ---
So, how should the inline rewritten?
Adding volatile is one option:
extern __inline __attribute__ ((__always_inline__)) long int
__attribute__ ((__nothrow__ )) lrintf (float __x)
{
long int __res;
__asm __volatile__ ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
return __res;
}
Since this is SSE code: Is there any way to clobber the SSE control register?
Any better way to write the above?
Btw. I'd like to make two changes for glibc:
* Fix the inline
* Only declare the inline when lrintf is not available as builtin. lrint was
introduce in 2003-08-28, so should be part of gcc 3.4 and therefore for GCC 3.4
and newer my patch will not use the above anymore.