diff options
author | Jan Beulich <jbeulich@novell.com> | 2004-07-09 23:04:33 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-09 16:04:33 -0700 |
commit | 2319a1d1f7308338e91ace8b30719347b91580e4 (patch) | |
tree | 0848a312643aa3db319dcfacfd3dd9e8b0f76e97 | |
parent | 18df6de934489a4ace9de466d596efb7f6ecf5b0 (diff) | |
download | gcc-2319a1d1f7308338e91ace8b30719347b91580e4.zip gcc-2319a1d1f7308338e91ace8b30719347b91580e4.tar.gz gcc-2319a1d1f7308338e91ace8b30719347b91580e4.tar.bz2 |
builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.
* builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.
(BT_FN_UINT): Rename from BT_FN_UNSIGNED.
(BT_FN_PTR_UINT): Rename from BT_FN_PTR_UNSIGNED.
(BT_ULONG, BT_ULONGLONG, BT_UINTMAX, BT_FN_INT_UINT, BT_FN_INT_ULONG,
BT_FN_INT_ULONGLONG, BT_FN_INT_INTMAX, BT_FN_INT_UINTMAX): New.
* builtins.def (BUILTIN_CLZxxx, BUILTIN_CTXxxx, BUILTIN_PARITYxxx,
BUILTIN_POPCOUNTxxx): Arguments are unsigned.
(BUILTIN_xxxIMAX): New.
* builtins.c (expand_builtin): Handle BUILT_IN_FFSIMAX,
BUILT_IN_CLZIMAX, BUILT_IN_CTZIMAX, BUILT_IN_POPCOUNIMAX, and
BUILT_IN_PARITYIMAX.
From-SVN: r84415
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/builtin-types.def | 16 | ||||
-rw-r--r-- | gcc/builtins.c | 5 | ||||
-rw-r--r-- | gcc/builtins.def | 41 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-protos-1.c | 68 |
5 files changed, 122 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43d21e3..0bb7353 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2004-07-09 Jan Beulich <jbeulich@novell.com> + + * builtin-types.def (BT_UINT): Rename from BT_UNSIGNED. + (BT_FN_UINT): Rename from BT_FN_UNSIGNED. + (BT_FN_PTR_UINT): Rename from BT_FN_PTR_UNSIGNED. + (BT_ULONG, BT_ULONGLONG, BT_UINTMAX, BT_FN_INT_UINT, BT_FN_INT_ULONG, + BT_FN_INT_ULONGLONG, BT_FN_INT_INTMAX, BT_FN_INT_UINTMAX): New. + * builtins.def (BUILTIN_CLZxxx, BUILTIN_CTXxxx, BUILTIN_PARITYxxx, + BUILTIN_POPCOUNTxxx): Arguments are unsigned. + (BUILTIN_xxxIMAX): New. + * builtins.c (expand_builtin): Handle BUILT_IN_FFSIMAX, + BUILT_IN_CLZIMAX, BUILT_IN_CTZIMAX, BUILT_IN_POPCOUNIMAX, and + BUILT_IN_PARITYIMAX. + 2004-07-09 David S. Miller <davem@nuts.davemloft.net> * config/sparc/sparc.h (processor_costs): Define. diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def index 7f6fb64..8458631 100644 --- a/gcc/builtin-types.def +++ b/gcc/builtin-types.def @@ -61,12 +61,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node) DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node) -DEF_PRIMITIVE_TYPE (BT_UNSIGNED, unsigned_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node) +DEF_PRIMITIVE_TYPE (BT_ULONG, long_unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node) +DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node) +DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) +DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node) DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0)) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) -DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node) DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE, long_double_type_node) DEF_PRIMITIVE_TYPE (BT_COMPLEX_FLOAT, complex_float_type_node) @@ -96,7 +99,7 @@ DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID) DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR) DEF_FUNCTION_TYPE_0 (BT_FN_PID, BT_PID) -DEF_FUNCTION_TYPE_0 (BT_FN_UNSIGNED, BT_UNSIGNED) +DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT) DEF_FUNCTION_TYPE_0 (BT_FN_FLOAT, BT_FLOAT) DEF_FUNCTION_TYPE_0 (BT_FN_DOUBLE, BT_DOUBLE) /* For "long double" we use LONGDOUBLE (not LONG_DOUBLE) to @@ -123,11 +126,16 @@ DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLEX_DOUBLE, BT_DOUBLE, BT_COMPLEX_DOUBLE) DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UNSIGNED, BT_PTR, BT_UNSIGNED) +DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UINT, BT_PTR, BT_UINT) DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE) DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINT, BT_INT, BT_UINT) DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONG, BT_INT, BT_LONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONG, BT_INT, BT_ULONG) DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGLONG, BT_INT, BT_LONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONGLONG, BT_INT, BT_ULONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_INTMAX, BT_INT, BT_INTMAX) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINTMAX, BT_INT, BT_UINTMAX) DEF_FUNCTION_TYPE_1 (BT_FN_INT_PTR, BT_INT, BT_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_INT_FLOAT, BT_INT, BT_FLOAT) DEF_FUNCTION_TYPE_1 (BT_FN_INT_DOUBLE, BT_INT, BT_DOUBLE) diff --git a/gcc/builtins.c b/gcc/builtins.c index 11e1f05..a17a337 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5973,6 +5973,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FFS: case BUILT_IN_FFSL: case BUILT_IN_FFSLL: + case BUILT_IN_FFSIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, ffs_optab); if (target) @@ -5982,6 +5983,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_CLZ: case BUILT_IN_CLZL: case BUILT_IN_CLZLL: + case BUILT_IN_CLZIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, clz_optab); if (target) @@ -5991,6 +5993,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_CTZ: case BUILT_IN_CTZL: case BUILT_IN_CTZLL: + case BUILT_IN_CTZIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, ctz_optab); if (target) @@ -6000,6 +6003,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_POPCOUNT: case BUILT_IN_POPCOUNTL: case BUILT_IN_POPCOUNTLL: + case BUILT_IN_POPCOUNTIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, popcount_optab); if (target) @@ -6009,6 +6013,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_PARITY: case BUILT_IN_PARITYL: case BUILT_IN_PARITYLL: + case BUILT_IN_PARITYIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, parity_optab); if (target) diff --git a/gcc/builtins.def b/gcc/builtins.def index bd8a630..d660f8d 100644 --- a/gcc/builtins.def +++ b/gcc/builtins.def @@ -444,9 +444,6 @@ DEF_C99_BUILTIN (BUILT_IN_CTANL, "ctanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLE DEF_EXT_LIB_BUILTIN (BUILT_IN_BCMP, "bcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1) DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_1_2) DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2) @@ -542,17 +539,19 @@ DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_N DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL) DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZIMAX, "clzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CONSTANT_P, "constant_p", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZIMAX, "ctzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_DCGETTEXT, "dcgettext", BT_FN_STRING_CONST_STRING_CONST_STRING_INT, ATTR_FORMAT_ARG_2) DEF_EXT_LIB_BUILTIN (BUILT_IN_DGETTEXT, "dgettext", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_FORMAT_ARG_2) DEF_GCC_BUILTIN (BUILT_IN_DWARF_CFA, "dwarf_cfa", BT_FN_PTR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UNSIGNED, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN, "eh_return", BT_FN_VOID_PTRMODE_PTR, ATTR_NORETURN_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN_DATA_REGNO, "eh_return_data_regno", BT_FN_INT_INT, ATTR_NULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECL, "execl", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_NOTHROW_LIST) @@ -565,8 +564,12 @@ DEF_LIB_BUILTIN (BUILT_IN_EXIT, "exit", BT_FN_VOID_INT, ATTR_NORETURN_NOT DEF_GCC_BUILTIN (BUILT_IN_EXPECT, "expect", BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EXTEND_POINTER, "extend_pointer", BT_FN_WORD_PTR, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EXTRACT_RETURN_ADDR, "extract_return_addr", BT_FN_PTR_PTR, ATTR_NULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSIMAX, "ffsimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_FORK, "fork", BT_FN_PID, ATTR_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UNSIGNED, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1) DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LIST) @@ -591,15 +594,17 @@ DEF_C99_BUILTIN (BUILT_IN_LLABS, "llabs", BT_FN_LONGLONG_LONGLONG, ATTR_C DEF_GCC_BUILTIN (BUILT_IN_LONGJMP, "longjmp", BT_FN_VOID_PTR_INT, ATTR_NORETURN_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_MALLOC, "malloc", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_NEXT_ARG, "next_arg", BT_FN_PTR_VAR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYIMAX, "parityimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTIMAX, "popcountimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UNSIGNED, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_STACK_ALLOC, "stack_alloc", BT_FN_VOID_PTR_SIZE, ATTR_NULL) diff --git a/gcc/testsuite/gcc.dg/builtin-protos-1.c b/gcc/testsuite/gcc.dg/builtin-protos-1.c new file mode 100644 index 0000000..c3cdc53 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-protos-1.c @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-options -Wconversion } */ + +int +test_s (signed int x) +{ + return __builtin_abs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clz (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctz (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parity (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcount (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_u (unsigned int x) +{ + return __builtin_abs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clz (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctz (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parity (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcount (x); /* { dg-bogus "as signed due to prototype" } */ +} + +int +test_sl (signed long x) +{ + return __builtin_labs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clzl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctzl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffsl (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parityl (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcountl (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_ul (unsigned long x) +{ + return __builtin_labs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clzl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctzl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffsl (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parityl (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcountl (x); /* { dg-bogus "as signed due to prototype" } */ +} + +int +test_sll (signed long long x) +{ + return __builtin_llabs (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_clzll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ctzll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_ffsll (x) /* { dg-bogus "as unsigned due to prototype" } */ + + __builtin_parityll (x) /* { dg-warning "as unsigned due to prototype" } */ + + __builtin_popcountll (x); /* { dg-warning "as unsigned due to prototype" } */ +} + +int +test_ull (unsigned long long x) +{ + return __builtin_llabs (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_clzll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ctzll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_ffsll (x) /* { dg-warning "as signed due to prototype" } */ + + __builtin_parityll (x) /* { dg-bogus "as signed due to prototype" } */ + + __builtin_popcountll (x); /* { dg-bogus "as signed due to prototype" } */ +} |