/* Expand builtin functions.
- Copyright (C) 1988-2023 Free Software Foundation, Inc.
+ Copyright (C) 1988-2024 Free Software Foundation, Inc.
This file is part of GCC.
rtx ret = convert_to_mode (ptr_mode, copy_to_reg (stack_pointer_rtx),
STACK_UNSIGNED);
+#ifdef STACK_ADDRESS_OFFSET
/* Unbias the stack pointer, bringing it to the boundary between the
stack area claimed by the active function calling this builtin,
and stack ranges that could get clobbered if it called another
(caller) function's active area as well, whereas those pushed or
allocated temporarily for a call are regarded as part of the
callee's stack range, rather than the caller's. */
- ret = plus_constant (ptr_mode, ret, STACK_POINTER_OFFSET);
+ ret = plus_constant (ptr_mode, ret, STACK_ADDRESS_OFFSET);
+#endif
return force_reg (ptr_mode, ret);
}
tree call;
/* If we are not profiling, just call the function. */
- if (!profile_arc_flag)
+ if (!profile_arc_flag && !condition_coverage_flag)
return NULL_RTX;
/* Otherwise call the wrapper. This should be equivalent for the rest of
default:
break;
}
- if (sanitize_flags_p (SANITIZE_ADDRESS) && asan_intercepted_p (fcode))
+ if (sanitize_flags_p (SANITIZE_ADDRESS | SANITIZE_HWADDRESS)
+ && asan_intercepted_p (fcode))
return expand_call (exp, target, ignore);
/* When not optimizing, generate calls to library functions for a certain
case BUILT_IN_ADJUST_DESCRIPTOR:
return expand_builtin_adjust_descriptor (exp);
+ case BUILT_IN_GCC_NESTED_PTR_CREATED:
+ case BUILT_IN_GCC_NESTED_PTR_DELETED:
+ break; /* At present, no expansion, just call the function. */
+
case BUILT_IN_FORK:
case BUILT_IN_EXECL:
case BUILT_IN_EXECV:
/* Transform isascii(c) -> ((c & ~0x7f) == 0). */
arg = fold_build2 (BIT_AND_EXPR, integer_type_node, arg,
build_int_cst (integer_type_node,
- ~ (unsigned HOST_WIDE_INT) 0x7f));
+ ~ HOST_WIDE_INT_UC (0x7f)));
return fold_build2_loc (loc, EQ_EXPR, integer_type_node,
arg, integer_zero_node);
}
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK)
+ if (error_operand_p (arg0))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0))
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK
- || TREE_CODE (arg1) == ERROR_MARK)
+ if (error_operand_p (arg0)
+ || error_operand_p (arg1))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0, arg1))
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK
- || TREE_CODE (arg1) == ERROR_MARK
- || TREE_CODE (arg2) == ERROR_MARK)
+ if (error_operand_p (arg0)
+ || error_operand_p (arg1)
+ || error_operand_p (arg2))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type,