builtins.def (BUILT_IN_LLABS): Add.

* builtins.def (BUILT_IN_LLABS): Add.
	* builtins.c (expand_builtin): Also abort on BUILT_IN_LLABS.
	* c-common.c (c_common_nodes_builtins): Create builtin functions
	__builtin_llabs, and plain llabs unless no_nonansi_builtins
	outside of C99 mode.
	(expand_tree_builtin): Handle BUILT_IN_LLABS.

From-SVN: r36585
This commit is contained in:
Joseph Myers 2000-09-24 10:50:30 +01:00 committed by Joseph Myers
parent b15c8032f0
commit 1c44c45dbf
4 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2000-09-24 Joseph S. Myers <jsm28@cam.ac.uk>
* builtins.def (BUILT_IN_LLABS): Add.
* builtins.c (expand_builtin): Also abort on BUILT_IN_LLABS.
* c-common.c (c_common_nodes_builtins): Create builtin functions
__builtin_llabs, and plain llabs unless no_nonansi_builtins
outside of C99 mode.
(expand_tree_builtin): Handle BUILT_IN_LLABS.
Sat 23-Sep-2000 22:39:18 BST Neil Booth <NeilB@earthling.net>
* cpphash.h (CPP_RESERVE, CPP_PUTS_Q, CPP_PUTS, CPP_PUTC_Q,

View file

@ -2595,6 +2595,7 @@ expand_builtin (exp, target, subtarget, mode, ignore)
{
case BUILT_IN_ABS:
case BUILT_IN_LABS:
case BUILT_IN_LLABS:
case BUILT_IN_FABS:
/* build_function_call changes these into ABS_EXPR. */
abort ();

View file

@ -23,6 +23,7 @@ DEF_BUILTIN(BUILT_IN_ALLOCA)
DEF_BUILTIN(BUILT_IN_ABS)
DEF_BUILTIN(BUILT_IN_FABS)
DEF_BUILTIN(BUILT_IN_LABS)
DEF_BUILTIN(BUILT_IN_LLABS)
DEF_BUILTIN(BUILT_IN_FFS)
DEF_BUILTIN(BUILT_IN_DIV)
DEF_BUILTIN(BUILT_IN_LDIV)

View file

@ -4020,6 +4020,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
tree int_ftype_cptr_cptr_sizet;
tree int_ftype_string_string, string_ftype_ptr_ptr;
tree long_ftype_long;
tree longlong_ftype_longlong;
/* Either char* or void*. */
tree traditional_ptr_type_node;
/* Either const char* or const void*. */
@ -4094,6 +4095,11 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
tree_cons (NULL_TREE, long_integer_type_node,
endlink));
longlong_ftype_longlong
= build_function_type (long_long_integer_type_node,
tree_cons (NULL_TREE, long_long_integer_type_node,
endlink));
int_ftype_cptr_cptr_sizet
= build_function_type (integer_type_node,
tree_cons (NULL_TREE, const_ptr_type_node,
@ -4234,6 +4240,8 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_labs", long_ftype_long, BUILT_IN_LABS,
BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_llabs", longlong_ftype_longlong, BUILT_IN_LLABS,
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,
@ -4400,6 +4408,9 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins)
BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("labs", long_ftype_long, BUILT_IN_LABS,
BUILT_IN_NORMAL, NULL_PTR);
if (flag_isoc99 || ! no_nonansi_builtins)
builtin_function ("llabs", longlong_ftype_longlong, BUILT_IN_LLABS,
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,
@ -4578,6 +4589,7 @@ expand_tree_builtin (function, params, coerced_params)
{
case BUILT_IN_ABS:
case BUILT_IN_LABS:
case BUILT_IN_LLABS:
case BUILT_IN_FABS:
if (coerced_params == 0)
return integer_zero_node;