Re: suggestion for GCC (1)

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

 



David Brown <david@xxxxxxxxxxxxxxx> writes:

>> Of course we could still arrange to provide simple versions in some
>> additional library which is only linked after libc.  I would not be
>> opposed to that.  Real C programs, though, almost always call memcpy and
>> friends themselves, and real C programs always require some level of
>> supporting code.  The current situation doesn't really bother me.
>>
>
> Doesn't gcc treat functions like memcpy as builtins?  Or is that only
> if you explicitly write __builtin__memcpy?  I would have thought that
> in many cases, a builtin version can be a lot smaller and faster than
> library code, since the compiler often knows about things like
> alignment and sizes and can thus generate better code.

The compiler does by default treat functions like memcpy as builtins,
and it's true that when the compiler does know something about alignment
and sizes it can sometimes generate better code.  However, there are
many cases where the compiler does not know anything about the alignment
or size, and then the compiler can't do any better than the library
routine.

Ian


[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