diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-01 22:35:50 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-01 22:35:50 +0000 |
commit | 1dfa965e65d6b081e78b2b2fa7be3fb84a7f664e (patch) | |
tree | e2e2c8b7ff41d4e0a9b83ff190cf53f596eecefa /gcc/c-common.c | |
parent | 6bf5ed8d9c7340ed0e889dfaa573a5972ab15feb (diff) | |
download | gcc-1dfa965e65d6b081e78b2b2fa7be3fb84a7f664e.tar.gz |
* builtins.def (BUILT_IN_IMAXABS): Add.
* builtins.c (expand_builtin): Also abort on BUILT_IN_IMAXABS.
* c-common.c (c_common_nodes_and_builtins): Create builtin
functions __builtin_imaxabs, and plain imaxabs unless
flag_no_nonansi_builtin outside C99 mode.
(expand_tree_builtin): Handle BUILT_IN_IMAXABS.
* extend.texi: Document builtin imaxabs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 0a605f83741..c4fd4639b06 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4911,6 +4911,7 @@ c_common_nodes_and_builtins () tree string_ftype_string_cstring_sizet, int_ftype_cstring_cstring_sizet; tree long_ftype_long; tree longlong_ftype_longlong; + tree intmax_ftype_intmax; /* Either char* or void*. */ tree traditional_ptr_type_node; /* Either const char* or const void*. */ @@ -5007,6 +5008,11 @@ c_common_nodes_and_builtins () tree_cons (NULL_TREE, long_long_integer_type_node, endlink)); + intmax_ftype_intmax + = build_function_type (intmax_type_node, + tree_cons (NULL_TREE, intmax_type_node, + endlink)); + int_ftype_cptr_cptr_sizet = build_function_type (integer_type_node, tree_cons (NULL_TREE, const_ptr_type_node, @@ -5190,6 +5196,8 @@ c_common_nodes_and_builtins () BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_llabs", longlong_ftype_longlong, BUILT_IN_LLABS, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_imaxabs", intmax_ftype_intmax, BUILT_IN_IMAXABS, + BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_saveregs", ptr_ftype, BUILT_IN_SAVEREGS, BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_classify_type", default_function_type, @@ -5375,8 +5383,12 @@ c_common_nodes_and_builtins () builtin_function ("labs", long_ftype_long, BUILT_IN_LABS, BUILT_IN_NORMAL, NULL_PTR); if (flag_isoc99 || ! flag_no_nonansi_builtin) - builtin_function ("llabs", longlong_ftype_longlong, BUILT_IN_LLABS, - BUILT_IN_NORMAL, NULL_PTR); + { + builtin_function ("llabs", longlong_ftype_longlong, BUILT_IN_LLABS, + BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("imaxabs", intmax_ftype_intmax, BUILT_IN_IMAXABS, + BUILT_IN_NORMAL, NULL_PTR); + } builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY, BUILT_IN_NORMAL, NULL_PTR); builtin_function ("memcmp", int_ftype_cptr_cptr_sizet, BUILT_IN_MEMCMP, @@ -5573,6 +5585,7 @@ expand_tree_builtin (function, params, coerced_params) case BUILT_IN_ABS: case BUILT_IN_LABS: case BUILT_IN_LLABS: + case BUILT_IN_IMAXABS: case BUILT_IN_FABS: if (coerced_params == 0) return integer_zero_node; |