aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r--gcc/c-family/c-common.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3756219..7169813 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5856,15 +5856,27 @@ builtin_function_validate_nargs (location_t loc, tree fndecl, int nargs,
/* Verifies the NARGS arguments ARGS to the builtin function FNDECL.
Returns false if there was an error, otherwise true. LOC is the
location of the function; ARG_LOC is a vector of locations of the
- arguments. */
+ arguments. If FNDECL is the result of resolving an overloaded
+ target built-in, ORIG_FNDECL is the original function decl,
+ otherwise it is null. */
bool
check_builtin_function_arguments (location_t loc, vec<location_t> arg_loc,
- tree fndecl, int nargs, tree *args)
+ tree fndecl, tree orig_fndecl,
+ int nargs, tree *args)
{
- if (!fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))
+ if (!fndecl_built_in_p (fndecl))
return true;
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ return (!targetm.check_builtin_call
+ || targetm.check_builtin_call (loc, arg_loc, fndecl,
+ orig_fndecl, nargs, args));
+
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_FRONTEND)
+ return true;
+
+ gcc_assert (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL);
switch (DECL_FUNCTION_CODE (fndecl))
{
case BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX: