This is the mail archive of the gcc@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]

Re: asm in inline function invalidating function attributes?


On Sat, Oct 15, 2011 at 05:52:03PM -0400, Ulrich Drepper wrote:
> I think gcc should allow the programmer to tell it something about a
> function return value even if the function is inlined and the compiler
> can see all the code.  Consider the code below.

If this is about e.g.
2011-09-14  Ulrich Drepper  <drepper@gmail.com>

	* sysdeps/x86_64/fpu/bits/mathinline.h (__MATH_INLINE): Use
	__extern_always_inline.
	Define lrint{f,} and llrint{f,} for 64-bit and in some situations for
 	32-bit.
then I'd say these inlines are the wrong direction, gcc (tried 4.6/trunk
only) has lrint{,f,l} builtin, and for -ffast-math it will optimize it into
cvtsd2siq etc. (both for -m64 and for -m32 -msse2 -mfmath=sse). 
It will be handled as const, and furthermore gcc will constant fold it
(lrint (7.5) will be resolved at compile time).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]