This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: asm in inline function invalidating function attributes?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ulrich Drepper <drepper at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 16 Oct 2011 20:38:37 +0200
- Subject: Re: asm in inline function invalidating function attributes?
- References: <CAOPLpQc7=Qj=eR8ijiNiYcjNu2err+FfBDmy5LSJ0b7XJkyXUw@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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