This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_memcpy and alignment assumptions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paul_Koning at dell dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 8 Jan 2016 18:34:59 +0100
- Subject: Re: __builtin_memcpy and alignment assumptions
- Authentication-results: sourceware.org; auth=none
- References: <5e991791-a201-4b8d-89fd-78db873368c7 at BAMAIL02 dot ba dot imgtec dot org> <CAFiYyc3yPAusG2eqw5KoC2eEFBbJyP=ovGGytCYnfG9X4t=S3g at mail dot gmail dot com> <1482639 dot JCa9WsCs7z at polaris> <20160108113220 dot GT18720 at tucnak dot redhat dot com> <94AD0DC3-BE61-4EC8-AE7A-70EF720D0FD3 at dell dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 08, 2016 at 03:28:53PM +0000, Paul_Koning@dell.com wrote:
> If it really is necessary to say that memcpy is defined to behave as if it had a cast to char* in its implementation, it would still be useful -- and obviously valid -- to rely on the greater alignment when there is other code in the block that uses it. And it would be helpful to have a way in the source program to say "I want you to rely on the type alignment".
We have a way to say that, look for __builtin_assume_aligned.
Jakub