From 45d439ac1a9e2df33ac7ef573009749dbebf581b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 27 Jun 2011 18:52:23 +0200 Subject: builtin-types.def (BT_FN_PTR_CONST_PTR_SIZE_VAR): New. * builtin-types.def (BT_FN_PTR_CONST_PTR_SIZE_VAR): New. * builtins.def (BUILT_IN_ASSUME_ALIGNED): New builtin. * tree-ssa-structalias.c (find_func_aliases_for_builtin_call, find_func_clobbers): Handle BUILT_IN_ASSUME_ALIGNED. * tree-ssa-ccp.c (bit_value_assume_aligned): New function. (evaluate_stmt, execute_fold_all_builtins): Handle BUILT_IN_ASSUME_ALIGNED. * tree-ssa-dce.c (propagate_necessity): Likewise. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise. * builtins.c (is_simple_builtin, expand_builtin): Likewise. (expand_builtin_assume_aligned): New function. * doc/extend.texi (__builtin_assume_aligned): Document. * c-common.c (check_builtin_function_arguments): Handle BUILT_IN_ASSUME_ALIGNED. * gcc.dg/builtin-assume-aligned-1.c: New test. * gcc.dg/builtin-assume-aligned-2.c: New test. * gcc.target/i386/builtin-assume-aligned-1.c: New test. From-SVN: r175541 --- gcc/doc/extend.texi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 2d9c689..0e80590 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7646,6 +7646,28 @@ int g (int c) @end deftypefn +@deftypefn {Built-in Function} void *__builtin_assume_aligned (const void *@var{exp}, size_t @var{align}, ...) +This function returns its first argument, and allows the compiler +to assume that the returned pointer is at least @var{align} bytes +aligned. This built-in can have either two or three arguments, +if it has three, the third argument should have integer type, and +if it is non-zero means misalignment offset. For example: + +@smallexample +void *x = __builtin_assume_aligned (arg, 16); +@end smallexample + +means that the compiler can assume x, set to arg, is at least +16 byte aligned, while: + +@smallexample +void *x = __builtin_assume_aligned (arg, 32, 8); +@end smallexample + +means that the compiler can assume for x, set to arg, that +(char *) x - 8 is 32 byte aligned. +@end deftypefn + @deftypefn {Built-in Function} void __builtin___clear_cache (char *@var{begin}, char *@var{end}) This function is used to flush the processor's instruction cache for the region of memory between @var{begin} inclusive and @var{end} -- cgit v1.1