[Bug c/79518] __builtin_assume_aligned should mark argument as aligned

evan@coeus-group.com gcc-bugzilla@gcc.gnu.org
Tue Feb 14 22:45:00 GMT 2017


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…


More information about the Gcc-bugs mailing list