This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79518] __builtin_assume_aligned should mark argument as aligned
- From: "evan at coeus-group dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Feb 2017 22:45:16 +0000
- Subject: [Bug c/79518] __builtin_assume_aligned should mark argument as aligned
- Auto-submitted: auto-generated
- References: <bug-79518-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79518
--- Comment #2 from Evan Nemerson <evan@coeus-group.com> ---
(In reply to Andrew Pinski from comment #1)
> Why can't you use:
> #define __assume_aligned(arg, align) arg = __builtin_assume_aligned
> (arg, align)
>
> ?
arg may be read-only. void* const arg = ...; __assume_aligned(arg, 16)
arg is also evaluated twice, though I'm not sure how much of a problem that
would be in this situation, or how helpful __assume_aligned would be for other
compilers where it would matter…