GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "memmodel.h"
#include "gimple.h"
#include "predict.h"
#include "tm_p.h"
#include "stringpool.h"
#include "tree-vrp.h"
#include "tree-ssanames.h"
#include "expmed.h"
#include "optabs.h"
#include "emit-rtl.h"
#include "recog.h"
#include "diagnostic-core.h"
#include "alias.h"
#include "fold-const.h"
#include "fold-const-call.h"
#include "gimple-ssa-warn-access.h"
#include "stor-layout.h"
#include "calls.h"
#include "varasm.h"
#include "tree-object-size.h"
#include "tree-ssa-strlen.h"
#include "realmpfr.h"
#include "cfgrtl.h"
#include "except.h"
#include "dojump.h"
#include "explow.h"
#include "stmt.h"
#include "expr.h"
#include "libfuncs.h"
#include "output.h"
#include "typeclass.h"
#include "langhooks.h"
#include "value-prof.h"
#include "builtins.h"
#include "attribs.h"
#include "asan.h"
#include "internal-fn.h"
#include "case-cfn-macros.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "intl.h"
#include "file-prefix-map.h"
#include "ipa-strub.h"
#include "gomp-constants.h"
#include "omp-general.h"
#include "tree-dfa.h"
#include "gimple-ssa.h"
#include "tree-ssa-live.h"
#include "tree-outof-ssa.h"
#include "attr-fnspec.h"
#include "demangle.h"
#include "gimple-range.h"
#include "pointer-query.h"
#include "builtins.def"
#include "internal-fn.def"
Data Structures | |
class | delta_type< T > |
Macros | |
#define | DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM, COND) |
#define | DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GCC_FLOATN_NX_BUILTINS(ENUM, NAME, TYPE_MACRO, ATTRS) |
#define | DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_FLOATN_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_EXT_LIB_FLOATN_NX_BUILTINS(ENUM, NAME, TYPE_MACRO, ATTRS) |
#define | DEF_C94_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_C11_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_C23_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_C99_COMPL_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_EXT_C99RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_BUILTIN_STUB(ENUM, NAME) |
#define | DEF_COROUTINE_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GOACC_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GOACC_BUILTIN_COMPILER(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GOACC_BUILTIN_ONLY(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_GOMP_BUILTIN_COMPILER(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_TM_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
#define | ATTR_MATHFN_ERRNO |
#define | ATTR_MATHFN_FPROUNDING |
#define | ATTR_MATHFN_FPROUNDING_ERRNO |
#define | ATTR_MATHFN_FPROUNDING_STORE ATTR_NOTHROW_LEAF_LIST |
#define | ATTR_NOTHROWCALL_LEAF_LIST |
#define | ACOSH_TYPE(F) |
#define | ATAN2_TYPE(F) |
#define | ATANH_TYPE(F) |
#define | CEIL_TYPE(F) |
#define | COPYSIGN_TYPE(F) |
#define | COSH_TYPE(F) |
#define | FABS_TYPE(F) |
#define | FDIM_TYPE(F) |
#define | FLOOR_TYPE(F) |
#define | FMA_TYPE(F) |
#define | FMAX_TYPE(F) |
#define | FMIN_TYPE(F) |
#define | FREXP_TYPE(F) |
#define | HUGE_VAL_TYPE(F) |
#define | HYPOT_TYPE(F) |
#define | ILOGB_TYPE(F) |
#define | INF_TYPE(F) |
#define | LDEXP_TYPE(F) |
#define | LGAMMA_TYPE(F) |
#define | LLRINT_TYPE(F) |
#define | LOG10_TYPE(F) |
#define | LRINT_TYPE(F) |
#define | MODF_TYPE(F) |
#define | NAN_TYPE(F) |
#define | NEARBYINT_TYPE(F) |
#define | NEXTAFTER_TYPE(F) |
#define | REMQUO_TYPE(F) |
#define | RINT_TYPE(F) |
#define | ROUND_TYPE(F) |
#define | ROUNDEVEN_TYPE(F) |
#define | SCALBLN_TYPE(F) |
#define | SCALBN_TYPE(F) |
#define | SINH_TYPE(F) |
#define | SQRT_TYPE(F) |
#define | TRUNC_TYPE(F) |
#define | CABS_TYPE(F) |
#define | CACOSH_TYPE(F) |
#define | CARG_TYPE(F) |
#define | CASINH_TYPE(F) |
#define | CPOW_TYPE(F) |
#define | CPROJ_TYPE(F) |
#define | saved_apply_args_size (delta_type<int> (this_target_builtins->x_apply_args_size_plus_one, -1)) |
#define | apply_args_mode (this_target_builtins->x_apply_args_mode) |
#define | saved_apply_result_size (delta_type<int> (this_target_builtins->x_apply_result_size_plus_one, -1)) |
#define | apply_result_mode (this_target_builtins->x_apply_result_mode) |
#define | CASE_MATHFN(MATHFN) |
#define | CASE_MATHFN_FLOATN(MATHFN) |
#define | CASE_MATHFN_REENT(MATHFN) |
#define | SEQ_OF_CASE_MATHFN |
#define | CASE_MATHFN(MATHFN) |
#define | CASE_MATHFN_FLOATN(MATHFN) |
#define | CASE_MATHFN_REENT(MATHFN) |
#define | DEF_INTERNAL_FLT_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_FLT_FLOATN_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_INT_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_OPTAB_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_SIGNED_OPTAB_FN(NAME, FLAGS, SELECTOR, SIGNED_OPTAB, UNSIGNED_OPTAB, TYPE) |
#define | DEF_INTERNAL_INT_EXT_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_WIDENING_OPTAB_FN(NAME, FLAGS, SELECTOR, SOPTAB, UOPTAB, TYPE) |
#define | DEF_INTERNAL_COND_FN(NAME, FLAGS, OPTAB, TYPE) |
#define | DEF_INTERNAL_SIGNED_COND_FN(NAME, FLAGS, SELECTOR, SIGNED_OPTAB, UNSIGNED_OPTAB, TYPE) |
#define | STACK_TOPS GT |
#define | STACK_UNSIGNED true |
Variables | |
struct target_builtins | default_target_builtins |
const char *const | built_in_class_names [BUILT_IN_LAST] = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"} |
const char * | built_in_names [(int) END_BUILTINS] |
builtin_info_type | builtin_info [(int) END_BUILTINS] |
bool | force_folding_builtin_constant_p |
unsigned HOST_WIDE_INT | target_newline |
unsigned HOST_WIDE_INT | target_percent |
static unsigned HOST_WIDE_INT | target_c |
static unsigned HOST_WIDE_INT | target_s |
char | target_percent_c [3] |
char | target_percent_s [3] |
char | target_percent_s_newline [4] |
static alias_set_type | setjmp_alias_set = -1 |
#define ACOSH_TYPE | ( | F | ) |
#define apply_args_mode (this_target_builtins->x_apply_args_mode) |
Referenced by apply_args_size(), expand_builtin_apply(), and expand_builtin_apply_args_1().
#define apply_result_mode (this_target_builtins->x_apply_result_mode) |
Referenced by apply_result_size(), expand_builtin_apply(), expand_builtin_return(), and result_vector().
#define ATAN2_TYPE | ( | F | ) |
#define ATANH_TYPE | ( | F | ) |
#define ATTR_MATHFN_ERRNO |
#define ATTR_MATHFN_FPROUNDING |
#define ATTR_MATHFN_FPROUNDING_ERRNO |
#define ATTR_MATHFN_FPROUNDING_STORE ATTR_NOTHROW_LEAF_LIST |
#define ATTR_NOTHROWCALL_LEAF_LIST |
#define CABS_TYPE | ( | F | ) |
#define CACOSH_TYPE | ( | F | ) |
#define CARG_TYPE | ( | F | ) |
#define CASE_MATHFN | ( | MATHFN | ) |
This helper macro, meant to be used in mathfn_built_in below, determines which among a set of builtin math functions is appropriate for a given type mode. The `F' (float) and `L' (long double) are automatically generated from the 'double' case. If a function supports the _Float<N> and _Float<N>X types, there are additional types that are considered with 'F32', 'F64', 'F128', etc. suffixes.
#define CASE_MATHFN | ( | MATHFN | ) |
This helper macro, meant to be used in mathfn_built_in below, determines which among a set of builtin math functions is appropriate for a given type mode. The `F' (float) and `L' (long double) are automatically generated from the 'double' case. If a function supports the _Float<N> and _Float<N>X types, there are additional types that are considered with 'F32', 'F64', 'F128', etc. suffixes.
#define CASE_MATHFN_FLOATN | ( | MATHFN | ) |
Similar to the above, but also add support for the _Float<N> and _Float<N>X types.
#define CASE_MATHFN_FLOATN | ( | MATHFN | ) |
Similar to the above, but also add support for the _Float<N> and _Float<N>X types.
#define CASE_MATHFN_REENT | ( | MATHFN | ) |
Similar to above, but appends _R after any F/L suffix.
#define CASE_MATHFN_REENT | ( | MATHFN | ) |
Similar to above, but appends _R after any F/L suffix.
#define CASINH_TYPE | ( | F | ) |
#define CEIL_TYPE | ( | F | ) |
#define COPYSIGN_TYPE | ( | F | ) |
#define COSH_TYPE | ( | F | ) |
#define CPOW_TYPE | ( | F | ) |
#define CPROJ_TYPE | ( | F | ) |
#define DEF_INTERNAL_COND_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_FLT_FLOATN_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_FLT_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_INT_EXT_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_INT_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_OPTAB_FN | ( | NAME, | |
FLAGS, | |||
OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_SIGNED_COND_FN | ( | NAME, | |
FLAGS, | |||
SELECTOR, | |||
SIGNED_OPTAB, | |||
UNSIGNED_OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_SIGNED_OPTAB_FN | ( | NAME, | |
FLAGS, | |||
SELECTOR, | |||
SIGNED_OPTAB, | |||
UNSIGNED_OPTAB, | |||
TYPE ) |
#define DEF_INTERNAL_WIDENING_OPTAB_FN | ( | NAME, | |
FLAGS, | |||
SELECTOR, | |||
SOPTAB, | |||
UOPTAB, | |||
TYPE ) |
#define FABS_TYPE | ( | F | ) |
#define FDIM_TYPE | ( | F | ) |
#define FLOOR_TYPE | ( | F | ) |
#define FMA_TYPE | ( | F | ) |
#define FMAX_TYPE | ( | F | ) |
#define FMIN_TYPE | ( | F | ) |
#define FREXP_TYPE | ( | F | ) |
#define HUGE_VAL_TYPE | ( | F | ) |
#define HYPOT_TYPE | ( | F | ) |
#define ILOGB_TYPE | ( | F | ) |
#define INF_TYPE | ( | F | ) |
#define LDEXP_TYPE | ( | F | ) |
#define LGAMMA_TYPE | ( | F | ) |
#define LLRINT_TYPE | ( | F | ) |
#define LOG10_TYPE | ( | F | ) |
#define LRINT_TYPE | ( | F | ) |
#define MODF_TYPE | ( | F | ) |
#define NAN_TYPE | ( | F | ) |
#define NEARBYINT_TYPE | ( | F | ) |
#define NEXTAFTER_TYPE | ( | F | ) |
#define REMQUO_TYPE | ( | F | ) |
#define RINT_TYPE | ( | F | ) |
#define ROUND_TYPE | ( | F | ) |
#define ROUNDEVEN_TYPE | ( | F | ) |
#define saved_apply_args_size (delta_type<int> (this_target_builtins->x_apply_args_size_plus_one, -1)) |
Referenced by apply_args_size().
#define saved_apply_result_size (delta_type<int> (this_target_builtins->x_apply_result_size_plus_one, -1)) |
Referenced by apply_result_size().
#define SCALBLN_TYPE | ( | F | ) |
#define SCALBN_TYPE | ( | F | ) |
#define SEQ_OF_CASE_MATHFN |
Referenced by mathfn_built_in_2(), and mathfn_built_in_type().
#define SINH_TYPE | ( | F | ) |
#define SQRT_TYPE | ( | F | ) |
#define STACK_TOPS GT |
Referenced by expand_builtin_strub_update().
#define STACK_UNSIGNED true |
Referenced by expand_builtin_stack_address(), expand_builtin_strub_leave(), and expand_builtin_strub_update().
#define TRUNC_TYPE | ( | F | ) |
|
static |
Return the size required for the block returned by __builtin_apply_args, and initialize apply_args_mode.
References apply_args_mode, as_a(), CEIL, cfun, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), saved_apply_args_size, targetm, and TREE_TYPE.
Referenced by expand_builtin_apply(), and expand_builtin_apply_args_1().
|
static |
Return the size required for the block returned by __builtin_apply, and initialize apply_result_mode.
References apply_result_mode, as_a(), CEIL, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), saved_apply_result_size, and targetm.
Referenced by expand_builtin_apply(), and expand_builtin_return().
|
static |
Check whether there is an internal function associated with function FN and return type RETURN_TYPE. Return the function if so, otherwise return IFN_LAST. Note that this function only tests whether the function is defined in internals.def, not whether it is actually available on the target.
Internal functions. Copyright (C) 2011-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This file specifies a list of internal "functions". These functions differ from built-in functions in that they have no linkage and cannot be called directly by the user. They represent operations that are only synthesised by GCC itself. Internal functions are used instead of tree codes if the operation and its operands are more naturally represented as a GIMPLE_CALL than a GIMPLE_ASSIGN. Each entry in this file has one of the forms: DEF_INTERNAL_FN (NAME, FLAGS, FNSPEC) DEF_INTERNAL_OPTAB_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_SIGNED_OPTAB_FN (NAME, FLAGS, SELECTOR, SIGNED_OPTAB, UNSIGNED_OPTAB, TYPE) DEF_INTERNAL_FLT_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_FLT_FLOATN_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_INT_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_INT_EXT_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_COND_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_SIGNED_COND_FN (NAME, FLAGS, OPTAB, TYPE) DEF_INTERNAL_WIDENING_OPTAB_FN (NAME, FLAGS, SELECTOR, SOPTAB, UOPTAB, TYPE) where NAME is the name of the function, FLAGS is a set of ECF_* flags and FNSPEC is a string describing functions fnspec. DEF_INTERNAL_OPTAB_FN defines an internal function that maps to a direct optab. The function should only be called with a given set of types if the associated optab is available for the modes of those types. OPTAB says what optab to use (without the trailing "_optab") and TYPE categorizes the optab based on its inputs and outputs. The possible types of optab are: - mask_load: currently just maskload - load_lanes: currently just vec_load_lanes - mask_load_lanes: currently just vec_mask_load_lanes - mask_len_load_lanes: currently just vec_mask_len_load_lanes - gather_load: used for {mask_,mask_len_,}gather_load - len_load: currently just len_load - mask_len_load: currently just mask_len_load - mask_store: currently just maskstore - store_lanes: currently just vec_store_lanes - mask_store_lanes: currently just vec_mask_store_lanes - mask_len_store_lanes: currently just vec_mask_len_store_lanes - scatter_store: used for {mask_,mask_len_,}scatter_store - len_store: currently just len_store - mask_len_store: currently just mask_len_store - unary: a normal unary optab, such as vec_reverse_<mode> - binary: a normal binary optab, such as vec_interleave_lo_<mode> - ternary: a normal ternary optab, such as fma<mode>4 - unary_convert: a single-input conversion optab, such as lround<srcmode><dstmode>2. - cond_binary: a conditional binary optab, such as cond_add<mode> - cond_unary: a conditional unary optab, such as cond_neg<mode> - cond_ternary: a conditional ternary optab, such as cond_fma_rev<mode> - fold_left: for scalar = FN (scalar, vector), keyed off the vector mode - check_ptrs: used for check_{raw,war}_ptrs - cond_len_unary: a conditional unary optab, such as cond_len_neg<mode> - cond_len_binary: a conditional binary optab, such as cond_len_add<mode> - cond_len_ternary: a conditional ternary optab, such as cond_len_fma_rev<mode> DEF_INTERNAL_SIGNED_OPTAB_FN defines an internal function that maps to one of two optabs, depending on the signedness of an input. SIGNED_OPTAB and UNSIGNED_OPTAB are the optabs for signed and unsigned inputs respectively, both without the trailing "_optab". SELECTOR says which type in the tree_pair determines the signedness. DEF_INTERNAL_FLT_FN is like DEF_INTERNAL_OPTAB_FN, but in addition, the function implements the computational part of a built-in math function BUILT_IN_<NAME>{F,,L}. Unlike some built-in functions, these internal functions never set errno. DEF_INTERNAL_INT_FN is like DEF_INTERNAL_OPTAB_FN, but in addition says that the function extends the C-level BUILT_IN_<NAME>{,L,LL,IMAX} group of functions to any integral mode (including vector modes). DEF_INTERNAL_INT_EXT_FN is like DEF_INTERNAL_INT_FN, except that it has expand_##NAME defined in internal-fn.cc to override the DEF_INTERNAL_INT_FN expansion behavior. DEF_INTERNAL_WIDENING_OPTAB_FN is a wrapper that defines five internal functions with DEF_INTERNAL_SIGNED_OPTAB_FN: - one that describes a widening operation with the same number of elements in the output and input vectors, - two that describe a pair of high-low widening operations where the output vectors each have half the number of elements of the input vectors, corresponding to the result of the widening operation on the top half and bottom half, these have the suffixes _HI and _LO, - and two that describe a pair of even-odd widening operations where the output vectors each have half the number of elements of the input vectors, corresponding to the result of the widening operation on the even and odd elements, these have the suffixes _EVEN and _ODD. These five internal functions will require two optabs each, a SIGNED_OPTAB and an UNSIGNED_OTPAB. DEF_INTERNAL_COND_FN is a wrapper that defines 2 internal functions with DEF_INTERNAL_OPTAB_FN: - One is COND_* operations that are predicated by mask only. Such operations make sense for both vectors and scalars. - The other is COND_LEN_* operations that are predicated by mask and len both. Such operations only make sense for vectors. DEF_INTERNAL_SIGNED_COND_FN is like DEF_INTERNAL_COND_FN but defines intenal functions with DEF_INTERNAL_SIGNED_OPTAB_FN. Each entry must have a corresponding expander of the form: void expand_NAME (gimple_call stmt) where STMT is the statement that performs the call. These are generated automatically for optab functions and call out to a function or macro called expand_<TYPE>_optab_fn.
Extract the last active element from a vector.
Same, but return the first argument if no elements are active.
Unary math functions.
Floating-point to integer conversions. ??? Here we preserve the I/L/LL prefix convention from the corresponding built-in functions, rather than make the internal functions polymorphic in both the argument and the return types. Perhaps an alternative would be to pass a zero of the required return type as a second parameter.
FP rounding.
Binary math functions.
FP scales.
Ternary math functions.
Unary integer ops.
An unduplicable, uncombinable function. Generally used to preserve a CFG property in the face of jump threading, tail merging or other such optimizations. The first argument distinguishes between uses. See internal-fn.h for usage.
A function to represent an artifical initialization to an uninitialized automatic variable.
A function to associate the access size and access mode information with the corresponding reference to an object. It only reads from the 2nd argument.
DIM_SIZE and DIM_POS return the size of a particular compute dimension and the executing thread's position within that dimension. DIM_POS is pure (and not const) so that it isn't thought to clobber memory and can be gcse'd within a single parallel region, but not across FORK/JOIN boundaries. They take a single INTEGER_CST argument. This might be overly conservative.
OpenACC looping abstraction. See internal-fn.h for usage.
OpenACC reduction abstraction. See internal-fn.h for usage.
Openacc tile abstraction. Describes the spans of the element loop. GOACC_TILE (num-loops, loop-no, tile-arg, tile-mask, element-mask).
Set errno to EDOM, if GCC knows how to do that directly for the current target.
Atomic functions. These don't have ECF_NOTHROW because for -fnon-call-exceptions they can throw, otherwise we set gimple_call_nothrow_p on it.
To implement [[fallthrough]]. If the TREE_NOTHROW or GF_CALL_NOTHROW flag is set on the call (normally redundant with ECF_NOTHROW), it marks [[fallthrough]] at the end of C++ loop body.
To implement __builtin_launder.
Divmod function.
For coroutines.
A NOP function with arbitrary arguments and return value.
Temporary vehicle for __builtin_shufflevector.
<=> optimization.
[[assume (cond)]].
For if-conversion of inbranch SIMD clones.
_BitInt support.
Bitwise functions.
References b, CASE_FLT_FN, REAL_MODE_FORMAT, and TYPE_MODE.
Referenced by associated_internal_fn(), associated_internal_fn(), associative_binary_op_p(), canonicalize_code(), commutative_binary_op_p(), commutative_ternary_op_p(), directly_supported_p(), directly_supported_p(), first_commutative_argument(), fold_stmt_1(), get_conditional_internal_fn(), replacement_internal_fn(), and vectorizable_internal_function().
internal_fn associated_internal_fn | ( | combined_fn | cfn, |
tree | return_type ) |
Check whether there is an internal function associated with function CFN and return type RETURN_TYPE. Return the function if so, otherwise return IFN_LAST. Note that this function only tests whether the function is defined in internals.def, not whether it is actually available on the target.
References as_builtin_fn(), as_internal_fn(), associated_internal_fn(), and internal_fn_p().
internal_fn associated_internal_fn | ( | tree | fndecl | ) |
If BUILT_IN_NORMAL function FNDECL has an associated internal function, return its code, otherwise return IFN_LAST. Note that this function only tests whether the function is defined in internals.def, not whether it is actually available on the target.
References associated_internal_fn(), BUILT_IN_NORMAL, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), gcc_checking_assert, and TREE_TYPE.
Return true if FNDECL shouldn't be folded right now. If a built-in function has an inline attribute always_inline wrapper, defer folding it after always_inline functions have been inlined, otherwise e.g. -D_FORTIFY_SOURCE checking might not be performed.
References cfun, DECL_ATTRIBUTES, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, and lookup_attribute().
Referenced by fold_builtin_call_array(), fold_call_expr(), fold_call_stmt(), and gimple_fold_builtin().
|
static |
Create builtin_expect or builtin_expect_with_probability with PRED and EXPECTED as its arguments and return it as a truthvalue. Fortran FE can also produce builtin_expect with PREDICTOR as third argument. builtin_expect_with_probability instead uses third argument as PROBABILITY value.
References build2(), build_call_expr_loc(), build_int_cst(), builtin_decl_explicit(), fold_convert_loc(), NULL_TREE, TREE_CHAIN, TREE_TYPE, TREE_VALUE, and TYPE_ARG_TYPES.
Referenced by fold_builtin_expect().
Conveniently construct a function call expression. FNDECL names the function to be called, N is the number of arguments, and the "..." parameters are the argument expressions. Unlike build_call_exr this doesn't fold the call, hence it will always return a CALL_EXPR.
References ap, build1(), build_call_valist(), build_pointer_type(), SET_EXPR_LOCATION, and TREE_TYPE.
Referenced by expand_builtin_int_roundingfn(), expand_builtin_int_roundingfn_2(), expand_builtin_memory_chk(), expand_builtin_memset_args(), expand_builtin_stpcpy_1(), expand_builtin_strcmp(), and expand_builtin_strncmp().
attr_fnspec builtin_fnspec | ( | tree | callee | ) |
If CALLEE has known side effects, fill in INFO and return true. See tree-ssa-structalias.cc:find_func_aliases for the list of builtins we might need to handle here.
References CASE_BUILT_IN_ALLOCA, CASE_BUILT_IN_TM_LOAD, CASE_BUILT_IN_TM_STORE, and DECL_FUNCTION_CODE().
Referenced by decl_fnspec(), and gimple_call_fnspec().
enum built_in_function builtin_mathfn_code | ( | const_tree | t | ) |
Determine whether a tree node represents a call to a built-in function. If the tree T is a call to a built-in function with the right number of arguments of the appropriate types, return the DECL_FUNCTION_CODE of the call, e.g. BUILT_IN_SQRT. Otherwise the return value is END_BUILTINS.
References BUILT_IN_NORMAL, COMPLEX_FLOAT_TYPE_P, DECL_FUNCTION_CODE(), END_BUILTINS, fndecl_built_in_p(), get_callee_fndecl(), INTEGRAL_TYPE_P, more_const_call_expr_args_p(), NULL_TREE, POINTER_TYPE_P, SCALAR_FLOAT_TYPE_P, TREE_CHAIN, TREE_CODE, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and VOID_TYPE_P.
Referenced by convert_to_integer_1(), and convert_to_real_1().
|
static |
Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) bytes from bytes at DATA + OFFSET and return it reinterpreted as a target constant.
References c_readstr(), expand_operand::mode, and offset.
Referenced by expand_builtin_memcmp(), and expand_builtin_memory_copy_args().
|
static |
Callback routine for store_by_pieces. Return the RTL of a register containing GET_MODE_SIZE (MODE) consecutive copies of the unsigned char value given in the RTL register data. For example, if mode is 4 bytes wide, return the RTL for 0x01010101*data. If PREV isn't nullptr, it has the RTL info from the previous iteration.
References c_readstr(), convert_to_mode(), create_input_operand(), create_output_operand(), emit_move_insn(), expand_insn(), expand_mult(), force_reg(), gcc_assert, gen_memset_value_from_prev(), gen_reg_rtx(), GET_MODE_INNER, GET_MODE_SIZE(), expand_operand::mode, NULL_RTX, optab_handler(), rtx_equal_p(), expand_operand::target, expand_operand::value, and VECTOR_MODE_P.
Referenced by expand_builtin_memset_args(), and try_store_by_multiple_pieces().
rtx builtin_memset_read_str | ( | void * | data, |
void * | prev, | ||
HOST_WIDE_INT | offset, | ||
fixed_size_mode | mode ) |
Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) bytes from constant string DATA + OFFSET and return it as target constant. If PREV isn't nullptr, it has the RTL info from the previous iteration.
References c_readstr(), emit_move_insn(), gcc_assert, gen_const_vec_duplicate(), gen_int_mode(), gen_memset_value_from_prev(), gen_reg_rtx(), GET_MODE_INNER, GET_MODE_SIZE(), expand_operand::mode, NULL, expand_operand::target, and VECTOR_MODE_P.
Referenced by asan_emit_stack_protection(), clear_by_pieces(), expand_builtin_memset_args(), gimple_stringops_transform(), and try_store_by_multiple_pieces().
Similar to save_expr, but assumes that arbitrary code is not executed in between the multiple evaluations. In particular, we assume that a non-addressable local variable will not be modified.
References exp(), save_expr(), TREE_ADDRESSABLE, TREE_CODE, TREE_STATIC, and VAR_P.
Referenced by expand_builtin_fabs(), expand_builtin_int_roundingfn(), expand_builtin_int_roundingfn_2(), expand_builtin_interclass_mathfn(), expand_builtin_mathfn_3(), expand_builtin_mathfn_ternary(), expand_builtin_memset_args(), expand_builtin_signbit(), expand_builtin_strcmp(), fold_builtin_carg(), fold_builtin_classify(), fold_builtin_fpclassify(), fold_builtin_interclass_mathfn(), fold_builtin_iseqsig(), and fold_builtin_sincos().
rtx builtin_strncpy_read_str | ( | void * | data, |
void * | , | ||
HOST_WIDE_INT | offset, | ||
fixed_size_mode | mode ) |
Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) bytes from constant string DATA + OFFSET and return it as target constant.
References c_readstr(), const0_rtx, expand_operand::mode, and offset.
Referenced by expand_builtin_strncpy(), and simplify_builtin_call().
Return true if the builtin DECL is implemented in a standard library. Otherwise return false which doesn't guarantee it is not (thus the list of handled builtins below may be incomplete).
References BUILT_IN_NORMAL, CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, DECL_BUILT_IN_CLASS, and DECL_FUNCTION_CODE().
Referenced by symtab_node::output_to_lto_symbol_table_p().
rtx c_readstr | ( | const char * | str, |
fixed_size_mode | mode, | ||
bool | null_terminated_p ) |
Return a constant integer corresponding to target reading GET_MODE_BITSIZE (MODE) bits from string constant STR. If NULL_TERMINATED_P, reading stops after '\0' character, all further ones are assumed to be zero, otherwise it reads as many characters as needed.
References GET_MODE_SIZE(), i, and native_decode_rtx().
Referenced by builtin_memcpy_read_str(), builtin_memset_gen_str(), builtin_memset_read_str(), builtin_strncpy_read_str(), inline_string_cmp(), and string_cst_read_str().
tree c_strlen | ( | tree | arg, |
int | only_value, | ||
c_strlen_data * | data, | ||
unsigned | eltsize ) |
Compute the length of a null-terminated character string or wide character string handling character sizes of 1, 2, and 4 bytes. TREE_STRING_LENGTH is not the right way because it evaluates to the size of the character array in bytes (as opposed to characters) and because it can contain a zero byte in the middle. ONLY_VALUE should be nonzero if the result is not going to be emitted into the instruction stream and zero if it is going to be expanded. E.g. with i++ ? "foo" : "bar", if ONLY_VALUE is nonzero, constant 3 is returned, otherwise NULL, since len = c_strlen (ARG, 1); if (len) expand_expr (len, ...); would not evaluate the side-effects. If ONLY_VALUE is two then we do not emit warnings about out-of-bound accesses. Note that this implies the result is not going to be emitted into the instruction stream. Additional information about the string accessed may be recorded in DATA. For example, if ARG references an unterminated string, then the declaration will be stored in the DECL field. If the length of the unterminated string can be determined, it'll be stored in the LEN field. Note this length could well be different than what a C strlen call would return. ELTSIZE is 1 for normal single byte character strings, and 2 or 4 for wide characer strings. ELTSIZE is by default 1. The value returned is of type `ssizetype'.
References boolean_type_node, build_zero_cst(), c_strlen(), DECL_SOURCE_LOCATION, EXPR_LOC_OR_LOC, fold_build2_loc(), fold_build3_loc(), fold_convert_loc(), gcc_checking_assert, inform(), input_location, NULL_TREE, save_expr(), size_int, sizetype, ssize_int, ssizetype, string_constant(), string_length(), STRIP_NOPS, suppress_warning(), TREE_CODE, tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_uhwi(), TREE_TYPE, TYPE_SIZE_UNIT, warning_at(), and warning_suppressed_p().
Referenced by c_strlen(), expand_builtin_stpcpy_1(), expand_builtin_strcmp(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_builtin_strnlen(), fold_builtin_strlen(), get_range_strlen_tree(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_sprintf_chk(), gimple_fold_builtin_stpcpy(), gimple_fold_builtin_strncat(), gimple_fold_builtin_strncat_chk(), gimple_fold_builtin_stxcpy_chk(), maybe_emit_sprintf_chk_warning(), strdup_object_size(), and unterminated_array().
Return true if NODE should be considered for inline expansion regardless of the optimization level. This means whenever a function is invoked with its "internal" name, which normally contains the prefix "__builtin".
References DECL_NAME, IDENTIFIER_POINTER, and is_builtin_name().
Referenced by expand_builtin(), and expand_call_stmt().
|
static |
Check that store_by_pieces allows BITS + LEN (so that we don't expand something too unreasonably long), and every power of 2 in BITS. It is assumed that LEN has already been tested by itself.
References can_store_by_pieces().
Referenced by try_store_by_multiple_pieces().
Helper to check the sizes of sequences and the destination of calls to __builtin_strncat and __builtin___strncat_chk. Returns true on success (no overflow or invalid sizes), false otherwise.
References access_read_write, CALL_EXPR_ARG, check_access(), compute_objsize(), exp(), EXPR_LOCATION, fold_build2, get_callee_fndecl(), get_range_strlen(), c_strlen_data::minlen, NULL_TREE, size_one_node, size_type_node, tree_fits_uhwi_p(), tree_int_cst_equal(), tree_int_cst_lt(), and warning_at().
Referenced by maybe_emit_chk_warning().
Emit a call to __builtin___clear_cache.
References begin(), BUILTIN_ASM_NAME_PTR, convert_memory_address, emit_library_call(), end(), LCT_NORMAL, and ptr_mode.
Default target-specific builtin expander that does nothing.
References NULL_RTX.
|
static |
LEN specify length of the block of memcpy/memset operation. Figure out its range and put it into MIN_SIZE/MAX_SIZE. In some cases we can make very likely guess on max size, then we set it into PROBABLE_MAX_SIZE.
References CONST_INT_P, wi::fits_uhwi_p(), gcc_checking_assert, get_global_range_query(), get_legacy_range(), GET_MODE, GET_MODE_MASK, wi::leu_p(), r, range_query::range_of_expr(), wi::to_wide(), TREE_CODE, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, TYPE_MAX_VALUE, TYPE_MIN_VALUE, UINTVAL, VR_ANTI_RANGE, VR_RANGE, and VR_UNDEFINED.
Referenced by expand_builtin_memory_copy_args(), and expand_builtin_memset_args().
tree do_mpc_arg2 | ( | tree | arg0, |
tree | arg1, | ||
tree | type, | ||
int | do_nonfinite, | ||
int(* | func )(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t) ) |
If arguments ARG0 and ARG1 are a COMPLEX_CST, call the two-argument mpc function FUNC on it and return the resulting value as a tree with type TYPE. The mpfr precision is set to the precision of TYPE. We assume that function FUNC returns zero if the result could be calculated exactly within the requested precision. If DO_NONFINITE is true, then fold expressions containing Inf or NaN in the arguments and/or results.
References b, do_mpc_ckconv(), mpfr_from_real(), NULL_TREE, real_format::p, real_isfinite(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, real_format::round_towards_zero, SCALAR_FLOAT_TYPE_P, STRIP_NOPS, TREE_CODE, TREE_IMAGPART, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_REALPART, TREE_TYPE, and TYPE_MODE.
Referenced by const_binop().
Helper function for do_mpc_arg*(). Ensure M is a normal complex number and no overflow/underflow occurred. INEXACT is true if M was not exactly calculated. TYPE is the tree type for the result. This function assumes that you cleared the MPFR flags and then calculated M to see if anything subsequently set a flag prior to entering this function. Return NULL_TREE if any checks fail, if FORCE_CONVERT is true, then bypass the checks.
References build_complex(), build_real(), NULL_TREE, real_convert(), real_from_mpfr(), real_identical(), real_isfinite(), REAL_VALUE_TYPE, rvc_zero, TREE_TYPE, and TYPE_MODE.
Referenced by do_mpc_arg2().
Helper function for do_mpfr_arg*(). Ensure M is a normal number and no overflow/underflow occurred. INEXACT is true if M was not exactly calculated. TYPE is the tree type for the result. This function assumes that you cleared the MPFR flags and then calculated M to see if anything subsequently set a flag prior to entering this function. Return NULL_TREE if any checks fail.
References build_real(), NULL_TREE, real_convert(), real_from_mpfr(), real_identical(), real_isfinite(), REAL_VALUE_TYPE, rvc_zero, and TYPE_MODE.
Referenced by do_mpfr_lgamma_r(), and do_mpfr_remquo().
If ARG is a REAL_CST, call mpfr_lgamma() on it and return the resulting value as a tree with type TYPE. The mpfr precision is set to the precision of TYPE. We assume that this mpfr function returns zero if the result could be calculated exactly within the requested precision. In addition, the integer pointer represented by ARG_SG will be dereferenced and set to the appropriate signgam (-1,1) value.
References b, build_fold_indirect_ref, build_int_cst(), do_mpfr_ckconv(), fold_build2, integer_type_node, mpfr_from_real(), non_lvalue, NULL_TREE, real_format::p, real_isfinite(), real_isinteger(), real_isneg(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, real_format::round_towards_zero, rvc_zero, STRIP_NOPS, TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MAIN_VARIANT, and TYPE_MODE.
Referenced by fold_builtin_2().
If arguments ARG0 and ARG1 are REAL_CSTs, call mpfr_remquo() to set the pointer *(ARG_QUO) and return the result. The type is taken from the type of ARG0 and is used for setting the precision of the calculation and results.
References b, build_fold_indirect_ref, build_int_cst(), CHAR_BIT, do_mpfr_ckconv(), fold_build2, INT_TYPE_SIZE, integer_type_node, mpfr_from_real(), non_lvalue, NULL, NULL_TREE, real_format::p, real_isfinite(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, real_format::round_towards_zero, STRIP_NOPS, suppress_warning(), TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MAIN_VARIANT, and TYPE_MODE.
Referenced by fold_builtin_3().
Emit a call to __asan_allocas_unpoison call in EXP. Add to second argument of the call virtual_stack_dynamic_rtx - stack_pointer_rtx, which is the STACK_DYNAMIC_OFFSET value. See motivation for this in comment to handle_builtin_stack_restore function.
References CALL_EXPR_ARG, convert_modes(), emit_library_call_value(), exp(), expand_expr(), EXPAND_NORMAL, expand_simple_binop(), init_one_libfunc(), LCT_NORMAL, NULL_RTX, OPTAB_LIB_WIDEN, ptr_mode, stack_pointer_rtx, and virtual_stack_dynamic_rtx.
Referenced by expand_builtin().
Expand an expression EXP that calls a built-in function, with result going to TARGET if that's convenient (and in mode MODE if that's convenient). SUBTARGET may be used as the target for computing one of EXP's operands. IGNORE is nonzero if the value is to be ignored.
References AGGREGATE_TYPE_P, ALLOCA_FUNCTION_CODE_P, asan_intercepted_p(), asan_memfn_rtl(), boolean_type_node, build_call_vec(), build_fold_addr_expr, BUILT_IN_MD, builtin_decl_explicit(), CALL_EXPR_ARG, CALL_EXPR_FN, call_expr_nargs, called_as_built_in(), CASE_BUILT_IN_ALLOCA, CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, CASE_INT_FN, const0_rtx, const1_rtx, current_function_decl, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), DECL_RESULT, DECL_RTL, ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_PURE, error(), exp(), expand_asan_emit_allocas_unpoison(), expand_builtin___clear_cache(), expand_builtin_adjust_descriptor(), expand_builtin_adjust_trampoline(), expand_builtin_alloca(), expand_builtin_apply(), expand_builtin_apply_args(), expand_builtin_assume_aligned(), expand_builtin_atomic_always_lock_free(), expand_builtin_atomic_clear(), expand_builtin_atomic_compare_exchange(), expand_builtin_atomic_exchange(), expand_builtin_atomic_fetch_op(), expand_builtin_atomic_is_lock_free(), expand_builtin_atomic_load(), expand_builtin_atomic_signal_fence(), expand_builtin_atomic_store(), expand_builtin_atomic_test_and_set(), expand_builtin_atomic_thread_fence(), expand_builtin_bswap(), expand_builtin_bzero(), expand_builtin_cexpi(), expand_builtin_classify_type(), expand_builtin_compare_and_swap(), expand_builtin_copysign(), expand_builtin_dwarf_sp_column(), expand_builtin_eh_copy_values(), expand_builtin_eh_filter(), expand_builtin_eh_pointer(), expand_builtin_eh_return(), expand_builtin_eh_return_data_regno(), expand_builtin_expect(), expand_builtin_expect_with_probability(), expand_builtin_extend_pointer(), expand_builtin_extract_return_addr(), expand_builtin_fabs(), expand_builtin_feclear_feraise_except(), expand_builtin_fegetround(), expand_builtin_fork_or_exec(), expand_builtin_frame_address(), expand_builtin_frob_return_addr(), expand_builtin_goacc_parlevel_id_size(), expand_builtin_init_descriptor(), expand_builtin_init_dwarf_reg_sizes(), expand_builtin_init_trampoline(), expand_builtin_int_roundingfn(), expand_builtin_int_roundingfn_2(), expand_builtin_interclass_mathfn(), expand_builtin_issignaling(), expand_builtin_longjmp(), expand_builtin_mathfn_3(), expand_builtin_mathfn_ternary(), expand_builtin_memcmp(), expand_builtin_memcpy(), expand_builtin_memmove(), expand_builtin_memory_chk(), expand_builtin_mempcpy(), expand_builtin_memset(), expand_builtin_next_arg(), expand_builtin_nonlocal_goto(), expand_builtin_object_size(), expand_builtin_powi(), expand_builtin_prefetch(), expand_builtin_return(), expand_builtin_saveregs(), expand_builtin_set_thread_pointer(), expand_builtin_setjmp_receiver(), expand_builtin_setjmp_setup(), expand_builtin_signbit(), expand_builtin_sincos(), expand_builtin_stack_address(), expand_builtin_stpcpy(), expand_builtin_strcmp(), expand_builtin_strcpy(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_builtin_strnlen(), expand_builtin_strub_enter(), expand_builtin_strub_leave(), expand_builtin_strub_update(), expand_builtin_sync_lock_release(), expand_builtin_sync_lock_test_and_set(), expand_builtin_sync_operation(), expand_builtin_sync_synchronize(), expand_builtin_thread_pointer(), expand_builtin_trap(), expand_builtin_unop(), expand_builtin_unreachable(), expand_builtin_unwind_init(), expand_builtin_update_setjmp_buf(), expand_builtin_va_copy(), expand_builtin_va_end(), expand_builtin_va_start(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_normal(), expand_speculation_safe_value(), expand_stack_restore(), expand_stack_save(), flags_from_decl_or_type(), fold_builtin_next_arg(), FOR_EACH_CALL_EXPR_ARG, FORCED_LABEL, gcc_assert, gcc_fallthrough, gcc_unreachable, gen_reg_rtx(), gen_rtx_INSN_LIST(), get_builtin_sync_mode(), get_callee_fndecl(), i, ILSOP_MEMCMP, ILSOP_MEMCPY, ILSOP_MEMMOVE, ILSOP_MEMSET, label_rtx(), maybe_emit_chk_warning(), maybe_emit_sprintf_chk_warning(), MEM_P, expand_operand::mode, nonlocal_goto_handler_labels, register_operand(), SANITIZE_ADDRESS, sanitize_flags_p(), SANITIZE_HWADDRESS, SANITIZE_KERNEL_ADDRESS, SANITIZE_KERNEL_HWADDRESS, expand_operand::target, targetm, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_MODE, validate_arglist(), expand_operand::value, vec_alloc(), virtual_cfa_rtx, and XEXP.
Referenced by expand_expr_real_1(), expand_ifn_atomic_bit_test_and(), and expand_ifn_atomic_op_fetch_cmp_0().
|
static |
Expand a call to __builtin___clear_cache.
References begin(), CALL_EXPR_ARG, end(), error(), exp(), expand_expr(), EXPAND_NORMAL, maybe_emit_call_builtin___clear_cache(), NULL_RTX, and validate_arglist().
Referenced by expand_builtin().
Expand a call to the builtin descriptor adjustment routine.
References CALL_EXPR_ARG, exp(), expand_normal(), force_operand(), NULL_RTX, plus_constant(), ptr_mode, targetm, and validate_arglist().
Referenced by expand_builtin().
References CALL_EXPR_ARG, exp(), expand_normal(), NULL_RTX, round_trampoline_addr(), targetm, and validate_arglist().
Referenced by expand_builtin().
Expand EXP, a call to the alloca builtin. Return NULL_RTX if we failed and the caller should emit a normal call.
References allocate_dynamic_stack_space(), CALL_ALLOCA_FOR_VAR_P, CALL_EXPR_ARG, CALLGRAPH_INFO_DYNAMIC_ALLOC, convert_memory_address, DECL_FUNCTION_CODE(), exp(), expand_normal(), get_callee_fndecl(), NULL_RTX, ptr_mode, record_dynamic_alloc(), TREE_INT_CST_LOW, and validate_arglist().
Referenced by expand_builtin().
Perform an untyped call and save the state required to perform an untyped return of whatever value was returned by the given function.
References add_function_usage_to(), add_reg_note(), adjust_address, allocate_dynamic_stack_space(), apply_args_mode, apply_args_size(), apply_result_mode, apply_result_size(), assign_stack_local(), BLOCK_OP_NORMAL, CALL_P, CEIL, cfun, const0_rtx, CONST_INT_P, convert_memory_address, copy_addr_to_reg(), crtl, do_pending_stack_adjust(), emit_block_move(), emit_insn(), emit_move_insn(), emit_stack_restore(), emit_stack_save(), expand_simple_binop(), fixup_args_size_notes(), gcc_assert, gcc_unreachable, gen_reg_rtx(), gen_rtx_MEM(), gen_rtx_REG(), GET_CODE, get_last_insn(), GET_MODE, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), INTVAL, last_call_insn(), memory_address, negate_rtx(), NEXT_INSN(), NO_DEFER_POP, NULL, NULL_RTX, OK_DEFER_POP, OPTAB_LIB_WIDEN, plus_constant(), prepare_call_address(), ptr_mode, REG_P, result_vector(), SAVE_BLOCK, SAVE_NONLOCAL, set_mem_align(), STACK_GROWS_DOWNWARD, SUPPORTS_STACK_ALIGNMENT, targetm, TREE_TYPE, use_reg(), virtual_outgoing_args_rtx, and XEXP.
Referenced by expand_builtin().
|
static |
__builtin_apply_args returns block of memory allocated on the stack into which is stored the arg pointer, structure value address, static chain, and all the registers that might possibly be used in performing a function call. The code is moved to the start of the function so the incoming values are saved.
References apply_args_value, crtl, emit_insn_before(), end_sequence(), entry_of_function(), expand_builtin_apply_args_1(), get_insns(), LAST_VIRTUAL_REGISTER, NEXT_INSN(), parm_birth_insn, pop_topmost_sequence(), push_topmost_sequence(), REG_P, REGNO, and start_sequence().
Referenced by expand_builtin().
|
static |
Save the state required to perform an untyped call with the same arguments as were passed to the current function.
References adjust_address, apply_args_mode, apply_args_size(), assign_stack_local(), CEIL, cfun, copy_addr_to_reg(), copy_to_reg(), crtl, emit_move_insn(), force_operand(), gen_rtx_REG(), GET_MODE_ALIGNMENT, GET_MODE_SIZE(), INCOMING_REGNO, NULL_RTX, plus_constant(), STACK_GROWS_DOWNWARD, targetm, TREE_TYPE, and XEXP.
Referenced by expand_builtin_apply_args().
Expand a call to __builtin_assume_aligned. We just return our first argument as the builtin_assume_aligned semantic should've been already executed by CCP.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, gcc_assert, expand_operand::target, and TREE_SIDE_EFFECTS.
Referenced by expand_builtin().
Return true if the parameters to call EXP represent an object which will always generate lock free instructions. The first argument represents the size of the object, and the second parameter is a pointer to the object itself. If NULL is passed for the object, then the result is based on typical alignment for an object of the specified size. Otherwise return false.
References boolean_true_node, CALL_EXPR_ARG, const0_rtx, const1_rtx, error(), exp(), fold_builtin_atomic_always_lock_free(), and TREE_CODE.
Referenced by expand_builtin().
Expand an atomic clear operation. void _atomic_clear (BOOL *obj, enum memmodel) EXP is the call expression.
References BOOL_TYPE_SIZE, CALL_EXPR_ARG, const0_rtx, emit_move_insn(), exp(), expand_atomic_store(), get_builtin_sync_mem(), get_memmodel(), int_mode_for_size(), is_mm_acq_rel(), is_mm_acquire(), is_mm_consume(), MEMMODEL_SEQ_CST, expand_operand::mode, and opt_mode< T >::require().
Referenced by expand_builtin().
|
static |
Expand the __atomic_compare_exchange intrinsic: bool __atomic_compare_exchange (TYPE *object, TYPE *expect, TYPE desired, BOOL weak, enum memmodel success, enum memmodel failure) EXP is the CALL_EXPR. TARGET is an optional place for us to store the results.
References CALL_EXPR_ARG, const0_rtx, convert_memory_address, emit_cmp_and_jump_insns(), emit_label(), emit_move_insn(), exp(), expand_atomic_compare_and_swap(), expand_expr_force_mode(), expand_normal(), failure, gen_label_rtx(), gen_rtx_MEM(), get_builtin_sync_mem(), get_memmodel(), GET_MODE, is_mm_acq_rel(), is_mm_release(), MEMMODEL_SEQ_CST, NULL, NULL_RTX, tree_fits_shwi_p(), and tree_to_shwi().
Referenced by expand_builtin().
Expand the __atomic_exchange intrinsic: TYPE __atomic_exchange (TYPE *object, TYPE desired, enum memmodel) EXP is the CALL_EXPR. TARGET is an optional place for us to store the results.
References CALL_EXPR_ARG, exp(), expand_atomic_exchange(), expand_expr_force_mode(), get_builtin_sync_mem(), get_memmodel(), and NULL_RTX.
Referenced by expand_builtin().
|
static |
Expand the __atomic_fetch_XXX intrinsic: TYPE __atomic_fetch_XXX (TYPE *object, TYPE val, enum memmodel) EXP is the CALL_EXPR. TARGET is an optional place for us to store the results. CODE is the operation, PLUS, MINUS, ADD, XOR, or IOR. FETCH_AFTER is true if returning the result of the operation. FETCH_AFTER is false if returning the value before the operation. IGNORE is true if the result is not used. EXT_CALL is the correct builtin for an external call if this cannot be resolved to an instruction sequence.
References builtin_decl_explicit(), CALL_EXPR_ARG, CALL_EXPR_FN, CALL_EXPR_TAILCALL, exp(), expand_atomic_fetch_op(), expand_call(), expand_expr_force_mode(), expand_simple_binop(), expand_simple_unop(), gcc_assert, get_builtin_sync_mem(), get_callee_fndecl(), get_memmodel(), NULL_RTX, OPTAB_LIB_WIDEN, STRIP_NOPS, and TREE_OPERAND.
Referenced by expand_builtin().
Return true if the parameters to call EXP represent an object which will always generate lock free instructions. The first argument represents the size of the object, and the second parameter is a pointer to the object itself. If NULL is passed for the object, then the result is based on typical alignment for an object of the specified size. Otherwise return NULL
References boolean_true_node, CALL_EXPR_ARG, const1_rtx, error(), exp(), fold_builtin_atomic_is_lock_free(), INTEGRAL_TYPE_P, NULL_RTX, and TREE_TYPE.
Referenced by expand_builtin().
Expand the __atomic_load intrinsic: TYPE __atomic_load (TYPE *object, enum memmodel) EXP is the CALL_EXPR. TARGET is an optional place for us to store the results.
References CALL_EXPR_ARG, exp(), expand_atomic_load(), get_builtin_sync_mem(), get_memmodel(), is_mm_acq_rel(), is_mm_release(), MEMMODEL_SEQ_CST, and NULL_RTX.
Referenced by expand_builtin().
|
static |
Expand the __atomic_signal_fence intrinsic: void __atomic_signal_fence (enum memmodel) EXP is the CALL_EXPR.
References CALL_EXPR_ARG, exp(), expand_mem_signal_fence(), and get_memmodel().
Referenced by expand_builtin().
Expand the __atomic_store intrinsic: void __atomic_store (TYPE *object, TYPE desired, enum memmodel) EXP is the CALL_EXPR. TARGET is an optional place for us to store the results.
References CALL_EXPR_ARG, exp(), expand_atomic_store(), expand_expr_force_mode(), get_builtin_sync_mem(), get_memmodel(), is_mm_relaxed(), is_mm_release(), is_mm_seq_cst(), MEMMODEL_SEQ_CST, and NULL_RTX.
Referenced by expand_builtin().
Expand an atomic test_and_set operation. bool _atomic_test_and_set (BOOL *obj, enum memmodel) EXP is the call expression.
References BOOL_TYPE_SIZE, CALL_EXPR_ARG, exp(), expand_atomic_test_and_set(), get_builtin_sync_mem(), get_memmodel(), int_mode_for_size(), expand_operand::mode, opt_mode< T >::require(), and expand_operand::target.
Referenced by expand_builtin().
|
static |
Expand the __atomic_thread_fence intrinsic: void __atomic_thread_fence (enum memmodel) EXP is the CALL_EXPR.
References CALL_EXPR_ARG, exp(), expand_mem_thread_fence(), and get_memmodel().
Referenced by expand_builtin().
|
static |
Expand a call to bswap builtin in EXP. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. If convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing one of EXP's operands.
References CALL_EXPR_ARG, convert_to_mode(), exp(), expand_expr(), EXPAND_NORMAL, expand_unop(), gcc_assert, GET_MODE, NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Expand expression EXP, which is a call to the bzero builtin. Return NULL_RTX if we failed the caller should emit a normal call.
References CALL_EXPR_ARG, const0_rtx, exp(), expand_builtin_memset_args(), EXPR_LOCATION, fold_convert_loc(), integer_zero_node, NULL_RTX, size_type_node, and validate_arglist().
Referenced by expand_builtin().
Expand a call to the internal cexpi builtin to the sincos math function. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References assign_temp(), build1(), build2(), build_call_nary(), build_complex_type(), build_fn_decl(), build_function_type_list(), build_pointer_type(), build_real(), builtin_decl_explicit(), CALL_EXPR_ARG, copy_addr_to_reg(), dconst0, DECL_FUNCTION_CODE(), exp(), expand_expr(), EXPAND_NORMAL, expand_normal(), expand_twoval_unop(), EXPR_LOCATION, fold_build2_loc(), function_sincos, gcc_unreachable, gen_reg_rtx(), get_callee_fndecl(), make_tree(), expand_operand::mode, NULL, NULL_RTX, NULL_TREE, optab_handler(), expand_operand::target, targetm, TREE_TYPE, type(), TYPE_MODE, validate_arglist(), and XEXP.
Referenced by expand_builtin().
Expand a call EXP to __builtin_classify_type.
References CALL_EXPR_ARG, call_expr_nargs, exp(), GEN_INT, no_type_class, TREE_TYPE, and type_to_class().
Referenced by expand_builtin().
|
static |
Expand the __sync_val_compare_and_swap and __sync_bool_compare_and_swap intrinsics. EXP is the CALL_EXPR. IS_BOOL is true if this is the boolean form. TARGET is a place for us to store the results; this is NOT optional if IS_BOOL is true.
References CALL_EXPR_ARG, const0_rtx, exp(), expand_atomic_compare_and_swap(), expand_expr_force_mode(), get_builtin_sync_mem(), MEMMODEL_SYNC_SEQ_CST, NULL, and NULL_RTX.
Referenced by expand_builtin().
Expand EXP, a call to copysign, copysignf, or copysignl. Return NULL is a normal call should be emitted rather than expanding the function inline. If convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing the operand.
References CALL_EXPR_ARG, exp(), expand_copysign(), expand_expr(), EXPAND_NORMAL, expand_normal(), NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Expand a call to __builtin_expect. We just return our argument as the builtin_expect semantic should've been already executed by tree branch prediction pass.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, gcc_assert, seen_error(), and expand_operand::target.
Referenced by expand_builtin().
Expand a call to __builtin_expect_with_probability. We just return our argument as the builtin_expect semantic should've been already executed by tree branch prediction pass.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, gcc_assert, seen_error(), and expand_operand::target.
Referenced by expand_builtin().
Expand EXP, a call to fabs, fabsf or fabsl. Return NULL_RTX if a normal call should be emitted rather than expanding the function inline. If convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing the operand.
References builtin_save_expr(), CALL_EXPR_ARG, exp(), expand_abs(), expand_expr(), EXPAND_NORMAL, expand_operand::mode, NULL_RTX, safe_from_p(), expand_operand::target, TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
|
static |
Expand call EXP to either feclearexcept or feraiseexcept builtins (from C99 fenv.h), returning the result and setting it in TARGET. Otherwise return NULL_RTX on failure.
References CALL_EXPR_ARG, direct_optab_handler(), emit_insn(), exp(), expand_normal(), gen_reg_rtx(), GET_MODE, insn_data, NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Expand call EXP to the fegetround builtin (from C99 fenv.h), returning the result and setting it in TARGET. Otherwise return NULL_RTX on failure.
References direct_optab_handler(), emit_insn(), exp(), gen_reg_rtx(), GET_MODE, insn_data, NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Expand fork or exec calls. TARGET is the desired target of the call. EXP is the call. FN is the identificator of the actual function. IGNORE is nonzero if the value is to be ignored.
References build_decl(), DECL_ARTIFICIAL, DECL_EXTERNAL, DECL_FUNCTION_CODE(), DECL_SOURCE_LOCATION, DECL_VISIBILITY, DECL_VISIBILITY_SPECIFIED, exp(), expand_call(), EXPR_LOCATION, gcc_unreachable, get_identifier(), NULL_RTX, rewrite_call_expr(), TREE_NOTHROW, TREE_PUBLIC, TREE_TYPE, and VISIBILITY_DEFAULT.
Referenced by expand_builtin().
Expand a call to one of the builtin functions __builtin_frame_address or __builtin_return_address.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, CONSTANT_P, copy_addr_to_reg(), count, DECL_FUNCTION_CODE(), error(), exp(), expand_builtin_return_addr(), NULL, REG_P, tree_fits_uhwi_p(), tree_to_uhwi(), and warning().
Referenced by expand_builtin().
Emit code to get the openacc gang, worker or vector id or size.
References CALL_EXPR_ARG, const0_rtx, const1_rtx, current_function_decl, DECL_FUNCTION_CODE(), emit_insn(), emit_move_insn(), error(), exp(), gcc_unreachable, GEN_INT, gen_reg_rtx(), get_callee_fndecl(), GET_MODE, MEM_P, NULL_RTX, NULL_TREE, oacc_get_fn_attrib(), expand_operand::target, targetm, TREE_CODE, TREE_INT_CST_LOW, TREE_TYPE, and TYPE_MODE.
Referenced by expand_builtin().
Expand a call to the builtin descriptor initialization routine. A descriptor is made up of a couple of pointers to the static chain and the code entry in this order.
References adjust_address_nv, CALL_EXPR_ARG, const0_rtx, emit_move_insn(), exp(), expand_normal(), gen_rtx_MEM(), GET_MODE_ALIGNMENT, MEM_NOTRAP_P, NULL_RTX, POINTER_SIZE, ptr_mode, set_mem_align(), and validate_arglist().
Referenced by expand_builtin().
References CALL_EXPR_ARG, change_address(), const0_rtx, DECL_SOURCE_LOCATION, exp(), expand_normal(), gcc_assert, gen_rtx_MEM(), MEM_NOTRAP_P, NULL_RTX, round_trampoline_addr(), set_mem_align(), set_mem_attributes(), set_mem_size(), targetm, TRAMPOLINE_ALIGNMENT, trampolines_created, TREE_CODE, TREE_OPERAND, validate_arglist(), and warning_at().
Referenced by expand_builtin().
Expand a call to one of the builtin rounding functions gcc defines as an extension (lfloor and lceil). As these are gcc extensions we do not need to worry about setting errno to EDOM. If expanding via optab fails, lower expression to (int)(floor(x)). EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References build_call_nofold_loc(), build_fn_decl(), build_function_type_list(), builtin_save_expr(), CALL_EXPR_ARG, CASE_FLT_FN, DECL_FUNCTION_CODE(), emit_insn(), end_sequence(), exp(), expand_expr(), expand_fix(), EXPAND_NORMAL, expand_normal(), expand_sfix_optab(), EXPR_LOCATION, gcc_unreachable, gen_reg_rtx(), get_callee_fndecl(), get_insns(), insns, mathfn_built_in(), maybe_emit_group_store(), real_format::name, NULL, NULL_RTX, NULL_TREE, start_sequence(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand a call to one of the builtin math functions doing integer conversion (lrint). Return 0 if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References as_combined_fn(), build_call_nofold_loc(), builtin_save_expr(), CALL_EXPR_ARG, CASE_FLT_FN, const0_rtx, convert_to_mode(), DECL_FUNCTION_CODE(), emit_insn(), end_sequence(), exp(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_sfix_optab(), EXPR_LOCATION, gcc_fallthrough, gcc_unreachable, gen_reg_rtx(), get_callee_fndecl(), get_insns(), insns, mathfn_built_in_1(), maybe_emit_group_store(), NULL, NULL_RTX, NULL_TREE, start_sequence(), TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand a call to one of the builtin math functions that operate on floating point argument and output an integer result (ilogb, isinf, isnan, etc). Return 0 if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References builtin_save_expr(), CALL_EXPR_ARG, convert_to_mode(), create_output_operand(), delete_insns_since(), exp(), expand_expr(), EXPAND_NORMAL, get_callee_fndecl(), get_last_insn(), GET_MODE, interclass_mathfn_icode(), last, maybe_emit_unop_insn(), maybe_legitimize_operands(), expand_operand::mode, NULL_RTX, expand_operand::target, TREE_TYPE, TYPE_MODE, validate_arglist(), and expand_operand::value.
Referenced by expand_builtin().
Expand the __builtin_issignaling builtin. This needs to handle all floating point formats that do support NaNs (for those that don't it just sets target to 0).
References adjust_address, assign_stack_temp(), real_format::b, CALL_EXPR_ARG, const0_rtx, convert_modes(), DECIMAL_FLOAT_MODE_P, delete_insns_since(), emit_move_insn(), emit_store_flag_force(), exp(), expand_binop(), expand_normal(), expand_shift(), expand_unop(), FLOAT_WORDS_BIG_ENDIAN, force_highpart_subreg(), force_lowpart_subreg(), gcc_assert, gcc_unreachable, GEN_INT, gen_lowpart, gen_reg_rtx(), get_last_insn(), GET_MODE, GET_MODE_BITSIZE(), GET_MODE_SIZE(), HONOR_NANS(), HOST_WIDE_INT_1U, HOST_WIDE_INT_M1U, real_format::ieee_bits, int_mode_for_mode(), int_mode_for_size(), last, maybe_emit_unop_insn(), MEM_P, MODE_COMPOSITE_P, NULL_RTX, offset, optab_handler(), OPTAB_LIB_WIDEN, real_format::p, real_format::pnan, real_format::qnan_msb_set, REAL_MODE_FORMAT, opt_mode< T >::require(), SCALAR_FLOAT_TYPE_MODE, real_format::signbit_ro, real_format::signbit_rw, subreg_highpart_offset(), subreg_lowpart_offset(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
__builtin_longjmp is passed a pointer to an array of five words (not all will be used on all machines). It operates similarly to the C library function of the same name, but is more efficient. Much of the code below is copied from the handling of non-local gotos.
References add_reg_note(), CALL_P, const0_rtx, const1_rtx, convert_memory_address, copy_to_reg(), crtl, emit_clobber(), emit_indirect_jump(), emit_insn(), emit_move_insn(), emit_stack_restore(), emit_use(), force_reg(), frame_pointer_rtx, gcc_assert, gen_blockage(), gen_rtx_MEM(), get_last_insn(), GET_MODE_SIZE(), hard_frame_pointer_rtx, JUMP_P, last, new_alias_set(), plus_constant(), PREV_INSN(), SAVE_NONLOCAL, set_mem_alias_set(), setjmp_alias_set, stack_pointer_rtx, SUPPORTS_STACK_ALIGNMENT, and targetm.
Referenced by expand_builtin().
Expand a call to the builtin sin and cos math functions. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing one of EXP's operands.
References builtin_save_expr(), CALL_EXPR_ARG, CASE_FLT_FN, const0_rtx, DECL_FUNCTION_CODE(), emit_insn(), end_sequence(), exp(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_twoval_unop(), expand_unop(), gcc_assert, gcc_unreachable, gen_reg_rtx(), get_callee_fndecl(), get_insns(), insns, NULL_RTX, optab_handler(), start_sequence(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand a call to the builtin trinary math functions (fma). Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing one of EXP's operands.
References builtin_save_expr(), CALL_EXPR_ARG, CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, const0_rtx, DECL_FUNCTION_CODE(), emit_insn(), end_sequence(), exp(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_normal(), expand_ternary_op(), gcc_unreachable, gen_reg_rtx(), get_callee_fndecl(), get_insns(), insns, NULL_RTX, optab_handler(), start_sequence(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand expression EXP, which is a call to the memcmp built-in function. Return NULL_RTX if we failed and the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient. RESULT_EQ is true if we can relax the returned value to be either zero or nonzero, without caring about the sign.
References builtin_memcpy_read_str(), CALL_EXPR_ARG, CONST_CAST, CONST_INT_P, convert_move(), convert_to_mode(), DECL_FUNCTION_CODE(), emit_block_cmp_hints(), exp(), expand_normal(), EXPR_LOCATION, fold_convert_loc(), get_callee_fndecl(), get_memory_rtx(), GET_MODE, get_pointer_alignment(), getbyterep(), inline_expand_builtin_bytecmp(), INTVAL, expand_operand::mode, NULL, NULL_RTX, set_mem_size(), sizetype, expand_operand::target, tree_ctz(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand a call EXP to the memcpy builtin. Return NULL_RTX if we failed, the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References CALL_EXPR_ARG, exp(), expand_builtin_memory_copy_args(), NULL_RTX, RETURN_BEGIN, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Check a call EXP to the memmove built-in for validity. Return NULL_RTX on both success and failure.
References CALL_EXPR_ARG, exp(), expand_builtin_memory_copy_args(), NULL_RTX, RETURN_BEGIN, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
|
static |
Expand EXP, a call to the __mem{cpy,pcpy,move,set}_chk builtin. FCODE is the BUILT_IN_* to use. Return NULL_RTX if we failed; the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References access_read_write, build_call_nofold_loc(), builtin_decl_explicit(), CALL_EXPR_ARG, CALL_EXPR_TAILCALL, check_access(), const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, expr, EXPR_LOCATION, fold_build_pointer_plus, gcc_assert, get_pointer_alignment(), integer_all_onesp(), expand_operand::mode, NULL_RTX, NULL_TREE, operand_equal_p(), readonly_data_expr(), expand_operand::target, TREE_CODE, tree_fits_uhwi_p(), tree_int_cst_lt(), and validate_arglist().
Referenced by expand_builtin().
|
static |
Helper function to do the actual work for expand of memory copy family functions (memcpy, mempcpy, stpcpy). Expansing should assign LEN bytes of memory from SRC to DEST and assign to TARGET if convenient. Return value is based on RETMODE argument.
References BLOCK_OP_NO_LIBCALL_RET, BLOCK_OP_NORMAL, BLOCK_OP_TAILCALL, builtin_memcpy_read_str(), CALL_EXPR_TAILCALL, can_store_by_pieces(), const0_rtx, const1_rtx, CONST_CAST, CONST_INT_P, convert_memory_address, currently_expanding_gimple_stmt, determine_block_size(), emit_block_move_hints(), exp(), expand_normal(), force_operand(), get_memory_rtx(), get_pointer_alignment(), getbyterep(), INTVAL, NULL_RTX, pc_rtx, ptr_mode, RETURN_BEGIN, RETURN_END, RETURN_END_MINUS_ONE, set_mem_align(), store_by_pieces(), stringop_block_profile(), expand_operand::target, targetm, tree_ctz(), and XEXP.
Referenced by expand_builtin_memcpy(), expand_builtin_memmove(), and expand_builtin_mempcpy_args().
Expand a call EXP to the mempcpy builtin. Return NULL_RTX if we failed; the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References CALL_EXPR_ARG, exp(), expand_builtin_mempcpy_args(), NULL_RTX, RETURN_END, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
|
static |
References expand_builtin_memory_copy_args(), and expand_operand::target.
Referenced by expand_builtin_mempcpy(), and expand_builtin_stpcpy_1().
Expand expression EXP, which is a call to the memset builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References CALL_EXPR_ARG, exp(), expand_builtin_memset_args(), expand_operand::mode, NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin(), and expand_DEFERRED_INIT().
|
static |
Helper function to do the actual work for expand_builtin_memset. The arguments to the builtin_memset call DEST, VAL, and LEN are broken out so that this can also be called without constructing an actual CALL_EXPR. The other arguments and return value are the same as for expand_builtin_memset.
References BLOCK_OP_NORMAL, BLOCK_OP_TAILCALL, build_call_nofold_loc(), builtin_memset_gen_str(), builtin_memset_read_str(), builtin_save_expr(), CALL_EXPR_TAILCALL, can_store_by_pieces(), clear_storage_hints(), const0_rtx, convert_memory_address, convert_to_mode(), currently_expanding_gimple_stmt, DECL_FUNCTION_CODE(), determine_block_size(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_normal(), EXPR_LOCATION, force_operand(), force_reg(), gcc_assert, gcc_unreachable, gen_int_mode(), get_callee_fndecl(), get_memory_rtx(), get_pointer_alignment(), integer_zerop(), expand_operand::mode, NULL_RTX, ptr_mode, RETURN_BEGIN, set_mem_align(), set_storage_via_setmem(), store_by_pieces(), stringop_block_profile(), expand_operand::target, target_char_cast(), TREE_CODE, tree_ctz(), tree_fits_uhwi_p(), tree_to_uhwi(), try_store_by_multiple_pieces(), TYPE_MODE, unsigned_char_type_node, and XEXP.
Referenced by expand_builtin_bzero(), and expand_builtin_memset().
|
static |
Expand a call to __builtin_next_arg.
References crtl, expand_binop(), NULL_RTX, OPTAB_LIB_WIDEN, and ptr_mode.
Referenced by expand_builtin(), and expand_builtin_va_start().
Expand a call to __builtin_nonlocal_goto. We're passed the target label and the address of the save area.
References add_reg_note(), CALL_EXPR_ARG, CALL_P, const0_rtx, convert_memory_address, copy_to_reg(), crtl, emit_clobber(), emit_indirect_jump(), emit_insn(), emit_move_insn(), emit_stack_restore(), emit_use(), exp(), expand_normal(), fixed_regs, frame_pointer_rtx, gen_blockage(), gen_rtx_MEM(), get_last_insn(), GET_MODE_SIZE(), hard_frame_pointer_rtx, INVALID_REGNUM, JUMP_P, NULL_RTX, PIC_OFFSET_TABLE_REGNUM, pic_offset_table_rtx, plus_constant(), PREV_INSN(), SAVE_NONLOCAL, stack_pointer_rtx, targetm, and validate_arglist().
Referenced by expand_builtin().
Expand a call EXP to __builtin_object_size.
References CALL_EXPR_ARG, compare_tree_int(), const0_rtx, constm1_rtx, error(), exp(), expand_builtin_trap(), get_callee_fndecl(), STRIP_NOPS, TREE_CODE, tree_int_cst_sgn(), tree_to_shwi(), and validate_arglist().
Referenced by expand_builtin().
Expand a call to the powi built-in mathematical function. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References CALL_EXPR_ARG, convert_to_mode(), emit_library_call_value(), exp(), expand_expr(), EXPAND_NORMAL, gen_reg_rtx(), GET_MODE, int_mode_for_size(), INT_TYPE_SIZE, LCT_CONST, NULL_RTX, optab_libfunc(), opt_mode< T >::require(), TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
|
static |
Expand a call to __builtin_prefetch. For a target that does not support data prefetch, evaluate the memory address argument in case it has side effects.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, create_address_operand(), create_integer_operand(), emit_insn(), error(), exp(), expand_expr(), EXPAND_NORMAL, expand_normal(), GEN_INT, INTVAL, maybe_expand_insn(), MEM_P, NULL_RTX, NULL_TREE, side_effects_p(), targetm, TREE_CODE, validate_arglist(), and warning().
Referenced by expand_builtin().
|
static |
Perform an untyped return.
References adjust_address, apply_result_mode, apply_result_size(), CEIL, convert_memory_address, emit_barrier(), emit_insn(), emit_jump_insn(), emit_move_insn(), emit_use(), end_sequence(), expand_naked_return(), gen_rtx_MEM(), gen_rtx_REG(), get_insns(), GET_MODE_ALIGNMENT, GET_MODE_SIZE(), INCOMING_REGNO, push_to_sequence(), result_vector(), and targetm.
Referenced by expand_builtin().
|
static |
Given TEM, a pointer to a stack frame, follow the dynamic chain COUNT times to get the address of either a higher stack frame, or a return address located within it (depending on FNDECL_CODE).
References copy_to_reg(), count, crtl, DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX, frame_pointer_rtx, gen_frame_mem(), GET_MODE_SIZE(), hard_frame_pointer_rtx, i, INITIAL_FRAME_ADDRESS_RTX, memory_address, NULL_RTX, plus_constant(), RETURN_ADDR_IN_PREVIOUS_FRAME, and SETUP_FRAME_ADDRESSES.
Referenced by expand_builtin_frame_address().
rtx expand_builtin_saveregs | ( | void | ) |
Expand a call to __builtin_saveregs, generating the result in TARGET, if that's convenient.
References emit_insn_after(), end_sequence(), entry_of_function(), get_insns(), pop_topmost_sequence(), push_topmost_sequence(), saveregs_value, start_sequence(), and targetm.
Referenced by expand_builtin().
|
static |
References CALL_EXPR_ARG, create_input_operand(), direct_optab_handler(), error(), exp(), expand_expr(), expand_insn(), EXPAND_NORMAL, NULL_RTX, and validate_arglist().
Referenced by expand_builtin().
void expand_builtin_setjmp_receiver | ( | rtx | receiver_label | ) |
Construct the trailing part of a __builtin_setjmp call. This is also called directly by the SJLJ exception handling code. If RECEIVER_LABEL is NULL, instead contruct a nonlocal goto handler.
References copy_to_reg(), crtl, current_function_decl, emit_clobber(), emit_insn(), emit_move_insn(), emit_use(), fixed_regs, gen_blockage(), get_arg_pointer_save_area(), HARD_FRAME_POINTER_IS_ARG_POINTER, HARD_FRAME_POINTER_REGNUM, hard_frame_pointer_rtx, i, NULL, REG_P, rtx_for_static_chain(), and targetm.
Referenced by expand_builtin(), expand_label(), and sjlj_emit_dispatch_table().
Construct the leading half of a __builtin_setjmp call. Control will return to RECEIVER_LABEL. This is also called directly by the SJLJ exception handling code.
References cfun, convert_memory_address, emit_insn(), emit_move_insn(), emit_stack_save(), force_operand(), force_reg(), gen_rtx_MEM(), GET_MODE_SIZE(), hard_frame_pointer_rtx, new_alias_set(), NULL_RTX, plus_constant(), SAVE_NONLOCAL, set_mem_alias_set(), setjmp_alias_set, targetm, and validize_mem().
Referenced by expand_builtin(), and sjlj_emit_function_enter().
Expand the call EXP to the built-in signbit, signbitf or signbitl function. The function first checks whether the back end provides an insn to implement signbit for the respective mode. If not, it checks whether the floating point format of the value is such that the sign bit can be extracted. If that is not the case, error out. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET.
References BITS_PER_WORD, build_real(), builtin_save_expr(), CALL_EXPR_ARG, const1_rtx, dconst0, delete_insns_since(), exp(), expand_binop(), expand_expr(), EXPAND_NORMAL, expand_normal(), expand_shift(), EXPR_LOCATION, FLOAT_WORDS_BIG_ENDIAN, fold_build2_loc(), force_reg(), gcc_assert, gen_lowpart, gen_reg_rtx(), get_last_insn(), GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_SIZE(), real_format::has_signed_zero, HONOR_SIGNED_ZEROS(), immed_wide_int_const(), int_mode_for_mode(), last, maybe_emit_unop_insn(), NULL_RTX, operand_subword_force(), optab_handler(), OPTAB_LIB_WIDEN, REAL_MODE_FORMAT, opt_mode< T >::require(), SCALAR_FLOAT_TYPE_MODE, SCALAR_INT_TYPE_MODE, wi::set_bit_in_zero(), real_format::signbit_ro, TREE_TYPE, TYPE_MODE, validate_arglist(), and word_mode.
Referenced by expand_builtin().
Expand a call to the builtin sincos math function. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function.
References build_int_cst(), build_pointer_type_for_mode(), CALL_EXPR_ARG, const0_rtx, emit_move_insn(), exp(), expand_normal(), expand_twoval_unop(), EXPR_LOCATION, fold_build2_loc(), gcc_assert, gen_reg_rtx(), expand_operand::mode, NULL_RTX, optab_handler(), ptr_mode, TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
|
static |
Expand a call to builtin function __builtin_stack_address.
References convert_to_mode(), copy_to_reg(), force_reg(), plus_constant(), ptr_mode, stack_pointer_rtx, and STACK_UNSIGNED.
Referenced by expand_builtin(), expand_builtin_strub_enter(), expand_builtin_strub_leave(), and expand_builtin_strub_update().
Expand a call EXP to the stpcpy builtin and diagnose uses of nonstring arguments while being careful to avoid duplicate warnings (which could be issued if the expander were to expand the call, resulting in it being emitted in expand_call().
References exp(), expand_builtin_stpcpy_1(), get_callee_fndecl(), maybe_warn_nonstring_arg(), expand_operand::mode, NULL_RTX, and expand_operand::target.
Referenced by expand_builtin().
Expand a call EXP to the stpcpy builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References build_call_nofold_loc(), builtin_decl_implicit(), c_getstr(), c_strlen(), CALL_EXPR_ARG, const0_rtx, CONST_INT_P, emit_move_insn(), exp(), expand_builtin_mempcpy_args(), expand_builtin_strcpy_args(), expand_expr(), expand_movstr(), EXPAND_NORMAL, expand_normal(), EXPR_LOCATION, force_operand(), gcc_assert, gen_lowpart, gen_reg_rtx(), GET_MODE, INTVAL, expand_operand::mode, NULL_RTX, plus_constant(), RETURN_END_MINUS_ONE, size_binop_loc(), ssize_int, expand_operand::target, TREE_CODE, and validate_arglist().
Referenced by expand_builtin_stpcpy().
Expand expression EXP, which is a call to the strcmp builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient.
References build_call_nofold_loc(), builtin_save_expr(), c_strlen(), CALL_EXPR_ARG, CALL_EXPR_TAILCALL, const0_rtx, convert_move(), convert_to_mode(), copy_warning(), direct_optab_handler(), exp(), expand_call(), expand_cmpstr(), expand_cmpstrn_or_cmpmem(), expand_normal(), EXPR_LOCATION, gcc_assert, get_callee_fndecl(), get_memory_rtx(), GET_MODE, get_pointer_alignment(), inline_expand_builtin_bytecmp(), MIN, expand_operand::mode, NULL, NULL_RTX, size_binop, ssize_int, expand_operand::target, TREE_CODE, tree_int_cst_lt(), TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand expression EXP, which is a call to the strcpy builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References CALL_EXPR_ARG, exp(), expand_builtin_strcpy_args(), NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
Helper function to do the actual work for expand_builtin_strcpy. The arguments to the builtin_strcpy call DEST and SRC are broken out so that this can also be called without constructing an actual CALL_EXPR. The other arguments and return value are the same as for expand_builtin_strcpy.
References expand_movstr(), RETURN_BEGIN, and expand_operand::target.
Referenced by expand_builtin_stpcpy_1(), and expand_builtin_strcpy().
Expand expression EXP which is a call to the strlen builtin. Return NULL_RTX if we failed and the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient.
References c_strlen(), CALL_EXPR_ARG, const0_rtx, convert_move(), convert_to_mode(), create_fixed_operand(), create_integer_operand(), create_output_operand(), emit_insn_after(), emit_insn_before(), emit_move_insn(), end_sequence(), exp(), expand_expr(), EXPAND_NORMAL, FOR_EACH_MODE_FROM, gen_reg_rtx(), gen_rtx_MEM(), get_callee_fndecl(), get_insns(), get_last_insn(), GET_MODE, get_pointer_alignment(), maybe_expand_insn(), maybe_warn_nonstring_arg(), NULL_RTX, optab_handler(), start_sequence(), expand_operand::target, TREE_CODE, validate_arglist(), and expand_operand::value.
Referenced by expand_builtin().
Expand expression EXP, which is a call to the strncmp builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient.
References build_call_nofold_loc(), c_strlen(), CALL_EXPR_ARG, CALL_EXPR_TAILCALL, const0_rtx, convert_move(), convert_to_mode(), copy_warning(), direct_optab_handler(), exp(), expand_call(), expand_cmpstrn_or_cmpmem(), expand_normal(), EXPR_LOCATION, fold_build2_loc(), fold_convert_loc(), gcc_assert, get_callee_fndecl(), get_memory_rtx(), GET_MODE, get_pointer_alignment(), inline_expand_builtin_bytecmp(), MIN, expand_operand::mode, NULL_RTX, size_binop_loc(), sizetype, ssize_int, expand_operand::target, TREE_CODE, tree_int_cst_lt(), TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
Expand expression EXP, which is a call to the strncpy builtin. Return NULL_RTX if we failed the caller should emit a normal call.
References builtin_strncpy_read_str(), c_getstr(), c_strlen(), CALL_EXPR_ARG, can_store_by_pieces(), CONST_CAST, convert_memory_address, exp(), EXPR_LOCATION, force_operand(), get_memory_rtx(), get_pointer_alignment(), NULL_RTX, ptr_mode, RETURN_BEGIN, size_binop_loc(), ssize_int, store_by_pieces(), expand_operand::target, tree_fits_uhwi_p(), tree_int_cst_lt(), tree_to_uhwi(), validate_arglist(), and XEXP.
Referenced by expand_builtin().
Expand call EXP to the strnlen built-in, returning the result and setting it in TARGET. Otherwise return NULL_RTX on failure.
References c_strlen(), CALL_EXPR_ARG, c_strlen_data::decl, exp(), expand_expr(), EXPAND_NORMAL, EXPR_HAS_LOCATION, EXPR_LOCATION, fold_build2_loc(), fold_convert_loc(), get_global_range_query(), wi::gtu_p(), NULL_RTX, r, range_query::range_of_expr(), size_type_node, expand_operand::target, wi::to_wide(), TREE_CODE, TREE_TYPE, UNKNOWN_LOCATION, unterminated_array(), and validate_arglist().
Referenced by expand_builtin().
Expand a call to builtin function __builtin_strub_enter.
References build_int_cst(), CALL_EXPR_ARG, const0_rtx, emit_move_insn(), exp(), expand_builtin_stack_address(), expand_expr(), EXPAND_MEMORY, fold_build2, NULL_RTX, ptr_mode, TREE_TYPE, and validate_arglist().
Referenced by expand_builtin().
Expand a call to builtin function __builtin_strub_leave.
References build_int_cst(), CALL_EXPR_ARG, const0_rtx, copy_to_reg(), current_function_decl, do_compare_rtx_and_jump(), emit_label(), emit_move_insn(), end(), exp(), expand_builtin_stack_address(), expand_call(), expand_expr(), EXPAND_MEMORY, fold_build2, force_operand(), force_reg(), gen_label_rtx(), gen_rtx_MEM(), GET_MODE_SIZE(), memory_address, NULL, NULL_RTX, NULL_TREE, plus_constant(), ptr_mode, STACK_UNSIGNED, strub_watermark_parm(), TREE_TYPE, validate_arglist(), and profile_probability::very_likely().
Referenced by expand_builtin().
Expand a call to builtin function __builtin_strub_update.
References build_int_cst(), CALL_EXPR_ARG, const0_rtx, current_function_decl, do_compare_rtx_and_jump(), emit_label(), emit_move_insn(), exp(), expand_builtin_stack_address(), expand_expr(), EXPAND_MEMORY, fold_build2, force_reg(), gen_label_rtx(), NULL, NULL_RTX, plus_constant(), ptr_mode, STACK_TOPS, STACK_UNSIGNED, strub_watermark_parm(), TREE_TYPE, validate_arglist(), and profile_probability::very_likely().
Referenced by expand_builtin().
|
static |
Expand the __sync_lock_release intrinsic. EXP is the CALL_EXPR.
References CALL_EXPR_ARG, const0_rtx, exp(), expand_atomic_store(), get_builtin_sync_mem(), and MEMMODEL_SYNC_RELEASE.
Referenced by expand_builtin().
Expand the __sync_lock_test_and_set intrinsic. Note that the most general form is actually an atomic exchange, and some targets only support a reduced form with the second argument being a constant 1. EXP is the CALL_EXPR; TARGET is an optional place for us to store the results.
References CALL_EXPR_ARG, exp(), expand_expr_force_mode(), expand_sync_lock_test_and_set(), and get_builtin_sync_mem().
Referenced by expand_builtin().
|
static |
Expand the __sync_xxx_and_fetch and __sync_fetch_and_xxx intrinsics. EXP is the CALL_EXPR. CODE is the rtx code that corresponds to the arithmetic or logical operation from the name; an exception here is that NOT actually means NAND. TARGET is an optional place for us to store the results; AFTER is true if this is the fetch_and_xxx form.
References builtin_decl_implicit(), CALL_EXPR_ARG, DECL_FUNCTION_CODE(), exp(), expand_atomic_fetch_op(), expand_expr_force_mode(), EXPR_LOCATION, gcc_unreachable, get_builtin_sync_mem(), get_callee_fndecl(), inform(), and MEMMODEL_SYNC_SEQ_CST.
Referenced by expand_builtin().
|
static |
Expand the __sync_synchronize intrinsic.
References expand_mem_thread_fence(), and MEMMODEL_SYNC_SEQ_CST.
Referenced by expand_builtin().
References const0_rtx, create_output_operand(), direct_optab_handler(), error(), exp(), expand_insn(), gen_reg_rtx(), GET_MODE, NULL_RTX, REG_P, expand_operand::target, and validate_arglist().
Referenced by expand_builtin().
void expand_builtin_trap | ( | void | ) |
References ACCUMULATE_OUTGOING_ARGS, add_args_size_note(), build_call_expr(), builtin_decl_implicit(), emit_barrier(), emit_insn(), expand_call(), NULL_RTX, stack_pointer_delta, and targetm.
Referenced by expand_assignment(), expand_builtin(), expand_builtin_object_size(), and expand_sjlj_dispatch_table().
|
static |
Expand a call to a unary builtin in EXP. Return NULL_RTX if a normal call should be emitted rather than expanding the function in-line. If convenient, the result should be placed in TARGET. SUBTARGET may be used as the target for computing one of EXP's operands.
References CALL_EXPR_ARG, convert_to_mode(), exp(), expand_expr(), EXPAND_NORMAL, expand_unop(), gcc_assert, GET_MODE, NULL_RTX, expand_operand::target, TREE_TYPE, TYPE_MODE, and validate_arglist().
Referenced by expand_builtin().
|
static |
Expand a call to __builtin_unreachable. We do nothing except emit a barrier saying that control flow will not pass here. It is the responsibility of the program being compiled to ensure that control flow does never reach __builtin_unreachable.
References emit_barrier(), gcc_checking_assert, sanitize_flags_p(), and SANITIZE_UNREACHABLE.
Referenced by expand_builtin().
void expand_builtin_update_setjmp_buf | ( | rtx | buf_addr | ) |
__builtin_update_setjmp_buf is passed a pointer to an array of five words (not all will be used on all machines) that was passed to __builtin_setjmp. It updates the stack pointer in that block to the current value. This is also called directly by the SJLJ exception handling code.
References convert_memory_address, emit_stack_save(), gen_rtx_MEM(), GET_MODE_SIZE(), memory_address, plus_constant(), and SAVE_NONLOCAL.
Referenced by expand_builtin(), and sjlj_mark_call_sites().
Expand EXP, a call to __builtin_va_copy. We do this as a builtin rather than just as an assignment in stdarg.h because of the nastiness of array-type va_list types.
References BLOCK_OP_NORMAL, build2(), CALL_EXPR_ARG, cfun, const0_rtx, convert_memory_address, emit_block_move(), exp(), expand_expr(), EXPAND_NORMAL, EXPR_LOCATION, gcc_assert, gen_rtx_MEM(), get_alias_set(), NULL, NULL_RTX, NULL_TREE, set_mem_alias_set(), set_mem_align(), stabilize_va_list_loc(), targetm, TREE_CODE, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_ALIGN, and TYPE_SIZE_UNIT.
Referenced by expand_builtin().
Expand EXP, a call to __builtin_va_end.
References CALL_EXPR_ARG, const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, and TREE_SIDE_EFFECTS.
Referenced by expand_builtin().
Expand EXP, a call to __builtin_va_start.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, error_at(), exp(), expand_builtin_next_arg(), EXPR_LOCATION, fold_builtin_next_arg(), stabilize_va_list_loc(), std_expand_builtin_va_start(), and targetm.
Referenced by expand_builtin().
|
static |
Try to expand cmpstr operation ICODE with the given operands. Return the result rtx on success, otherwise return null.
References create_fixed_operand(), create_integer_operand(), create_output_operand(), HARD_REGISTER_P, insn_data, maybe_expand_insn(), insn_operand_data::mode, NULL_RTX, insn_data_d::operand, REG_P, expand_operand::target, and expand_operand::value.
Referenced by expand_builtin_strcmp().
Make sure an argument is in the right mode. EXP is the tree argument. MODE is the mode it should be in.
References CONVERT_EXPR_CODE_P, convert_modes(), exp(), expand_expr(), EXPAND_NORMAL, g, get_gimple_for_ssa_name(), GET_MODE, gimple_assign_cast_p(), gimple_assign_rhs1(), gimple_assign_rhs_code(), INTEGRAL_TYPE_P, NULL_RTX, TREE_CODE, TREE_TYPE, TYPE_MODE, and TYPE_PRECISION.
Referenced by expand_builtin_atomic_compare_exchange(), expand_builtin_atomic_exchange(), expand_builtin_atomic_fetch_op(), expand_builtin_atomic_store(), expand_builtin_compare_and_swap(), expand_builtin_sync_lock_test_and_set(), expand_builtin_sync_operation(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_compare_exchange(), and expand_ifn_atomic_op_fetch_cmp_0().
void expand_ifn_atomic_bit_test_and | ( | gcall * | call | ) |
Expand IFN_ATOMIC_BIT_TEST_AND_* internal function.
References build_call_nary(), const0_rtx, const1_rtx, create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_move_insn(), exp(), expand_atomic_fetch_op(), expand_builtin(), expand_expr(), expand_expr_force_mode(), expand_simple_binop(), expand_simple_unop(), EXPAND_WRITE, gcc_assert, gcc_unreachable, gen_reg_rtx(), get_builtin_sync_mem(), get_memmodel(), gimple_call_addr_fndecl(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_lhs(), gimple_call_num_args(), integer_onep(), integer_zero_node, make_tree(), maybe_expand_insn(), MEMMODEL_SYNC_SEQ_CST, expand_operand::mode, NULL_RTX, NULL_TREE, OPTAB_DIRECT, expand_operand::target, TREE_TYPE, and TYPE_MODE.
Referenced by expand_ATOMIC_BIT_TEST_AND_COMPLEMENT(), expand_ATOMIC_BIT_TEST_AND_RESET(), and expand_ATOMIC_BIT_TEST_AND_SET().
void expand_ifn_atomic_compare_exchange | ( | gcall * | call | ) |
Expand IFN_ATOMIC_COMPARE_EXCHANGE internal function.
References convert_modes(), expand_atomic_compare_and_swap(), expand_expr(), expand_expr_force_mode(), expand_ifn_atomic_compare_exchange_into_call(), EXPAND_WRITE, failure, gcc_assert, get_builtin_sync_mem(), get_memmodel(), GET_MODE, gimple_call_arg(), gimple_call_lhs(), int_mode_for_size(), is_mm_acq_rel(), is_mm_release(), MEMMODEL_SEQ_CST, NULL, NULL_RTX, opt_mode< T >::require(), tree_to_shwi(), and write_complex_part().
Referenced by expand_ATOMIC_COMPARE_EXCHANGE().
|
static |
Helper function for expand_ifn_atomic_compare_exchange - expand internal ATOMIC_COMPARE_EXCHANGE call into __atomic_compare_exchange_N call. The weak parameter must be dropped to match the expected parameter list and the expected argument changed from value to pointer to memory slot.
References assign_stack_temp_for_type(), boolean_type_node, build1(), build_call_vec(), build_pointer_type(), builtin_decl_explicit(), convert_modes(), emit_move_insn(), exact_log2(), exp(), expand_call(), expand_expr(), EXPAND_NORMAL, EXPAND_WRITE, force_reg(), gcc_assert, GET_MODE, GET_MODE_SIZE(), gimple_call_arg(), gimple_call_lhs(), make_tree(), NULL_RTX, NULL_TREE, TREE_TYPE, vec_alloc(), and write_complex_part().
Referenced by expand_ifn_atomic_compare_exchange().
void expand_ifn_atomic_op_fetch_cmp_0 | ( | gcall * | call | ) |
Expand IFN_ATOMIC_*_FETCH_CMP_0 internal function.
References ATOMIC_OP_FETCH_CMP_0_EQ, ATOMIC_OP_FETCH_CMP_0_GE, ATOMIC_OP_FETCH_CMP_0_GT, ATOMIC_OP_FETCH_CMP_0_LE, ATOMIC_OP_FETCH_CMP_0_LT, ATOMIC_OP_FETCH_CMP_0_NE, boolean_type_node, build_call_nary(), comp, const0_rtx, create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_move_insn(), emit_store_flag_force(), exp(), expand_atomic_fetch_op(), expand_builtin(), expand_expr(), expand_expr_force_mode(), EXPAND_WRITE, gcc_assert, gcc_unreachable, gen_reg_rtx(), get_builtin_sync_mem(), get_memmodel(), gimple_call_addr_fndecl(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_lhs(), gimple_call_num_args(), integer_zero_node, maybe_expand_insn(), MEMMODEL_SYNC_SEQ_CST, expand_operand::mode, NULL_RTX, NULL_TREE, expand_operand::target, tree_to_uhwi(), TREE_TYPE, and TYPE_MODE.
Referenced by expand_ATOMIC_ADD_FETCH_CMP_0(), expand_ATOMIC_AND_FETCH_CMP_0(), expand_ATOMIC_OR_FETCH_CMP_0(), expand_ATOMIC_SUB_FETCH_CMP_0(), and expand_ATOMIC_XOR_FETCH_CMP_0().
Expand into a movstr instruction, if one is available. Return NULL_RTX if we failed, the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient. Return value is based on RETMODE argument.
References const0_rtx, create_fixed_operand(), create_output_operand(), emit_move_insn(), force_operand(), force_reg(), gen_lowpart, get_memory_rtx(), GET_MODE, maybe_expand_insn(), NULL, NULL_RTX, plus_constant(), replace_equiv_address(), RETURN_BEGIN, RETURN_END, expand_operand::target, targetm, expand_operand::value, and XEXP.
Referenced by expand_builtin_stpcpy_1(), and expand_builtin_strcpy_args().
|
static |
Expand a call to __builtin_speculation_safe_value_<N>. MODE represents the size of the first argument to that call, or VOIDmode if the argument is a pointer. IGNORE will be true if the result isn't used.
References CALL_EXPR_ARG, call_expr_nargs, const0_rtx, convert_modes(), exp(), expand_expr(), EXPAND_NORMAL, gcc_assert, gen_reg_rtx(), GET_MODE, GET_MODE_CLASS, expand_operand::mode, NULL, NULL_RTX, expand_operand::target, targetm, TREE_TYPE, and TYPE_MODE.
Referenced by expand_builtin().
|
static |
Emit code to restore the current value of stack.
References convert_memory_address, emit_stack_restore(), expand_normal(), fixup_args_size_notes(), get_last_insn(), record_new_stack_level(), and SAVE_BLOCK.
Referenced by expand_builtin().
|
static |
Emit code to save the current value of stack.
References emit_stack_save(), NULL_RTX, and SAVE_BLOCK.
Referenced by expand_builtin().
Fold a call to built-in function FNDECL with 0 arguments. This function returns NULL_TREE if no simplification was possible.
References build_builtin_unreachable(), CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, DECL_FUNCTION_CODE(), fold_builtin_classify_type(), fold_builtin_FILE(), fold_builtin_FUNCTION(), fold_builtin_inf(), fold_builtin_LINE(), NULL_TREE, sanitize_flags_p(), SANITIZE_UNREACHABLE, and TREE_TYPE.
Referenced by fold_builtin_n().
Fold a call to built-in function FNDECL with 1 argument, ARG0. This function returns NULL_TREE if no simplification was possible.
References as_combined_fn(), build_empty_stmt(), CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, DECL_FUNCTION_CODE(), error_operand_p(), fold_build1_loc(), fold_builtin_abs(), fold_builtin_bit_query(), fold_builtin_carg(), fold_builtin_classify(), fold_builtin_classify_type(), fold_builtin_constant_p(), fold_builtin_fabs(), fold_builtin_interclass_mathfn(), fold_builtin_isascii(), fold_builtin_isdigit(), fold_builtin_strlen(), fold_builtin_toascii(), fold_const_call(), integer_zero_node, integer_zerop(), non_lvalue_loc(), NULL_TREE, TREE_CODE, TREE_TYPE, and validate_arg().
Referenced by fold_builtin_n().
Folds a call EXPR (which may be null) to built-in function FNDECL with 2 arguments, ARG0 and ARG1. This function returns NULL_TREE if no simplification was possible.
References as_combined_fn(), CASE_FLT_FN, CASE_FLT_FN_REENT, DECL_FUNCTION_CODE(), do_mpfr_lgamma_r(), error_operand_p(), fold_builtin_atomic_always_lock_free(), fold_builtin_atomic_is_lock_free(), fold_builtin_bit_query(), fold_builtin_expect(), fold_builtin_frexp(), fold_builtin_iseqsig(), fold_builtin_modf(), fold_builtin_object_size(), fold_builtin_strcspn(), fold_builtin_strpbrk(), fold_builtin_strspn(), fold_builtin_unordered_cmp(), fold_const_call(), NULL_TREE, TREE_TYPE, and validate_arg().
Referenced by fold_builtin_n().
Fold a call to built-in function FNDECL with 3 arguments, ARG0, ARG1, and ARG2. This function returns NULL_TREE if no simplification was possible.
References as_combined_fn(), CASE_FLT_FN, DECL_FUNCTION_CODE(), do_mpfr_remquo(), error_operand_p(), fold_builtin_arith_overflow(), fold_builtin_expect(), fold_builtin_memcmp(), fold_builtin_sincos(), fold_const_call(), NULL_TREE, TREE_TYPE, and validate_arg().
Referenced by fold_builtin_n().
Fold a call to abs, labs, llabs or imaxabs with argument ARG.
References fold_build1_loc(), fold_convert_loc(), NULL_TREE, and validate_arg().
Referenced by fold_builtin_1().
|
static |
Fold __builtin_{add,sub}c{,l,ll} into pair of internal functions that return both result of arithmetics and overflowed boolean flag in a complex integer result.
References build1_loc(), build2_loc(), build_call_expr_internal_loc(), build_complex_type(), build_fold_indirect_ref_loc(), fold_build2_loc(), gcc_unreachable, save_expr(), TREE_SIDE_EFFECTS, TREE_TYPE, and void_type_node.
Referenced by fold_builtin_varargs().
|
static |
Fold __builtin_{,s,u}{add,sub,mul}{,l,ll}_overflow, either into normal arithmetics if it can never overflow, or into internal functions that return both result of arithmetics and overflowed boolean flag in a complex integer result, or some other check for overflow. Similarly fold __builtin_{add,sub,mul}_overflow_p to just the overflow checking part of that.
References arith_overflowed_p(), boolean_false_node, boolean_true_node, boolean_type_node, build1_loc(), build2_loc(), build_call_expr_internal_loc(), build_complex_type(), build_fold_indirect_ref_loc(), drop_tree_overflow(), fold_binary_loc(), fold_build2_loc(), fold_convert_loc(), gcc_unreachable, NULL_TREE, omit_one_operand_loc(), save_expr(), TREE_CODE, TREE_OVERFLOW, TREE_SIDE_EFFECTS, TREE_TYPE, and void_type_node.
Referenced by fold_builtin_3().
Return true if (optional) argument ARG1 of size ARG0 is always lock free on this architecture. If ARG1 is NULL, use typical alignment for size ARG0.
References boolean_false_node, boolean_true_node, can_atomic_load_p(), can_compare_and_swap_p(), CONVERT_EXPR_P, expand_normal(), gcc_assert, GET_MODE_ALIGNMENT, int_mode_for_size(), INTVAL, least_bit_hwi(), expand_operand::mode, NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_ALIGN, UINTVAL, and VOID_TYPE_P.
Referenced by expand_builtin_atomic_always_lock_free(), fold_builtin_2(), and fold_builtin_atomic_is_lock_free().
Return a one or zero if it can be determined that object ARG1 of size ARG is lock free on this architecture.
References boolean_true_node, fold_builtin_atomic_always_lock_free(), and NULL_TREE.
Referenced by expand_builtin_atomic_is_lock_free(), and fold_builtin_2().
|
static |
Fold __builtin_{clz,ctz,clrsb,ffs,parity,popcount}g into corresponding internal function.
References boolean_type_node, build_call_expr_internal_loc(), build_call_expr_loc(), build_int_cst(), build_nonstandard_integer_type(), build_zero_cst(), builtin_decl_explicit(), CLZ_DEFINED_VALUE_AT_ZERO, CTZ_DEFINED_VALUE_AT_ZERO, direct_internal_fn_supported_p(), END_BUILTINS, fold_build2, fold_build3, fold_builtin_bit_query(), fold_convert, gcc_assert, gcc_unreachable, integer_type_node, integer_zero_node, long_integer_type_node, long_long_integer_type_node, long_long_unsigned_type_node, long_unsigned_type_node, MAX_FIXED_MODE_SIZE, NULL_TREE, OPTIMIZE_FOR_BOTH, save_expr(), SCALAR_TYPE_MODE, wi::to_widest(), TREE_CODE, TREE_TYPE, TYPE_PRECISION, TYPE_UNSIGNED, and unsigned_type_node.
Referenced by fold_builtin_1(), fold_builtin_2(), and fold_builtin_bit_query().
Fold a CALL_EXPR with type TYPE with FN as the function expression. N arguments are passed in the array ARGARRAY. Return a folded expression or NULL_TREE if no simplification was possible.
References avoid_folding_inline_builtin(), BUILT_IN_MD, DECL_BUILT_IN_CLASS, fndecl_built_in_p(), fold_builtin_n(), get_callee_fndecl(), NULL_TREE, targetm, TREE_CODE, and TREE_OPERAND.
Referenced by dynamic_object_sizes_execute_one(), fold_build_call_array_loc(), and gimple_fold_stmt_to_constant_1().
Fold a call to builtin carg(a+bi) -> atan2(b,a).
References build_call_expr_loc(), builtin_save_expr(), fold_build1_loc(), mathfn_built_in(), NULL_TREE, SCALAR_FLOAT_TYPE_P, TREE_TYPE, and validate_arg().
Referenced by fold_builtin_1().
|
static |
Fold a call to __builtin_isnan(), __builtin_isinf, __builtin_finite. ARG is the argument for the call.
References build_call_expr_loc(), builtin_decl_explicit(), builtin_save_expr(), double_type_node, fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), gcc_unreachable, integer_minus_one_node, integer_one_node, integer_type_node, integer_zero_node, MODE_COMPOSITE_P, NULL_TREE, omit_one_operand_loc(), tree_expr_finite_p(), tree_expr_infinite_p(), tree_expr_maybe_infinite_p(), tree_expr_maybe_nan_p(), tree_expr_nan_p(), TREE_TYPE, TYPE_MODE, and validate_arg().
Referenced by fold_builtin_1().
Fold a call to __builtin_classify_type with argument ARG.
References build_int_cst(), integer_type_node, no_type_class, TREE_TYPE, and type_to_class().
Referenced by fold_builtin_0(), and fold_builtin_1().
Fold a call to __builtin_constant_p, if we know its argument ARG will evaluate to a constant.
References AGGREGATE_TYPE_P, cfun, CONSTANT_CLASS_P, folding_initializer, force_folding_builtin_constant_p, integer_one_node, integer_zero_node, integer_zerop(), NULL_TREE, POINTER_TYPE_P, STRIP_NOPS, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_SIDE_EFFECTS, and TREE_TYPE.
Referenced by fold_builtin_1().
Fold a call to builtin_expect with arguments ARG0, ARG1, ARG2, ARG3. Return NULL_TREE if no simplification is possible.
References build2(), build_builtin_expect_predicate(), COMPARISON_CLASS_P, CONVERT_EXPR_P, DECL_WEAK, fndecl_built_in_p(), fold_convert_loc(), get_callee_fndecl(), INTEGRAL_TYPE_P, NULL_TREE, save_expr(), STRIP_NOPS, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_TYPE, and VAR_OR_FUNCTION_DECL_P.
Referenced by fold_builtin_2(), fold_builtin_3(), and gimple_fold_call().
Fold a call to fabs, fabsf or fabsl with argument ARG.
References fold_build1_loc(), fold_convert_loc(), NULL_TREE, and validate_arg().
Referenced by fold_builtin_1().
|
inlinestatic |
Fold a call to __builtin_FILE to a constant string.
References build_string_literal(), LOCATION_FILE, and remap_macro_filename().
Referenced by fold_builtin_0().
Fold a call to __builtin_fpclassify(int, int, int, int, int, ...). This builtin will generate code to return the appropriate floating point classification depending on the value of the floating point number passed in. The possible return values must be supplied as int arguments to the call in the following order: FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL and FP_ZERO. The ellipses is for exactly one floating point argument which is "type generic".
References build_real(), builtin_save_expr(), dconst0, dconstinf, fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), integer_type_node, expand_operand::mode, NULL_TREE, r, real_from_string(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, tree_expr_maybe_infinite_p(), tree_expr_maybe_nan_p(), TREE_TYPE, type(), TYPE_MODE, and validate_arg().
Referenced by fold_builtin_varargs().
Fold a call to builtin frexp, we can assume the base is 2.
References build_fold_indirect_ref_loc(), build_int_cst(), build_real(), exp(), fold_build2_loc(), gcc_unreachable, integer_type_node, integer_zero_node, NULL_TREE, omit_one_operand_loc(), REAL_EXP, REAL_VALUE_TYPE, rvc_inf, rvc_nan, rvc_normal, rvc_zero, SET_REAL_EXP, STRIP_NOPS, suppress_warning(), TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MAIN_VARIANT, validate_arg(), and expand_operand::value.
Referenced by fold_builtin_2().
|
inlinestatic |
Fold a call to __builtin_FUNCTION to a constant string.
References build_string_literal(), current_function_decl, and lang_hooks::decl_printable_name.
Referenced by fold_builtin_0().
Fold a call to __builtin_inf or __builtin_huge_val.
References build_real(), dconstinf, MODE_HAS_INFINITIES, pedwarn(), and TYPE_MODE.
Referenced by fold_builtin_0().
Given a location LOC, an interclass builtin function decl FNDECL and its single argument ARG, return an folded expression computing the same, or NULL_TREE if we either couldn't or didn't want to fold (the latter happen if there's an RTL instruction available).
References build1(), build_call_expr(), build_real(), builtin_decl_explicit(), builtin_save_expr(), CASE_FLT_FN, complex_double_type_node, dconst0, DECL_FUNCTION_CODE(), double_type_node, fold_build1, fold_build1_loc(), fold_build2, fold_build3, get_max_float(), integer_type_node, interclass_mathfn_icode(), expand_operand::mode, MODE_COMPOSITE_P, NULL_TREE, r, real_from_string(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, TREE_TYPE, TYPE_MODE, and validate_arg().
Referenced by fold_builtin_1().
Fold a call to builtin isascii with argument ARG.
References build_int_cst(), fold_build2, fold_build2_loc(), HOST_WIDE_INT_UC, integer_type_node, integer_zero_node, NULL_TREE, and validate_arg().
Referenced by fold_builtin_1().
Fold a call to builtin isdigit with argument ARG.
References build_int_cst(), fold_build2, fold_build2_loc(), fold_convert_loc(), integer_type_node, NULL_TREE, lang_hooks::to_target_charset, unsigned_type_node, and validate_arg().
Referenced by fold_builtin_1().
Fold a call to __builtin_iseqsig(). ARG0 and ARG1 are the arguments. After choosing the wider floating-point type for the comparison, the code is folded to: SAVE_EXPR<ARG0> >= SAVE_EXPR<ARG1> && SAVE_EXPR<ARG0> <= SAVE_EXPR<ARG1>
References builtin_save_expr(), cmp1(), fold_build2_loc(), fold_convert_loc(), integer_type_node, NULL_TREE, TREE_CODE, TREE_TYPE, and TYPE_PRECISION.
Referenced by fold_builtin_2().
Fold a call to __builtin_LINE to an integer constant.
References build_int_cst(), and LOCATION_LINE.
Referenced by fold_builtin_0().
Fold function call to builtin memcmp with arguments ARG1 and ARG2. Return NULL_TREE if no simplification can be made.
References build1(), build_pointer_type_for_mode(), build_type_variant, fold_build2_loc(), fold_convert_loc(), integer_type_node, integer_zero_node, integer_zerop(), NULL_TREE, omit_one_operand_loc(), omit_two_operands_loc(), operand_equal_p(), ptr_mode, tree_fits_uhwi_p(), tree_to_uhwi(), unsigned_char_type_node, and validate_arg().
Referenced by fold_builtin_3().
Fold a call to builtin modf.
References build_fold_indirect_ref_loc(), build_real(), dconst0, fold_build2_loc(), NULL_TREE, real_arithmetic(), real_trunc(), REAL_VALUE_TYPE, rvc_inf, rvc_nan, rvc_normal, rvc_zero, STRIP_NOPS, suppress_warning(), TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_MAIN_VARIANT, validate_arg(), and expand_operand::value.
Referenced by fold_builtin_2().
|
static |
Folds a call EXPR (which may be null) to built-in function FNDECL. ARGS is an array of NARGS arguments. IGNORE is true if the result of the function call is ignored. This function returns NULL_TREE if no simplification was possible.
References build1(), fold_builtin_0(), fold_builtin_1(), fold_builtin_2(), fold_builtin_3(), fold_builtin_varargs(), NULL_TREE, SET_EXPR_LOCATION, and TREE_TYPE.
Referenced by fold_builtin_call_array(), fold_call_expr(), and fold_call_stmt().
Fold the next_arg or va_start call EXP. Returns true if there was an error produced. False otherwise. This is done so that we don't output the error or warning twice or three times.
References CALL_EXPR_ARG, call_expr_nargs, CONVERT_EXPR_P, current_function_decl, DECL_ARGUMENTS, DECL_REGISTER, error(), exp(), INDIRECT_REF_P, input_location, integer_zero_node, integer_zerop(), line_table, NULL, SSA_NAME_VAR, stdarg_p(), TREE_CODE, tree_last(), TREE_OPERAND, TREE_TYPE, and warning_at().
Referenced by expand_builtin(), expand_builtin_va_start(), and gimplify_call_expr().
|
static |
Fold a call to __builtin_object_size with arguments PTR and OST, if possible.
References build_int_cst_type(), compare_tree_int(), compute_builtin_object_size(), fold_convert, int_fits_type_p(), NULL_TREE, OST_DYNAMIC, size_type_node, STRIP_NOPS, TREE_CODE, tree_int_cst_sgn(), TREE_SIDE_EFFECTS, tree_to_shwi(), and validate_arg().
Referenced by fold_builtin_2().
Fold function call to builtin sincos, sincosf, or sincosl. Return NULL_TREE if no simplification can be made.
References as_combined_fn(), build2(), build_call_expr_loc(), build_complex_type(), build_fold_indirect_ref_loc(), build_pointer_type(), builtin_decl_explicit(), builtin_decl_implicit_p(), builtin_save_expr(), END_BUILTINS, fold_build1_loc(), fold_const_call(), fold_convert, function_c99_math_complex, mathfn_built_in_2(), NULL_TREE, targetm, TREE_CODE, TREE_TYPE, type(), validate_arg(), and void_type_node.
Referenced by fold_builtin_3().
Simplify a call to the strcspn builtin. S1 and S2 are the arguments to the call. Return NULL_TREE if no simplification was possible, otherwise return the simplified form of the call as a tree. The simplified form may be a constant or other expression which computes the same value, but in a more efficient manner (including calls to other builtin functions). The call may contain arguments which need to be evaluated, but which are not useful to determine the result of the call. In this case we return a chain of COMPOUND_EXPRs. The LHS of each COMPOUND_EXPR will be an argument which must be evaluated. COMPOUND_EXPRs are chained through their RHS. The RHS of the last COMPOUND_EXPR in the chain will contain the tree for the simplified form of the builtin function call.
References build_call_expr_loc(), builtin_decl_implicit(), c_getstr(), check_nul_terminated_array(), NULL_TREE, omit_one_operand_loc(), size_type_node, size_zero_node, and validate_arg().
Referenced by fold_builtin_2().
Fold a call EXPR (which may be null) to __builtin_strlen with argument ARG.
References c_strlen(), c_strlen_data::decl, EXPR_HAS_LOCATION, EXPR_LOCATION, fold_convert_loc(), input_location, NULL_TREE, UNKNOWN_LOCATION, validate_arg(), and warn_string_no_nul().
Referenced by fold_builtin_1().
Simplify a call to the strpbrk builtin. S1 and S2 are the arguments to the call, and TYPE is its return type. Return NULL_TREE if no simplification was possible, otherwise return the simplified form of the call as a tree. The simplified form may be a constant or other expression which computes the same value, but in a more efficient manner (including calls to other builtin functions). The call may contain arguments which need to be evaluated, but which are not useful to determine the result of the call. In this case we return a chain of COMPOUND_EXPRs. The LHS of each COMPOUND_EXPR will be an argument which must be evaluated. COMPOUND_EXPRs are chained through their RHS. The RHS of the last COMPOUND_EXPR in the chain will contain the tree for the simplified form of the builtin function call.
References build_call_expr_loc(), build_int_cst(), builtin_decl_implicit(), c_getstr(), fold_build_pointer_plus_hwi_loc(), fold_convert_loc(), integer_type_node, integer_zero_node, NULL, NULL_TREE, omit_one_operand_loc(), r, TREE_TYPE, and validate_arg().
Referenced by fold_builtin_2().
Simplify a call to the strspn builtin. S1 and S2 are the arguments to the call. Return NULL_TREE if no simplification was possible, otherwise return the simplified form of the call as a tree. The simplified form may be a constant or other expression which computes the same value, but in a more efficient manner (including calls to other builtin functions). The call may contain arguments which need to be evaluated, but which are not useful to determine the result of the call. In this case we return a chain of COMPOUND_EXPRs. The LHS of each COMPOUND_EXPR will be an argument which must be evaluated. COMPOUND_EXPRs are chained through their RHS. The RHS of the last COMPOUND_EXPR in the chain will contain the tree for the simplified form of the builtin function call.
References c_getstr(), check_nul_terminated_array(), NULL_TREE, omit_two_operands_loc(), size_type_node, size_zero_node, and validate_arg().
Referenced by fold_builtin_2().
Fold a call to builtin toascii with argument ARG.
References build_int_cst(), fold_build2_loc(), integer_type_node, NULL_TREE, and validate_arg().
Referenced by fold_builtin_1().
|
static |
Fold a call to an unordered comparison function such as __builtin_isgreater(). FNDECL is the FUNCTION_DECL for the function being called and ARG0 and ARG1 are the arguments for the call. UNORDERED_CODE and ORDERED_CODE are comparison codes that give the opposite of the desired result. UNORDERED_CODE is used for modes that can hold NaNs and ORDERED_CODE is used for the rest.
References fold_build1_loc(), fold_build2_loc(), fold_convert_loc(), integer_one_node, integer_zero_node, NULL_TREE, omit_two_operands_loc(), TREE_CODE, tree_expr_maybe_nan_p(), tree_expr_nan_p(), TREE_TYPE, and TYPE_PRECISION.
Referenced by fold_builtin_2().
Builtins with folding operations that operate on "..." arguments need special handling; we need to store the arguments in a convenient data structure before attempting any folding. Fortunately there are only a few builtins that fall into this category. FNDECL is the function, EXP is the CALL_EXPR for the call.
References build1(), DECL_FUNCTION_CODE(), fold_builtin_addc_subc(), fold_builtin_fpclassify(), NULL_TREE, SET_EXPR_LOCATION, suppress_warning(), and TREE_TYPE.
Referenced by fold_builtin_n().
A wrapper function for builtin folding that prevents warnings for "statement without effect" and the like, caused by removing the call node earlier than the warning is generated.
References avoid_folding_inline_builtin(), BUILT_IN_MD, CALL_EXPR_ARG, CALL_EXPR_ARGP, call_expr_nargs, CALL_EXPR_VA_ARG_PACK, DECL_BUILT_IN_CLASS, exp(), fndecl_built_in_p(), fold_builtin_n(), get_callee_fndecl(), NULL_TREE, targetm, and TREE_CODE.
Referenced by fold(), and gimplify_call_expr().
A wrapper function for builtin folding that prevents warnings for "statement without effect" and the like, caused by removing the call node earlier than the warning is generated.
References avoid_folding_inline_builtin(), BUILT_IN_MD, CAN_HAVE_LOCATION_P, DECL_BUILT_IN_CLASS, error_mark_node, EXPR_HAS_LOCATION, fndecl_built_in_p(), fold_builtin_n(), gimple_call_arg_ptr(), gimple_call_fndecl(), gimple_call_num_args(), gimple_call_va_arg_pack_p(), gimple_has_location(), gimple_location(), NULL_TREE, SET_EXPR_LOCATION, targetm, TREE_CODE, and TREE_OPERAND.
Referenced by gimple_fold_builtin().
|
static |
Return the RTL of a register in MODE generated from PREV in the previous iteration.
References candidate(), copy_to_reg(), by_pieces_prev::data, FOR_EACH_MODE_IN_CLASS, GET_MODE_CLASS, GET_MODE_SIZE(), HARD_REGISTER_P, is_a(), lowpart_subreg(), lowpart_subreg_regno(), by_pieces_prev::mode, expand_operand::mode, REG_P, REGNO, expand_operand::target, and VECTOR_MODE_P.
Referenced by builtin_memset_gen_str(), and builtin_memset_read_str().
Expand the memory expression LOC and return the appropriate memory operand for the builtin_sync operations.
References ALIAS_SET_MEMORY_BARRIER, convert_memory_address, expand_expr(), EXPAND_SUM, gen_rtx_MEM(), GET_MODE_ALIGNMENT, get_pointer_alignment(), MAX, MEM_VOLATILE_P, NULL_RTX, POINTER_TYPE_P, set_mem_addr_space(), set_mem_alias_set(), set_mem_align(), targetm, TREE_TYPE, TYPE_ADDR_SPACE, and validize_mem().
Referenced by expand_builtin_atomic_clear(), expand_builtin_atomic_compare_exchange(), expand_builtin_atomic_exchange(), expand_builtin_atomic_fetch_op(), expand_builtin_atomic_load(), expand_builtin_atomic_store(), expand_builtin_atomic_test_and_set(), expand_builtin_compare_and_swap(), expand_builtin_sync_lock_release(), expand_builtin_sync_lock_test_and_set(), expand_builtin_sync_operation(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_compare_exchange(), and expand_ifn_atomic_op_fetch_cmp_0().
|
inlinestatic |
Reconstitute a mode for a __sync intrinsic operation. Since the type of the pointer in these functions is void*, the tree optimizers may remove casts. The mode computed in expand_builtin isn't reliable either, due to __sync_bool_compare_and_swap. FCODE_DIFF should be fcode - base, where base is the FOO_1 code for the group of builtins. This gives us log2 of the mode size.
References int_mode_for_size(), and opt_mode< T >::require().
Referenced by expand_builtin().
Given an integer representing an ``enum memmodel'', verify its correctness and return the memory model enum.
References exp(), expand_normal(), INTVAL, MEMMODEL_ACQUIRE, memmodel_base(), MEMMODEL_CONSUME, MEMMODEL_LAST, MEMMODEL_MASK, MEMMODEL_SEQ_CST, targetm, and TREE_CODE.
Referenced by expand_builtin_atomic_clear(), expand_builtin_atomic_compare_exchange(), expand_builtin_atomic_exchange(), expand_builtin_atomic_fetch_op(), expand_builtin_atomic_load(), expand_builtin_atomic_signal_fence(), expand_builtin_atomic_store(), expand_builtin_atomic_test_and_set(), expand_builtin_atomic_thread_fence(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_compare_exchange(), and expand_ifn_atomic_op_fetch_cmp_0().
Get a MEM rtx for expression EXP which is the address of an operand to be used in a string instruction (cmpstrsi, cpymemsi, ..). LEN is the maximum length of the block of memory that might be accessed or NULL if unknown.
References ADDR_SPACE_GENERIC_P, build_array_type(), build_fold_addr_expr, build_int_cst(), build_range_type(), char_type_node, clear_mem_offset(), CONVERT_EXPR_P, exp(), expand_expr(), EXPAND_NORMAL, fold_build2, gcc_checking_assert, gen_rtx_MEM(), get_base_address(), get_pointer_alignment(), is_gimple_mem_ref_addr(), memory_address, NULL, NULL_RTX, POINTER_TYPE_P, ptr_mode, ptr_type_node, SAVE_EXPR_RESOLVED_P, set_mem_alias_set(), set_mem_align(), set_mem_attributes(), size_one_node, size_zero_node, sizetype, TREE_CODE, TREE_OPERAND, TREE_TYPE, and TYPE_ADDR_SPACE.
Referenced by expand_builtin_memcmp(), expand_builtin_memory_copy_args(), expand_builtin_memset_args(), expand_builtin_strcmp(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_movstr(), expand_RAWMEMCHR(), and inline_string_cmp().
unsigned int get_object_alignment | ( | tree | exp | ) |
Return the alignment in bits of EXP, an object.
References exp(), get_object_alignment_1(), and least_bit_hwi().
Referenced by copy_ref_info(), expand_assignment(), expand_expr_real_1(), gather_mem_refs_stmt(), gimplify_expr(), instrument_derefs(), instrument_expr(), not_size_aligned(), predicate_load_or_store(), ref_at_iteration(), rewrite_use_address(), vect_recog_cond_store_pattern(), vectorizable_load(), vectorizable_store(), and vn_reference_lookup_3().
For a memory reference expression EXP compute values M and N such that M divides (&EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Otherwise return false and store BITS_PER_UNIT to *alignp and any bit-offset to *bitposp.
References exp(), get_object_alignment_2(), TREE_CODE, and TREE_OPERAND.
Referenced by ao_ref_alignment(), build_ref_for_offset(), ao_compare::compare_ao_refs(), dr_analyze_innermost(), get_object_alignment(), may_be_unaligned_p(), replace_ref(), and set_mem_attributes_minus_bitpos().
bool get_object_alignment_2 | ( | tree | exp, |
unsigned int * | alignp, | ||
unsigned HOST_WIDE_INT * | bitposp, | ||
bool | addr_p ) |
Compute values M and N such that M divides (address of EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Otherwise return false and store BITS_PER_UNIT to *alignp and any bit-offset to *bitposp. Note that the address (and thus the alignment) computed here is based on the address to which a symbol resolves, whereas DECL_ALIGN is based on the address at which an object is actually located. These two addresses are not always the same. For example, on ARM targets, the address &foo of a Thumb function foo() has the lowest bit set, whereas foo() itself starts on an even address. If ADDR_P is true we are taking the address of the memory reference EXP and thus cannot rely on the access taking place.
References poly_int< N, C >::coeffs, CONSTANT_CLASS_P, DECL_ALIGN, DECL_INITIAL, DECL_P, exp(), poly_int< N, C >::force_shwi(), get_inner_reference(), get_pointer_alignment_1(), HOST_BITS_PER_INT, least_bit_hwi(), MAX, mem_ref_offset(), MIN, min_align_of_type(), offset, ptrmemfunc_vbit_in_pfn, TARGET_PTRMEMFUNC_VBIT_LOCATION, targetm, TMR_INDEX, TMR_INDEX2, TMR_STEP, TREE_CODE, tree_ctz(), TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, and TYPE_ALIGN.
Referenced by ao_ref_alignment(), get_object_alignment_1(), and get_pointer_alignment_1().
unsigned int get_pointer_alignment | ( | tree | exp | ) |
Return the alignment in bits of EXP, a pointer valued expression. The alignment returned is, by default, the alignment of the thing that EXP points to. If it is not a POINTER_TYPE, 0 is returned. Otherwise, look at the expression to see if we can do better, i.e., if the expression is actually pointing at an object whose alignment is tighter.
References ptr_info_def::align, exp(), get_pointer_alignment_1(), and least_bit_hwi().
Referenced by adjust_one_expanded_partition_var(), asan_expand_mark_ifn(), expand_builtin_memcmp(), expand_builtin_memory_chk(), expand_builtin_memory_copy_args(), expand_builtin_memset_args(), expand_builtin_strcmp(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_one_register_var(), get_builtin_sync_mem(), get_memory_rtx(), gimple_fold_builtin_clear_padding(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_memset(), gimple_stringops_transform(), strlen_pass::handle_builtin_memcmp(), simplify_builtin_call(), tree_ctz(), ubsan_expand_null_ifn(), and vectorizable_simd_clone_call().
For a pointer valued expression EXP compute values M and N such that M divides (EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Return false if the results are just a conservative approximation. If EXP is not a pointer, false is returned too.
References exp(), get_object_alignment_2(), get_pointer_alignment_1(), get_ptr_info_alignment(), HOST_BITS_PER_INT, MIN, POINTER_TYPE_P, SSA_NAME_PTR_INFO, STRIP_NOPS, TREE_CODE, tree_ctz(), TREE_INT_CST_LOW, TREE_OPERAND, and TREE_TYPE.
Referenced by dr_analyze_innermost(), get_object_alignment_2(), get_pointer_alignment(), get_pointer_alignment_1(), get_value_from_alignment(), ipa_compute_jump_functions_for_edge(), and ipa_param_adjustments::modify_call().
bool init_target_chars | ( | void | ) |
Initialize format string characters in the target charset.
References target_c, target_newline, target_percent, target_percent_c, target_percent_s, target_percent_s_newline, target_s, and lang_hooks::to_target_charset.
Referenced by gimple_fold_builtin_fprintf(), gimple_fold_builtin_printf(), gimple_fold_builtin_snprintf(), gimple_fold_builtin_snprintf_chk(), gimple_fold_builtin_sprintf(), gimple_fold_builtin_sprintf_chk(), and maybe_emit_sprintf_chk_warning().
Inline expansion of a call to str(n)cmp and memcmp, with result going to TARGET if that's convenient. If the call is not been inlined, return NULL_RTX.
References CALL_EXPR_ARG, const0_rtx, DECL_FUNCTION_CODE(), exp(), gcc_checking_assert, get_callee_fndecl(), getbyterep(), inline_string_cmp(), expand_operand::mode, NULL, NULL_RTX, NULL_TREE, optimize_insn_for_size_p(), expand_operand::target, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, TYPE_MODE, TYPE_PRECISION, and unsigned_char_type_node.
Referenced by expand_builtin_memcmp(), expand_builtin_strcmp(), and expand_builtin_strncmp().
|
static |
Expand a string compare operation using a sequence of char comparison to get rid of the calling overhead, with result going to TARGET if that's convenient. VAR_STR is the variable string source; CONST_STR is the constant string source; LENGTH is the number of chars to compare; CONST_STR_N indicates which source string is the constant string; IS_MEMCMP indicates whether it's a memcmp or strcmp. to: (assume const_str_n is 2, i.e., arg2 is a constant string) target = (int) (unsigned char) var_str[0] - (int) (unsigned char) const_str[0]; if (target != 0) goto ne_label; ... target = (int) (unsigned char) var_str[length - 2] - (int) (unsigned char) const_str[length - 2]; if (target != 0) goto ne_label; target = (int) (unsigned char) var_str[length - 1] - (int) (unsigned char) const_str[length - 1]; ne_label:
References adjust_address, as_a(), build_int_cst(), c_readstr(), CONST0_RTX, convert_modes(), emit_cmp_and_jump_insns(), emit_insn(), emit_label(), emit_move_insn(), end_sequence(), expand_simple_binop(), gen_label_rtx(), gen_reg_rtx(), get_insns(), get_memory_rtx(), GET_MODE_SIZE(), i, insns, expand_operand::mode, NULL_RTX, offset, OPTAB_WIDEN, start_sequence(), expand_operand::target, TYPE_MODE, unsigned_char_type_node, and unsigned_type_node.
Referenced by inline_expand_builtin_bytecmp().
Given an interclass math builtin decl FNDECL and it's argument ARG return an RTL instruction code that implements the functionality. If that isn't possible or available return CODE_FOR_nothing.
References CASE_FLT_FN, DECL_FUNCTION_CODE(), gcc_unreachable, optab_handler(), TREE_TYPE, TYPE_MODE, and unknown_optab.
Referenced by expand_builtin_interclass_mathfn(), and fold_builtin_interclass_mathfn().
|
static |
Return true if NAME starts with __builtin_ or __sync_.
References startswith().
Referenced by called_as_built_in().
Return true if DECL is a builtin that is not expensive, i.e., they are most probably expanded inline into reasonably simple code. This is a superset of is_simple_builtin.
References BUILT_IN_MD, BUILT_IN_NORMAL, CASE_BUILT_IN_ALLOCA, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), and is_simple_builtin().
Referenced by estimate_num_insns(), expression_expensive_p(), gimple_inexpensive_call_p(), loop_body_includes_call(), and num_calls().
Return true if DECL is a builtin that expands to a constant or similarly simple code.
References BUILT_IN_NORMAL, DECL_FUNCTION_CODE(), and fndecl_built_in_p().
Referenced by estimate_num_insns(), and is_inexpensive_builtin().
tree mathfn_built_in | ( | tree | type, |
combined_fn | fn ) |
Like mathfn_built_in_1, but always use the implicit array.
References mathfn_built_in_1().
Referenced by attempt_builtin_powi(), convert_to_integer_1(), convert_to_real_1(), execute_cse_sincos_1(), expand_builtin_int_roundingfn(), expand_pow_as_sqrts(), fold_builtin_carg(), gimple_expand_builtin_cabs(), and gimple_expand_builtin_pow().
tree mathfn_built_in | ( | tree | type, |
enum built_in_function | fn ) |
Like mathfn_built_in_1, but take a built_in_function and always use the implicit array.
References as_combined_fn(), and mathfn_built_in_1().
|
static |
Return mathematic function equivalent to FN but operating directly on TYPE, if available. If IMPLICIT_P is true use the implicit builtin declaration, otherwise use the explicit declaration. If we can't do the conversion, return null.
References builtin_decl_explicit(), builtin_decl_implicit_p(), END_BUILTINS, mathfn_built_in_2(), and NULL_TREE.
Referenced by expand_builtin_int_roundingfn_2(), mathfn_built_in(), mathfn_built_in(), and mathfn_built_in_explicit().
|
static |
Return a function equivalent to FN but operating on floating-point values of type TYPE, or END_BUILTINS if no such function exists. This is purely an operation on function codes; it does not guarantee that the target actually has an implementation of the function.
References double_type_node, END_BUILTINS, float128_type_node, float128x_type_node, float16_type_node, float32_type_node, float32x_type_node, float64_type_node, float64x_type_node, float_type_node, long_double_type_node, SEQ_OF_CASE_MATHFN, and TYPE_MAIN_VARIANT.
Referenced by fold_builtin_sincos(), and mathfn_built_in_1().
tree mathfn_built_in_explicit | ( | tree | type, |
combined_fn | fn ) |
Like mathfn_built_in_1, but always use the explicit array.
References mathfn_built_in_1().
tree mathfn_built_in_type | ( | combined_fn | fn | ) |
Return the type associated with a built in function, i.e., the one to be passed to mathfn_built_in to get the type-specific function.
Similar to above, but appends _R after any F/L suffix.
References NULL_TREE, and SEQ_OF_CASE_MATHFN.
Referenced by execute_cse_sincos_1().
Emit a call to __builtin___clear_cache, unless the target specifies it as do-nothing. This function can be used by trampoline finalizers to duplicate the effects of expanding a call to the clear_cache builtin.
References begin(), CONST_INT_P, create_address_operand(), end(), gcc_assert, GET_MODE, maybe_expand_insn(), ptr_mode, and targetm.
Referenced by expand_builtin___clear_cache().
|
static |
Emit warning if a buffer overflow is detected at compile time.
References access_read_write, access_write_only, CALL_EXPR_ARG, check_access(), check_strncat_sizes(), exp(), gcc_unreachable, expand_operand::mode, and NULL_TREE.
Referenced by expand_builtin().
|
static |
Emit warning if a buffer overflow is detected at compile time in __sprintf_chk/__vsprintf_chk calls.
References access_write_only, build_int_cstu(), c_getstr(), c_strlen(), CALL_EXPR_ARG, call_expr_nargs, check_access(), exp(), fold_build2, init_target_chars(), integer_all_onesp(), NULL, NULL_TREE, POINTER_TYPE_P, size_one_node, size_type_node, target_percent, target_percent_s, tree_fits_uhwi_p(), and TREE_TYPE.
Referenced by expand_builtin().
|
inlinestatic |
Referenced by builtin_mathfn_code(), and validate_arglist().
Returns true is EXP represents data that would potentially reside in a readonly section.
References decl_readonly_section(), exp(), get_base_address(), STRIP_NOPS, TREE_CODE, TREE_OPERAND, TREE_STATIC, and VAR_P.
Referenced by expand_builtin_memory_chk(), and gimple_fold_builtin_memory_op().
internal_fn replacement_internal_fn | ( | gcall * | call | ) |
If CALL is a call to a BUILT_IN_NORMAL function that could be replaced on the current target by a call to an internal function, return the code of that internal function, otherwise return IFN_LAST. The caller is responsible for ensuring that any side-effects of the built-in call are dealt with correctly. E.g. if CALL sets errno, the caller must decide that the errno result isn't needed or make it available in some other way.
References associated_internal_fn(), bb_optimization_type(), BUILT_IN_NORMAL, direct_internal_fn_supported_p(), direct_internal_fn_types(), gimple_bb(), gimple_call_builtin_p(), and gimple_call_fndecl().
Referenced by can_use_internal_fn(), expand_call_stmt(), and use_internal_fn().
Create a vector describing the result block RESULT. If SAVEP is true, the result block is used to save the values; otherwise it is used to restore the values.
References adjust_address, apply_result_mode, CEIL, gen_rtvec_v(), gen_rtx_REG(), GET_MODE_ALIGNMENT, GET_MODE_SIZE(), and INCOMING_REGNO.
Referenced by expand_builtin_apply(), and expand_builtin_return().
|
static |
Construct a new CALL_EXPR using the tail of the argument list of EXP along with N new arguments specified as the "..." parameters. SKIP is the number of arguments in EXP to be omitted. This function is used to do varargs-to-varargs transformations.
References ap, CALL_EXPR_ARGP, call_expr_nargs, exp(), and rewrite_call_expr_valist().
Referenced by expand_builtin_fork_or_exec().
|
static |
Construct a new CALL_EXPR to FNDECL using the tail of the argument list ARGS along with N new arguments in NEWARGS. SKIP is the number of arguments in ARGS to be omitted. OLDNARGS is the number of elements in ARGS.
References build_call_expr_loc_array(), and i.
Referenced by rewrite_call_expr().
Given a trampoline address, make sure it satisfies TRAMPOLINE_ALIGNMENT.
References expand_simple_binop(), gen_int_mode(), gen_reg_rtx(), OPTAB_LIB_WIDEN, and TRAMPOLINE_ALIGNMENT.
Referenced by expand_builtin_adjust_trampoline(), and expand_builtin_init_trampoline().
void set_builtin_user_assembler_name | ( | tree | decl, |
const char * | asmspec ) |
Look up the function in builtin_decl that corresponds to DECL and set ASMSPEC as its user assembler name. DECL must be a function decl that declares a builtin.
References BITS_PER_WORD, BUILT_IN_NORMAL, builtin_decl_explicit(), DECL_FUNCTION_CODE(), fndecl_built_in_p(), gcc_assert, int_mode_for_size(), INT_TYPE_SIZE, opt_mode< T >::require(), set_optab_libfunc(), set_user_assembler_libfunc(), and set_user_assembler_name().
Make it easier for the backends by protecting the valist argument from multiple evaluations.
References build_fold_addr_expr_with_type_loc(), build_int_cst(), build_pointer_type(), cfun, fold_build1_loc(), fold_build2_loc(), save_expr(), targetm, TREE_CODE, TREE_SIDE_EFFECTS, and TREE_TYPE.
Referenced by expand_builtin_va_copy(), and expand_builtin_va_start().
tree std_build_builtin_va_list | ( | void | ) |
The "standard" definition of va_list is void*.
References ptr_type_node.
The "standard" type of va_list is va_list_type_node.
References NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, type(), TYPE_MAIN_VARIANT, and va_list_type_node.
The "standard" implementation of va_start: just assign `nextarg' to the variable.
References convert_move(), expand_expr(), EXPAND_WRITE, and NULL_RTX.
Referenced by expand_builtin_va_start().
The "standard" abi va_list is va_list_type_node.
References va_list_type_node.
unsigned string_length | ( | const void * | ptr, |
unsigned | eltsize, | ||
unsigned | maxelts ) |
Return the number of leading non-zero elements in the sequence [ PTR, PTR + MAXELTS ) where each element's size is ELTSIZE bytes. ELTSIZE must be a power of 2 less than 8. Used by c_strlen.
References gcc_checking_assert.
Referenced by c_strlen(), and gimple_fold_builtin_memchr().
|
static |
Cast a target constant CST to target CHAR and if that value fits into host char type, return zero and put that value into variable pointed to by P.
References CHAR_TYPE_SIZE, HOST_BITS_PER_CHAR, HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1U, TREE_CODE, and TREE_INT_CST_LOW.
Referenced by expand_builtin_memset_args().
Return true if T is a constant and the value cast to a target char can be represented by a host char. Store the casted char constant in *P if so.
References CHAR_TYPE_SIZE, HOST_BITS_PER_CHAR, real_format::p, tree_fits_uhwi_p(), and tree_to_uhwi().
Referenced by fold_const_call(), fold_const_call(), gimple_fold_builtin_memchr(), and gimple_fold_builtin_strchr().
bool try_store_by_multiple_pieces | ( | rtx | to, |
rtx | len, | ||
unsigned int | ctz_len, | ||
unsigned HOST_WIDE_INT | min_len, | ||
unsigned HOST_WIDE_INT | max_len, | ||
rtx | val, | ||
char | valc, | ||
unsigned int | align ) |
Try to store VAL (or, if NULL_RTX, VALC) in LEN bytes starting at TO. Return TRUE if successful, FALSE otherwise. TO is assumed to be aligned at an ALIGN-bits boundary. LEN must be a multiple of 1<<CTZ_LEN between MIN_LEN and MAX_LEN. The strategy is to issue one store_by_pieces for each power of two, from most to least significant, guarded by a test on whether there are at least that many bytes left to copy in LEN. ??? Should we skip some powers of two in favor of loops? Maybe start at the max of TO/LEN/word alignment, at least when optimizing for size, instead of ensuring O(log len) dynamic compares?
References builtin_memset_gen_str(), builtin_memset_read_str(), can_store_by_multiple_pieces(), can_store_by_pieces(), change_address(), clear_mem_offset(), convert_to_mode(), copy_addr_to_reg(), copy_to_mode_reg(), emit_cmp_and_jump_insns(), emit_label(), emit_move_insn(), profile_probability::even(), floor_log2(), force_operand(), force_reg(), gcc_checking_assert, GEN_INT, gen_int_mode(), gen_label_rtx(), GET_MODE, HOST_WIDE_INT_1U, i, ILSOP_MEMSET, profile_probability::likely(), MAX, NULL, NULL_RTX, plus_constant(), ptr_mode, replace_equiv_address(), RETURN_BEGIN, RETURN_END, set_mem_align(), store_by_pieces(), TYPE_MODE, unsigned_char_type_node, and XEXP.
Referenced by clear_storage_hints(), and expand_builtin_memset_args().
int type_to_class | ( | tree | type | ) |
Used by expand_builtin_classify_type and fold_builtin_classify_type.
References array_type_class, bitint_type_class, boolean_type_class, complex_type_class, enumeral_type_class, function_type_class, integer_type_class, lang_type_class, method_type_class, no_type_class, offset_type_class, opaque_type_class, pointer_type_class, real_type_class, record_type_class, reference_type_class, string_type_class, TREE_CODE, TYPE_STRING_FLAG, union_type_class, vector_type_class, and void_type_class.
Referenced by expand_builtin_classify_type(), and fold_builtin_classify_type().
|
static |
Validate a single argument ARG against a tree code CODE representing a type. Return true when argument is valid.
References INTEGRAL_TYPE_P, POINTER_TYPE_P, TREE_CODE, and TREE_TYPE.
Referenced by fold_builtin_1(), fold_builtin_2(), fold_builtin_3(), fold_builtin_abs(), fold_builtin_carg(), fold_builtin_classify(), fold_builtin_fabs(), fold_builtin_fpclassify(), fold_builtin_frexp(), fold_builtin_interclass_mathfn(), fold_builtin_isascii(), fold_builtin_isdigit(), fold_builtin_memcmp(), fold_builtin_modf(), fold_builtin_object_size(), fold_builtin_sincos(), fold_builtin_strcspn(), fold_builtin_strlen(), fold_builtin_strpbrk(), fold_builtin_strspn(), fold_builtin_toascii(), validate_arglist(), and validate_gimple_arglist().
|
static |
This function validates the types of a function call argument list against a specified list of tree_codes. If the last specifier is a 0, that represents an ellipsis, otherwise the last specifier must be a VOID_TYPE.
References ap, bitmap_bit_p, bitmap_empty_p(), BITMAP_FREE, CALL_EXPR_FN, end(), get_nonnull_args(), integer_zerop(), more_const_call_expr_args_p(), TREE_TYPE, and validate_arg().
Referenced by expand_builtin(), expand_builtin___clear_cache(), expand_builtin_adjust_descriptor(), expand_builtin_adjust_trampoline(), expand_builtin_alloca(), expand_builtin_bswap(), expand_builtin_bzero(), expand_builtin_cexpi(), expand_builtin_copysign(), expand_builtin_fabs(), expand_builtin_feclear_feraise_except(), expand_builtin_fegetround(), expand_builtin_init_descriptor(), expand_builtin_init_trampoline(), expand_builtin_int_roundingfn(), expand_builtin_int_roundingfn_2(), expand_builtin_interclass_mathfn(), expand_builtin_issignaling(), expand_builtin_mathfn_3(), expand_builtin_mathfn_ternary(), expand_builtin_memcmp(), expand_builtin_memcpy(), expand_builtin_memmove(), expand_builtin_memory_chk(), expand_builtin_mempcpy(), expand_builtin_memset(), expand_builtin_nonlocal_goto(), expand_builtin_object_size(), expand_builtin_powi(), expand_builtin_prefetch(), expand_builtin_set_thread_pointer(), expand_builtin_signbit(), expand_builtin_sincos(), expand_builtin_stpcpy_1(), expand_builtin_strcmp(), expand_builtin_strcpy(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_builtin_strnlen(), expand_builtin_strub_enter(), expand_builtin_strub_leave(), expand_builtin_strub_update(), expand_builtin_thread_pointer(), and expand_builtin_unop().
This function validates the types of a function call argument list against a specified list of tree_codes. If the last specifier is a 0, that represents an ellipses, otherwise the last specifier must be a VOID_TYPE. This is the GIMPLE version of validate_arglist. Eventually we want to completely convert builtins.cc to work from GIMPLEs and the tree based validate_arglist will then be removed.
References ap, end(), gimple_call_arg(), gimple_call_num_args(), i, and validate_arg().
Referenced by interesting_stringop_to_profile_p().
const char* const built_in_class_names[BUILT_IN_LAST] = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"} |
Define the names of the builtin function types and codes.
Referenced by print_node().
const char* built_in_names[(int) END_BUILTINS] |
Referenced by build_common_builtin_nodes(), gimple_stringops_transform(), and print_node().
builtin_info_type builtin_info[(int) END_BUILTINS] |
Setup an array of builtin_info_type, make sure each element decl is initialized to NULL_TREE.
struct target_builtins default_target_builtins |
Expand builtin functions. Copyright (C) 1988-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Legacy warning! Please add no further builtin simplifications here (apart from pure constant folding) - builtin simplifications should go to match.pd or gimple-fold.cc instead.
bool force_folding_builtin_constant_p |
Non-zero if __builtin_constant_p should be folded right away.
Referenced by fold_builtin_constant_p().
|
static |
Alias set used for setjmp buffer.
Referenced by expand_builtin_longjmp(), and expand_builtin_setjmp_setup().
|
static |
Referenced by init_target_chars().
unsigned HOST_WIDE_INT target_newline |
Referenced by gimple_fold_builtin_printf(), and init_target_chars().
unsigned HOST_WIDE_INT target_percent |
char target_percent_c[3] |
Referenced by gimple_fold_builtin_fprintf(), gimple_fold_builtin_printf(), and init_target_chars().
char target_percent_s[3] |
char target_percent_s_newline[4] |
Referenced by gimple_fold_builtin_printf(), and init_target_chars().
|
static |
Referenced by init_target_chars().