GCC Middle and Back End API Reference
builtins.cc File 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)   #X,
 
#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)    CASE_FLT_FN (BUILT_IN_##NAME): return IFN_##NAME;
 
#define DEF_INTERNAL_FLT_FLOATN_FN(NAME, FLAGS, OPTAB, TYPE)
 
#define DEF_INTERNAL_INT_FN(NAME, FLAGS, OPTAB, TYPE)    CASE_INT_FN (BUILT_IN_##NAME): return IFN_##NAME;
 
#define STACK_TOPS   GT
 
#define STACK_UNSIGNED   true
 

Functions

static int target_char_cast (tree, char *)
 
static int apply_args_size (void)
 
static int apply_result_size (void)
 
static rtx result_vector (int, rtx)
 
static void expand_builtin_prefetch (tree)
 
static rtx expand_builtin_apply_args (void)
 
static rtx expand_builtin_apply_args_1 (void)
 
static rtx expand_builtin_apply (rtx, rtx, rtx)
 
static void expand_builtin_return (rtx)
 
static rtx expand_builtin_classify_type (tree)
 
static rtx expand_builtin_mathfn_3 (tree, rtx, rtx)
 
static rtx expand_builtin_mathfn_ternary (tree, rtx, rtx)
 
static rtx expand_builtin_interclass_mathfn (tree, rtx)
 
static rtx expand_builtin_sincos (tree)
 
static rtx expand_builtin_fegetround (tree, rtx, machine_mode)
 
static rtx expand_builtin_feclear_feraise_except (tree, rtx, machine_mode, optab)
 
static rtx expand_builtin_cexpi (tree, rtx)
 
static rtx expand_builtin_issignaling (tree, rtx)
 
static rtx expand_builtin_int_roundingfn (tree, rtx)
 
static rtx expand_builtin_int_roundingfn_2 (tree, rtx)
 
static rtx expand_builtin_next_arg (void)
 
static rtx expand_builtin_va_start (tree)
 
static rtx expand_builtin_va_end (tree)
 
static rtx expand_builtin_va_copy (tree)
 
static rtx inline_expand_builtin_bytecmp (tree, rtx)
 
static rtx expand_builtin_strcmp (tree, rtx)
 
static rtx expand_builtin_strncmp (tree, rtx, machine_mode)
 
static rtx expand_builtin_memcpy (tree, rtx)
 
static rtx expand_builtin_memory_copy_args (tree dest, tree src, tree len, rtx target, tree exp, memop_ret retmode, bool might_overlap)
 
static rtx expand_builtin_memmove (tree, rtx)
 
static rtx expand_builtin_mempcpy (tree, rtx)
 
static rtx expand_builtin_mempcpy_args (tree, tree, tree, rtx, tree, memop_ret)
 
static rtx expand_builtin_strcpy (tree, rtx)
 
static rtx expand_builtin_strcpy_args (tree, tree, tree, rtx)
 
static rtx expand_builtin_stpcpy (tree, rtx, machine_mode)
 
static rtx expand_builtin_strncpy (tree, rtx)
 
static rtx expand_builtin_memset_args (tree, tree, tree, rtx, machine_mode, tree)
 
static rtx expand_builtin_bzero (tree)
 
static rtx expand_builtin_strlen (tree, rtx, machine_mode)
 
static rtx expand_builtin_strnlen (tree, rtx, machine_mode)
 
static rtx expand_builtin_alloca (tree)
 
static rtx expand_builtin_unop (machine_mode, tree, rtx, rtx, optab)
 
static rtx expand_builtin_frame_address (tree, tree)
 
static rtx expand_builtin_stack_address ()
 
static tree stabilize_va_list_loc (location_t, tree, int)
 
static rtx expand_builtin_expect (tree, rtx)
 
static rtx expand_builtin_expect_with_probability (tree, rtx)
 
static tree fold_builtin_constant_p (tree)
 
static tree fold_builtin_classify_type (tree)
 
static tree fold_builtin_strlen (location_t, tree, tree, tree)
 
static tree fold_builtin_inf (location_t, tree, int)
 
static tree rewrite_call_expr (location_t, tree, int, tree, int,...)
 
static bool validate_arg (const_tree, enum tree_code code)
 
static rtx expand_builtin_fabs (tree, rtx, rtx)
 
static rtx expand_builtin_signbit (tree, rtx)
 
static tree fold_builtin_memcmp (location_t, tree, tree, tree)
 
static tree fold_builtin_isascii (location_t, tree)
 
static tree fold_builtin_toascii (location_t, tree)
 
static tree fold_builtin_isdigit (location_t, tree)
 
static tree fold_builtin_fabs (location_t, tree, tree)
 
static tree fold_builtin_abs (location_t, tree, tree)
 
static tree fold_builtin_unordered_cmp (location_t, tree, tree, tree, enum tree_code, enum tree_code)
 
static tree fold_builtin_iseqsig (location_t, tree, tree)
 
static tree fold_builtin_varargs (location_t, tree, tree *, int)
 
static tree fold_builtin_strpbrk (location_t, tree, tree, tree, tree)
 
static tree fold_builtin_strspn (location_t, tree, tree, tree)
 
static tree fold_builtin_strcspn (location_t, tree, tree, tree)
 
static rtx expand_builtin_object_size (tree)
 
static rtx expand_builtin_memory_chk (tree, rtx, machine_mode, enum built_in_function)
 
static void maybe_emit_chk_warning (tree, enum built_in_function)
 
static void maybe_emit_sprintf_chk_warning (tree, enum built_in_function)
 
static tree fold_builtin_object_size (tree, tree, enum built_in_function)
 
static tree do_mpfr_remquo (tree, tree, tree)
 
static tree do_mpfr_lgamma_r (tree, tree, tree)
 
static void expand_builtin_sync_synchronize (void)
 
static bool is_builtin_name (const char *name)
 
bool called_as_built_in (tree node)
 
bool get_object_alignment_2 (tree exp, unsigned int *alignp, unsigned HOST_WIDE_INT *bitposp, bool addr_p)
 
bool get_object_alignment_1 (tree exp, unsigned int *alignp, unsigned HOST_WIDE_INT *bitposp)
 
unsigned int get_object_alignment (tree exp)
 
bool get_pointer_alignment_1 (tree exp, unsigned int *alignp, unsigned HOST_WIDE_INT *bitposp)
 
unsigned int get_pointer_alignment (tree exp)
 
unsigned string_length (const void *ptr, unsigned eltsize, unsigned maxelts)
 
tree c_strlen (tree arg, int only_value, c_strlen_data *data, unsigned eltsize)
 
rtx c_readstr (const char *str, fixed_size_mode mode, bool null_terminated_p)
 
static tree builtin_save_expr (tree exp)
 
static rtx expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
 
void expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label)
 
void expand_builtin_setjmp_receiver (rtx receiver_label)
 
static void expand_builtin_longjmp (rtx buf_addr, rtx value)
 
static bool more_const_call_expr_args_p (const const_call_expr_arg_iterator *iter)
 
static bool validate_arglist (const_tree callexpr,...)
 
static rtx expand_builtin_nonlocal_goto (tree exp)
 
void expand_builtin_update_setjmp_buf (rtx buf_addr)
 
rtx get_memory_rtx (tree exp, tree len)
 
int type_to_class (tree type)
 
static built_in_function mathfn_built_in_2 (tree type, combined_fn fn)
 
static tree mathfn_built_in_1 (tree type, combined_fn fn, bool implicit_p)
 
tree mathfn_built_in (tree type, combined_fn fn)
 
tree mathfn_built_in_explicit (tree type, combined_fn fn)
 
tree mathfn_built_in (tree type, enum built_in_function fn)
 
tree mathfn_built_in_type (combined_fn fn)
 
static internal_fn associated_internal_fn (built_in_function fn, tree return_type)
 
internal_fn associated_internal_fn (tree fndecl)
 
internal_fn associated_internal_fn (combined_fn cfn, tree return_type)
 
internal_fn replacement_internal_fn (gcall *call)
 
static enum insn_code interclass_mathfn_icode (tree arg, tree fndecl)
 
static tree build_call_nofold_loc (location_t loc, tree fndecl, int n,...)
 
static rtx expand_builtin_powi (tree exp, rtx target)
 
static rtx builtin_memcpy_read_str (void *data, void *, HOST_WIDE_INT offset, fixed_size_mode mode)
 
static void determine_block_size (tree len, rtx len_rtx, unsigned HOST_WIDE_INT *min_size, unsigned HOST_WIDE_INT *max_size, unsigned HOST_WIDE_INT *probable_max_size)
 
static rtx expand_movstr (tree dest, tree src, rtx target, memop_ret retmode)
 
static rtx expand_builtin_stpcpy_1 (tree exp, rtx target, machine_mode mode)
 
rtx builtin_strncpy_read_str (void *data, void *, HOST_WIDE_INT offset, fixed_size_mode mode)
 
static bool check_strncat_sizes (tree exp, tree objsize)
 
static rtx gen_memset_value_from_prev (by_pieces_prev *prev, fixed_size_mode mode)
 
rtx builtin_memset_read_str (void *data, void *prev, HOST_WIDE_INT offset, fixed_size_mode mode)
 
static rtx builtin_memset_gen_str (void *data, void *prev, HOST_WIDE_INT offset, fixed_size_mode mode)
 
rtx expand_builtin_memset (tree exp, rtx target, machine_mode mode)
 
static bool can_store_by_multiple_pieces (unsigned HOST_WIDE_INT bits, by_pieces_constfn constfun, void *constfundata, unsigned int align, bool memsetp, unsigned HOST_WIDE_INT len)
 
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)
 
static rtx expand_cmpstr (insn_code icode, rtx target, rtx arg1_rtx, rtx arg2_rtx, HOST_WIDE_INT align)
 
static rtx expand_builtin_memcmp (tree exp, rtx target, bool result_eq)
 
rtx expand_builtin_saveregs (void)
 
tree std_build_builtin_va_list (void)
 
tree std_fn_abi_va_list (tree fndecl)
 
tree std_canonical_va_list_type (tree type)
 
void std_expand_builtin_va_start (tree valist, rtx nextarg)
 
static rtx expand_builtin_strub_enter (tree exp)
 
static rtx expand_builtin_strub_update (tree exp)
 
static rtx expand_builtin_strub_leave (tree exp)
 
static rtx expand_asan_emit_allocas_unpoison (tree exp)
 
static rtx expand_builtin_bswap (machine_mode target_mode, tree exp, rtx target, rtx subtarget)
 
static rtx expand_builtin_assume_aligned (tree exp, rtx target)
 
void expand_builtin_trap (void)
 
static void expand_builtin_unreachable (void)
 
static rtx expand_builtin_copysign (tree exp, rtx target, rtx subtarget)
 
void default_emit_call_builtin___clear_cache (rtx begin, rtx end)
 
void maybe_emit_call_builtin___clear_cache (rtx begin, rtx end)
 
static void expand_builtin___clear_cache (tree exp)
 
static rtx round_trampoline_addr (rtx tramp)
 
static rtx expand_builtin_init_trampoline (tree exp, bool onstack)
 
static rtx expand_builtin_adjust_trampoline (tree exp)
 
static rtx expand_builtin_init_descriptor (tree exp)
 
static rtx expand_builtin_adjust_descriptor (tree exp)
 
static rtx expand_builtin_fork_or_exec (tree fn, tree exp, rtx target, int ignore)
 
static machine_mode get_builtin_sync_mode (int fcode_diff)
 
static rtx get_builtin_sync_mem (tree loc, machine_mode mode)
 
static rtx expand_expr_force_mode (tree exp, machine_mode mode)
 
static rtx expand_builtin_sync_operation (machine_mode mode, tree exp, enum rtx_code code, bool after, rtx target)
 
static rtx expand_builtin_compare_and_swap (machine_mode mode, tree exp, bool is_bool, rtx target)
 
static rtx expand_builtin_sync_lock_test_and_set (machine_mode mode, tree exp, rtx target)
 
static void expand_builtin_sync_lock_release (machine_mode mode, tree exp)
 
static enum memmodel get_memmodel (tree exp)
 
static rtx expand_builtin_atomic_exchange (machine_mode mode, tree exp, rtx target)
 
static rtx expand_builtin_atomic_compare_exchange (machine_mode mode, tree exp, rtx target)
 
static void expand_ifn_atomic_compare_exchange_into_call (gcall *call, machine_mode mode)
 
void expand_ifn_atomic_compare_exchange (gcall *call)
 
static rtx expand_builtin_atomic_load (machine_mode mode, tree exp, rtx target)
 
static rtx expand_builtin_atomic_store (machine_mode mode, tree exp)
 
static rtx expand_builtin_atomic_fetch_op (machine_mode mode, tree exp, rtx target, enum rtx_code code, bool fetch_after, bool ignore, enum built_in_function ext_call)
 
void expand_ifn_atomic_bit_test_and (gcall *call)
 
void expand_ifn_atomic_op_fetch_cmp_0 (gcall *call)
 
static rtx expand_builtin_atomic_clear (tree exp)
 
static rtx expand_builtin_atomic_test_and_set (tree exp, rtx target)
 
static tree fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
 
static rtx expand_builtin_atomic_always_lock_free (tree exp)
 
static tree fold_builtin_atomic_is_lock_free (tree arg0, tree arg1)
 
static rtx expand_builtin_atomic_is_lock_free (tree exp)
 
static void expand_builtin_atomic_thread_fence (tree exp)
 
static void expand_builtin_atomic_signal_fence (tree exp)
 
static rtx expand_builtin_thread_pointer (tree exp, rtx target)
 
static void expand_builtin_set_thread_pointer (tree exp)
 
static void expand_stack_restore (tree var)
 
static rtx expand_stack_save (void)
 
static rtx expand_builtin_goacc_parlevel_id_size (tree exp, rtx target, int ignore)
 
static rtx inline_string_cmp (rtx target, tree var_str, const char *const_str, unsigned HOST_WIDE_INT length, int const_str_n, machine_mode mode)
 
static rtx expand_speculation_safe_value (machine_mode mode, tree exp, rtx target, bool ignore)
 
rtx expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, int ignore)
 
enum built_in_function builtin_mathfn_code (const_tree t)
 
static tree build_builtin_expect_predicate (location_t loc, tree pred, tree expected, tree predictor, tree probability)
 
tree fold_builtin_expect (location_t loc, tree arg0, tree arg1, tree arg2, tree arg3)
 
static tree fold_builtin_sincos (location_t loc, tree arg0, tree arg1, tree arg2)
 
static tree fold_builtin_carg (location_t loc, tree arg, tree type)
 
static tree fold_builtin_frexp (location_t loc, tree arg0, tree arg1, tree rettype)
 
static tree fold_builtin_modf (location_t loc, tree arg0, tree arg1, tree rettype)
 
static tree fold_builtin_interclass_mathfn (location_t loc, tree fndecl, tree arg)
 
static tree fold_builtin_classify (location_t loc, tree fndecl, tree arg, int builtin_index)
 
static tree fold_builtin_fpclassify (location_t loc, tree *args, int nargs)
 
static tree fold_builtin_arith_overflow (location_t loc, enum built_in_function fcode, tree arg0, tree arg1, tree arg2)
 
static tree fold_builtin_bit_query (location_t loc, enum built_in_function fcode, tree arg0, tree arg1)
 
static tree fold_builtin_addc_subc (location_t loc, enum built_in_function fcode, tree *args)
 
static tree fold_builtin_FILE (location_t loc)
 
static tree fold_builtin_FUNCTION ()
 
static tree fold_builtin_LINE (location_t loc, tree type)
 
static tree fold_builtin_0 (location_t loc, tree fndecl)
 
static tree fold_builtin_1 (location_t loc, tree expr, tree fndecl, tree arg0)
 
static tree fold_builtin_2 (location_t loc, tree expr, tree fndecl, tree arg0, tree arg1)
 
static tree fold_builtin_3 (location_t loc, tree fndecl, tree arg0, tree arg1, tree arg2)
 
static tree fold_builtin_n (location_t loc, tree expr, tree fndecl, tree *args, int nargs, bool)
 
static tree rewrite_call_expr_valist (location_t loc, int oldnargs, tree *args, int skip, tree fndecl, int n, va_list newargs)
 
bool avoid_folding_inline_builtin (tree fndecl)
 
tree fold_call_expr (location_t loc, tree exp, bool ignore)
 
tree fold_builtin_call_array (location_t loc, tree, tree fn, int n, tree *argarray)
 
bool validate_gimple_arglist (const gcall *call,...)
 
rtx default_expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, int ignore)
 
bool readonly_data_expr (tree exp)
 
bool fold_builtin_next_arg (tree exp, bool va_start_p)
 
bool init_target_chars (void)
 
static tree do_mpfr_ckconv (mpfr_srcptr m, tree type, int inexact)
 
static tree do_mpc_ckconv (mpc_srcptr m, tree type, int inexact, int force_convert)
 
tree do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite, int(*func)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t))
 
tree fold_call_stmt (gcall *stmt, bool ignore)
 
void set_builtin_user_assembler_name (tree decl, const char *asmspec)
 
bool is_simple_builtin (tree decl)
 
bool is_inexpensive_builtin (tree decl)
 
bool target_char_cst_p (tree t, char *p)
 
bool builtin_with_linkage_p (tree decl)
 
attr_fnspec builtin_fnspec (tree callee)
 

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 charbuilt_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
 

Macro Definition Documentation

◆ apply_args_mode

#define apply_args_mode    (this_target_builtins->x_apply_args_mode)

◆ apply_result_mode

#define apply_result_mode    (this_target_builtins->x_apply_result_mode)

◆ CASE_MATHFN [1/2]

#define CASE_MATHFN ( MATHFN)
Value:
fcodel = BUILT_IN_##MATHFN##L ; break;
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
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.   

◆ CASE_MATHFN [2/2]

#define CASE_MATHFN ( MATHFN)
Value:
return double_type_node; \
return float_type_node; \
#define float_type_node
Definition tree.h:4453
#define double_type_node
Definition tree.h:4454
#define long_double_type_node
Definition tree.h:4455
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.   

◆ CASE_MATHFN_FLOATN [1/2]

#define CASE_MATHFN_FLOATN ( MATHFN)
Value:
Similar to the above, but also add support for the _Float<N> and _Float<N>X
types.   

◆ CASE_MATHFN_FLOATN [2/2]

#define CASE_MATHFN_FLOATN ( MATHFN)
Value:
#define CASE_MATHFN(MATHFN)
Definition builtins.cc:1908
#define float32_type_node
Definition tree.h:4467
#define float32x_type_node
Definition tree.h:4470
#define float16_type_node
Definition tree.h:4466
#define float64x_type_node
Definition tree.h:4471
#define float128x_type_node
Definition tree.h:4472
#define float128_type_node
Definition tree.h:4469
#define float64_type_node
Definition tree.h:4468
Similar to the above, but also add support for the _Float<N> and _Float<N>X
types.   

◆ CASE_MATHFN_REENT [1/2]

#define CASE_MATHFN_REENT ( MATHFN)
Value:
Similar to above, but appends _R after any F/L suffix.   

◆ CASE_MATHFN_REENT [2/2]

#define CASE_MATHFN_REENT ( MATHFN)
Value:
Similar to above, but appends _R after any F/L suffix.   

◆ DEF_BUILTIN

#define DEF_BUILTIN ( X,
N,
C,
T,
LT,
B,
F,
NA,
AT,
IM,
COND )   #X,

◆ DEF_INTERNAL_FLT_FLOATN_FN

#define DEF_INTERNAL_FLT_FLOATN_FN ( NAME,
FLAGS,
OPTAB,
TYPE )
Value:
@ NAME
Definition tree-ssa-pre.cc:242
#define CASE_FLT_FN(FN)
Definition tree.h:310

◆ DEF_INTERNAL_FLT_FN

#define DEF_INTERNAL_FLT_FN ( NAME,
FLAGS,
OPTAB,
TYPE )    CASE_FLT_FN (BUILT_IN_##NAME): return IFN_##NAME;

◆ DEF_INTERNAL_INT_FN

#define DEF_INTERNAL_INT_FN ( NAME,
FLAGS,
OPTAB,
TYPE )    CASE_INT_FN (BUILT_IN_##NAME): return IFN_##NAME;

◆ saved_apply_args_size

#define saved_apply_args_size    (delta_type<int> (this_target_builtins->x_apply_args_size_plus_one, -1))

Referenced by apply_args_size().

◆ saved_apply_result_size

#define saved_apply_result_size    (delta_type<int> (this_target_builtins->x_apply_result_size_plus_one, -1))

Referenced by apply_result_size().

◆ SEQ_OF_CASE_MATHFN

#define SEQ_OF_CASE_MATHFN

◆ STACK_TOPS

#define STACK_TOPS   GT

◆ STACK_UNSIGNED

Function Documentation

◆ apply_args_size()

static int apply_args_size ( void )
static
Return the size required for the block returned by __builtin_apply_args,
and initialize apply_args_mode.   

References apply_args_mode, CEIL, cfun, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), ggc_alloc(), saved_apply_args_size, targetm, and TREE_TYPE.

Referenced by expand_builtin_apply(), and expand_builtin_apply_args_1().

◆ apply_result_size()

static int apply_result_size ( void )
static
Return the size required for the block returned by __builtin_apply,
and initialize apply_result_mode.   

References apply_result_mode, CEIL, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), ggc_alloc(), saved_apply_result_size, and targetm.

Referenced by expand_builtin_apply(), and expand_builtin_return().

◆ associated_internal_fn() [1/3]

static internal_fn associated_internal_fn ( built_in_function fn,
tree return_type )
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.   

References b, CASE_FLT_FN, ggc_alloc(), IFN_LAST, 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(), first_commutative_argument(), fold_stmt_1(), get_conditional_internal_fn(), replacement_internal_fn(), and vectorizable_internal_function().

◆ associated_internal_fn() [2/3]

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(), ggc_alloc(), and internal_fn_p().

◆ associated_internal_fn() [3/3]

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.

◆ avoid_folding_inline_builtin()

bool avoid_folding_inline_builtin ( tree fndecl)
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().

◆ build_builtin_expect_predicate()

static tree build_builtin_expect_predicate ( location_t loc,
tree pred,
tree expected,
tree predictor,
tree probability )
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(), ggc_alloc(), NULL_TREE, TREE_CHAIN, TREE_TYPE, TREE_VALUE, and TYPE_ARG_TYPES.

Referenced by fold_builtin_expect().

◆ build_call_nofold_loc()

static tree build_call_nofold_loc ( location_t loc,
tree fndecl,
int n,
... )
static
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(), ggc_alloc(), 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().

◆ builtin_fnspec()

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, DECL_FUNCTION_CODE(), and ggc_alloc().

Referenced by decl_fnspec(), and gimple_call_fnspec().

◆ builtin_mathfn_code()

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(), ggc_alloc(), 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().

◆ builtin_memcpy_read_str()

static rtx builtin_memcpy_read_str ( void * data,
void * ,
HOST_WIDE_INT offset,
fixed_size_mode mode )
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().

◆ builtin_memset_gen_str()

static rtx builtin_memset_gen_str ( void * data,
void * prev,
HOST_WIDE_INT offset,
fixed_size_mode mode )
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(), ggc_alloc(), 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().

◆ builtin_memset_read_str()

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(), ggc_alloc(), 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().

◆ builtin_save_expr()

◆ builtin_strncpy_read_str()

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, ggc_alloc(), expand_operand::mode, and offset.

Referenced by expand_builtin_strncpy(), and simplify_builtin_call().

◆ builtin_with_linkage_p()

bool builtin_with_linkage_p ( tree decl)
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, DECL_FUNCTION_CODE(), and ggc_alloc().

Referenced by symtab_node::output_to_lto_symbol_table_p().

◆ c_readstr()

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(), ggc_alloc(), 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().

◆ c_strlen()

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, ggc_alloc(), 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().

◆ called_as_built_in()

bool called_as_built_in ( tree node)
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().

◆ can_store_by_multiple_pieces()

static bool can_store_by_multiple_pieces ( unsigned HOST_WIDE_INT bits,
by_pieces_constfn constfun,
void * constfundata,
unsigned int align,
bool memsetp,
unsigned HOST_WIDE_INT len )
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(), and ggc_alloc().

Referenced by try_store_by_multiple_pieces().

◆ check_strncat_sizes()

static bool check_strncat_sizes ( tree exp,
tree objsize )
static
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(), ggc_alloc(), 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().

◆ default_emit_call_builtin___clear_cache()

void default_emit_call_builtin___clear_cache ( rtx begin,
rtx end )
Emit a call to __builtin___clear_cache.   

References begin(), BUILTIN_ASM_NAME_PTR, convert_memory_address, emit_library_call(), end(), ggc_alloc(), LCT_NORMAL, and ptr_mode.

◆ default_expand_builtin()

rtx default_expand_builtin ( tree exp,
rtx target,
rtx subtarget,
machine_mode mode,
int ignore )
Default target-specific builtin expander that does nothing.   

References NULL_RTX.

◆ determine_block_size()

static void determine_block_size ( tree len,
rtx len_rtx,
unsigned HOST_WIDE_INT * min_size,
unsigned HOST_WIDE_INT * max_size,
unsigned HOST_WIDE_INT * probable_max_size )
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, ggc_alloc(), 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().

◆ do_mpc_arg2()

tree do_mpc_arg2 ( tree arg0,
tree arg1,
tree type,
int do_nonfinite,
int(*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t) func )
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(), ggc_alloc(), mpfr_from_real(), NULL_TREE, real_isfinite(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, 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().

◆ do_mpc_ckconv()

static tree do_mpc_ckconv ( mpc_srcptr m,
tree type,
int inexact,
int force_convert )
static
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(), ggc_alloc(), 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().

◆ do_mpfr_ckconv()

static tree do_mpfr_ckconv ( mpfr_srcptr m,
tree type,
int inexact )
static
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(), ggc_alloc(), 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().

◆ do_mpfr_lgamma_r()

static tree do_mpfr_lgamma_r ( tree arg,
tree arg_sg,
tree type )
static
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, ggc_alloc(), integer_type_node, mpfr_from_real(), non_lvalue, NULL_TREE, real_isfinite(), real_isinteger(), real_isneg(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, 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().

◆ do_mpfr_remquo()

static tree do_mpfr_remquo ( tree arg0,
tree arg1,
tree arg_quo )
static
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, ggc_alloc(), INT_TYPE_SIZE, integer_type_node, mpfr_from_real(), non_lvalue, NULL, NULL_TREE, real_isfinite(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, 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().

◆ expand_asan_emit_allocas_unpoison()

static rtx expand_asan_emit_allocas_unpoison ( tree exp)
static
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(), ggc_alloc(), 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_builtin()

rtx expand_builtin ( tree exp,
rtx target,
rtx subtarget,
machine_mode mode,
int ignore )
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(), ggc_alloc(), 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().

◆ expand_builtin___clear_cache()

static void expand_builtin___clear_cache ( tree exp)
static

◆ expand_builtin_adjust_descriptor()

static rtx expand_builtin_adjust_descriptor ( tree exp)
static
Expand a call to the builtin descriptor adjustment routine.   

References CALL_EXPR_ARG, exp(), expand_normal(), force_operand(), ggc_alloc(), NULL_RTX, plus_constant(), ptr_mode, targetm, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_adjust_trampoline()

static rtx expand_builtin_adjust_trampoline ( tree exp)
static

◆ expand_builtin_alloca()

static rtx expand_builtin_alloca ( tree exp)
static

◆ expand_builtin_apply()

◆ expand_builtin_apply_args()

static rtx expand_builtin_apply_args ( void )
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().

◆ expand_builtin_apply_args_1()

static rtx expand_builtin_apply_args_1 ( void )
static

◆ expand_builtin_assume_aligned()

static rtx expand_builtin_assume_aligned ( tree exp,
rtx target )
static
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, ggc_alloc(), expand_operand::target, and TREE_SIDE_EFFECTS.

Referenced by expand_builtin().

◆ expand_builtin_atomic_always_lock_free()

static rtx expand_builtin_atomic_always_lock_free ( tree exp)
static
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(), ggc_alloc(), and TREE_CODE.

Referenced by expand_builtin().

◆ expand_builtin_atomic_clear()

static rtx expand_builtin_atomic_clear ( tree exp)
static

◆ expand_builtin_atomic_compare_exchange()

static rtx expand_builtin_atomic_compare_exchange ( machine_mode mode,
tree exp,
rtx target )
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, ggc_alloc(), 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_builtin_atomic_exchange()

static rtx expand_builtin_atomic_exchange ( machine_mode mode,
tree exp,
rtx target )
static
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(), ggc_alloc(), and NULL_RTX.

Referenced by expand_builtin().

◆ expand_builtin_atomic_fetch_op()

static rtx expand_builtin_atomic_fetch_op ( machine_mode mode,
tree exp,
rtx target,
enum rtx_code code,
bool fetch_after,
bool ignore,
enum built_in_function ext_call )
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(), ggc_alloc(), NULL_RTX, OPTAB_LIB_WIDEN, STRIP_NOPS, and TREE_OPERAND.

Referenced by expand_builtin().

◆ expand_builtin_atomic_is_lock_free()

static rtx expand_builtin_atomic_is_lock_free ( tree exp)
static
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(), ggc_alloc(), INTEGRAL_TYPE_P, NULL_RTX, and TREE_TYPE.

Referenced by expand_builtin().

◆ expand_builtin_atomic_load()

static rtx expand_builtin_atomic_load ( machine_mode mode,
tree exp,
rtx target )
static
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(), ggc_alloc(), is_mm_acq_rel(), is_mm_release(), MEMMODEL_SEQ_CST, and NULL_RTX.

Referenced by expand_builtin().

◆ expand_builtin_atomic_signal_fence()

static void expand_builtin_atomic_signal_fence ( tree exp)
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(), get_memmodel(), and ggc_alloc().

Referenced by expand_builtin().

◆ expand_builtin_atomic_store()

static rtx expand_builtin_atomic_store ( machine_mode mode,
tree exp )
static
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(), ggc_alloc(), is_mm_relaxed(), is_mm_release(), is_mm_seq_cst(), MEMMODEL_SEQ_CST, and NULL_RTX.

Referenced by expand_builtin().

◆ expand_builtin_atomic_test_and_set()

static rtx expand_builtin_atomic_test_and_set ( tree exp,
rtx target )
static
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(), ggc_alloc(), int_mode_for_size(), expand_operand::mode, opt_mode< T >::require(), and expand_operand::target.

Referenced by expand_builtin().

◆ expand_builtin_atomic_thread_fence()

static void expand_builtin_atomic_thread_fence ( tree exp)
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(), get_memmodel(), and ggc_alloc().

Referenced by expand_builtin().

◆ expand_builtin_bswap()

static rtx expand_builtin_bswap ( machine_mode target_mode,
tree exp,
rtx target,
rtx subtarget )
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, ggc_alloc(), NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_bzero()

static rtx expand_builtin_bzero ( tree exp)
static
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(), ggc_alloc(), integer_zero_node, NULL_RTX, size_type_node, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_cexpi()

◆ expand_builtin_classify_type()

static rtx expand_builtin_classify_type ( tree exp)
static
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().

◆ expand_builtin_compare_and_swap()

static rtx expand_builtin_compare_and_swap ( machine_mode mode,
tree exp,
bool is_bool,
rtx target )
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(), ggc_alloc(), MEMMODEL_SYNC_SEQ_CST, NULL, and NULL_RTX.

Referenced by expand_builtin().

◆ expand_builtin_copysign()

static rtx expand_builtin_copysign ( tree exp,
rtx target,
rtx subtarget )
static
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(), ggc_alloc(), NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_expect()

static rtx expand_builtin_expect ( tree exp,
rtx target )
static
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, ggc_alloc(), seen_error(), and expand_operand::target.

Referenced by expand_builtin().

◆ expand_builtin_expect_with_probability()

static rtx expand_builtin_expect_with_probability ( tree exp,
rtx target )
static
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, ggc_alloc(), seen_error(), and expand_operand::target.

Referenced by expand_builtin().

◆ expand_builtin_fabs()

static rtx expand_builtin_fabs ( tree exp,
rtx target,
rtx subtarget )
static
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, ggc_alloc(), expand_operand::mode, NULL_RTX, safe_from_p(), expand_operand::target, TREE_TYPE, TYPE_MODE, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_feclear_feraise_except()

static rtx expand_builtin_feclear_feraise_except ( tree exp,
rtx target,
machine_mode target_mode,
optab op_optab )
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, ggc_alloc(), insn_data, NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_fegetround()

static rtx expand_builtin_fegetround ( tree exp,
rtx target,
machine_mode target_mode )
static
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, ggc_alloc(), insn_data, NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_fork_or_exec()

static rtx expand_builtin_fork_or_exec ( tree fn,
tree exp,
rtx target,
int ignore )
static
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(), ggc_alloc(), NULL_RTX, rewrite_call_expr(), TREE_NOTHROW, TREE_PUBLIC, TREE_TYPE, and VISIBILITY_DEFAULT.

Referenced by expand_builtin().

◆ expand_builtin_frame_address()

static rtx expand_builtin_frame_address ( tree fndecl,
tree exp )
static
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(), ggc_alloc(), NULL, REG_P, tree_fits_uhwi_p(), tree_to_uhwi(), and warning().

Referenced by expand_builtin().

◆ expand_builtin_goacc_parlevel_id_size()

static rtx expand_builtin_goacc_parlevel_id_size ( tree exp,
rtx target,
int ignore )
static

◆ expand_builtin_init_descriptor()

static rtx expand_builtin_init_descriptor ( tree exp)
static
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, ggc_alloc(), MEM_NOTRAP_P, NULL_RTX, POINTER_SIZE, ptr_mode, set_mem_align(), and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_init_trampoline()

◆ expand_builtin_int_roundingfn()

static rtx expand_builtin_int_roundingfn ( tree exp,
rtx target )
static
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(), ggc_alloc(), 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_builtin_int_roundingfn_2()

static rtx expand_builtin_int_roundingfn_2 ( tree exp,
rtx target )
static
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(), ggc_alloc(), 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_builtin_interclass_mathfn()

static rtx expand_builtin_interclass_mathfn ( tree exp,
rtx target )
static
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, ggc_alloc(), 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_builtin_issignaling()

◆ expand_builtin_longjmp()

static void expand_builtin_longjmp ( rtx buf_addr,
rtx value )
static
__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(), ggc_alloc(), 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_builtin_mathfn_3()

static rtx expand_builtin_mathfn_3 ( tree exp,
rtx target,
rtx subtarget )
static
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(), ggc_alloc(), insns, NULL_RTX, optab_handler(), start_sequence(), TREE_TYPE, TYPE_MODE, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_mathfn_ternary()

static rtx expand_builtin_mathfn_ternary ( tree exp,
rtx target,
rtx subtarget )
static
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(), ggc_alloc(), insns, NULL_RTX, optab_handler(), start_sequence(), TREE_TYPE, TYPE_MODE, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_memcmp()

static rtx expand_builtin_memcmp ( tree exp,
rtx target,
bool result_eq )
static
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(), ggc_alloc(), 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_builtin_memcpy()

static rtx expand_builtin_memcpy ( tree exp,
rtx target )
static
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(), ggc_alloc(), NULL_RTX, RETURN_BEGIN, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_memmove()

static rtx expand_builtin_memmove ( tree exp,
rtx target )
static
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(), ggc_alloc(), NULL_RTX, RETURN_BEGIN, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_memory_chk()

static rtx expand_builtin_memory_chk ( tree exp,
rtx target,
machine_mode mode,
enum built_in_function fcode )
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(), ggc_alloc(), 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().

◆ expand_builtin_memory_copy_args()

static rtx expand_builtin_memory_copy_args ( tree dest,
tree src,
tree len,
rtx target,
tree exp,
memop_ret retmode,
bool might_overlap )
static

◆ expand_builtin_mempcpy()

static rtx expand_builtin_mempcpy ( tree exp,
rtx target )
static
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(), ggc_alloc(), NULL_RTX, RETURN_END, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_mempcpy_args()

static rtx expand_builtin_mempcpy_args ( tree dest,
tree src,
tree len,
rtx target,
tree orig_exp,
memop_ret retmode )
static

◆ expand_builtin_memset()

rtx expand_builtin_memset ( tree exp,
rtx target,
machine_mode mode )
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(), ggc_alloc(), expand_operand::mode, NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin(), and expand_DEFERRED_INIT().

◆ expand_builtin_memset_args()

◆ expand_builtin_next_arg()

static rtx expand_builtin_next_arg ( void )
static
Expand a call to __builtin_next_arg.   

References crtl, expand_binop(), ggc_alloc(), NULL_RTX, OPTAB_LIB_WIDEN, and ptr_mode.

Referenced by expand_builtin(), and expand_builtin_va_start().

◆ expand_builtin_nonlocal_goto()

◆ expand_builtin_object_size()

static rtx expand_builtin_object_size ( tree exp)
static

◆ expand_builtin_powi()

static rtx expand_builtin_powi ( tree exp,
rtx target )
static
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, ggc_alloc(), 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().

◆ expand_builtin_prefetch()

static void expand_builtin_prefetch ( tree exp)
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(), ggc_alloc(), integer_three_node, integer_zero_node, INTVAL, maybe_expand_insn(), MEM_P, NULL_RTX, side_effects_p(), targetm, TREE_CODE, validate_arglist(), and warning().

Referenced by expand_builtin().

◆ expand_builtin_return()

◆ expand_builtin_return_addr()

static rtx expand_builtin_return_addr ( enum built_in_function fndecl_code,
int count )
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(), ggc_alloc(), 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().

◆ expand_builtin_saveregs()

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().

◆ expand_builtin_set_thread_pointer()

◆ expand_builtin_setjmp_receiver()

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(), ggc_alloc(), 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().

◆ expand_builtin_setjmp_setup()

void expand_builtin_setjmp_setup ( rtx buf_addr,
rtx receiver_label )
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(), ggc_alloc(), 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_builtin_signbit()

static rtx expand_builtin_signbit ( tree exp,
rtx target )
static
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(), ggc_alloc(), 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(), TREE_TYPE, TYPE_MODE, validate_arglist(), and word_mode.

Referenced by expand_builtin().

◆ expand_builtin_sincos()

static rtx expand_builtin_sincos ( tree exp)
static
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(), ggc_alloc(), expand_operand::mode, NULL_RTX, optab_handler(), ptr_mode, TREE_TYPE, TYPE_MODE, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_stack_address()

static rtx expand_builtin_stack_address ( )
static

◆ expand_builtin_stpcpy()

static rtx expand_builtin_stpcpy ( tree exp,
rtx target,
machine_mode mode )
static
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(), ggc_alloc(), maybe_warn_nonstring_arg(), expand_operand::mode, NULL_RTX, and expand_operand::target.

Referenced by expand_builtin().

◆ expand_builtin_stpcpy_1()

static rtx expand_builtin_stpcpy_1 ( tree exp,
rtx target,
machine_mode mode )
static

◆ expand_builtin_strcmp()

◆ expand_builtin_strcpy()

static rtx expand_builtin_strcpy ( tree exp,
rtx target )
static
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(), ggc_alloc(), NULL_RTX, expand_operand::target, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_strcpy_args()

static rtx expand_builtin_strcpy_args ( tree ,
tree dest,
tree src,
rtx target )
static
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_builtin_strlen()

static rtx expand_builtin_strlen ( tree exp,
rtx target,
machine_mode target_mode )
static

◆ expand_builtin_strncmp()

◆ expand_builtin_strncpy()

static rtx expand_builtin_strncpy ( tree exp,
rtx target )
static

◆ expand_builtin_strnlen()

static rtx expand_builtin_strnlen ( tree exp,
rtx target,
machine_mode target_mode )
static

◆ expand_builtin_strub_enter()

static rtx expand_builtin_strub_enter ( tree exp)
static

◆ expand_builtin_strub_leave()

◆ expand_builtin_strub_update()

◆ expand_builtin_sync_lock_release()

static void expand_builtin_sync_lock_release ( machine_mode mode,
tree exp )
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_builtin_sync_lock_test_and_set()

static rtx expand_builtin_sync_lock_test_and_set ( machine_mode mode,
tree exp,
rtx target )
static
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().

◆ expand_builtin_sync_operation()

static rtx expand_builtin_sync_operation ( machine_mode mode,
tree exp,
enum rtx_code code,
bool after,
rtx target )
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(), ggc_alloc(), inform(), and MEMMODEL_SYNC_SEQ_CST.

Referenced by expand_builtin().

◆ expand_builtin_sync_synchronize()

static void expand_builtin_sync_synchronize ( void )
static
Expand the __sync_synchronize intrinsic.   

References expand_mem_thread_fence(), and MEMMODEL_SYNC_SEQ_CST.

Referenced by expand_builtin().

◆ expand_builtin_thread_pointer()

◆ expand_builtin_trap()

◆ expand_builtin_unop()

static rtx expand_builtin_unop ( machine_mode target_mode,
tree exp,
rtx target,
rtx subtarget,
optab op_optab )
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, ggc_alloc(), NULL_RTX, expand_operand::target, TREE_TYPE, TYPE_MODE, and validate_arglist().

Referenced by expand_builtin().

◆ expand_builtin_unreachable()

static void expand_builtin_unreachable ( void )
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().

◆ expand_builtin_update_setjmp_buf()

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(), ggc_alloc(), memory_address, plus_constant(), and SAVE_NONLOCAL.

Referenced by expand_builtin(), and sjlj_mark_call_sites().

◆ expand_builtin_va_copy()

static rtx expand_builtin_va_copy ( tree exp)
static
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(), ggc_alloc(), 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_builtin_va_end()

static rtx expand_builtin_va_end ( tree exp)
static
Expand EXP, a call to __builtin_va_end.   

References CALL_EXPR_ARG, const0_rtx, exp(), expand_expr(), EXPAND_NORMAL, ggc_alloc(), and TREE_SIDE_EFFECTS.

Referenced by expand_builtin().

◆ expand_builtin_va_start()

◆ expand_cmpstr()

static rtx expand_cmpstr ( insn_code icode,
rtx target,
rtx arg1_rtx,
rtx arg2_rtx,
HOST_WIDE_INT align )
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(), ggc_alloc(), 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().

◆ expand_expr_force_mode()

◆ expand_ifn_atomic_bit_test_and()

◆ expand_ifn_atomic_compare_exchange()

◆ expand_ifn_atomic_compare_exchange_into_call()

static void expand_ifn_atomic_compare_exchange_into_call ( gcall * call,
machine_mode mode )
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(), ggc_alloc(), 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().

◆ expand_ifn_atomic_op_fetch_cmp_0()

◆ expand_movstr()

static rtx expand_movstr ( tree dest,
tree src,
rtx target,
memop_ret retmode )
static
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, ggc_alloc(), 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().

◆ expand_speculation_safe_value()

static rtx expand_speculation_safe_value ( machine_mode mode,
tree exp,
rtx target,
bool ignore )
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, ggc_alloc(), expand_operand::mode, NULL, NULL_RTX, expand_operand::target, targetm, TREE_TYPE, and TYPE_MODE.

Referenced by expand_builtin().

◆ expand_stack_restore()

static void expand_stack_restore ( tree var)
static

◆ expand_stack_save()

static rtx expand_stack_save ( void )
static
Emit code to save the current value of stack.   

References emit_stack_save(), ggc_alloc(), NULL_RTX, and SAVE_BLOCK.

Referenced by expand_builtin().

◆ fold_builtin_0()

static tree fold_builtin_0 ( location_t loc,
tree fndecl )
static
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(), ggc_alloc(), NULL_TREE, sanitize_flags_p(), SANITIZE_UNREACHABLE, and TREE_TYPE.

Referenced by fold_builtin_n().

◆ fold_builtin_1()

◆ fold_builtin_2()

◆ fold_builtin_3()

static tree fold_builtin_3 ( location_t loc,
tree fndecl,
tree arg0,
tree arg1,
tree arg2 )
static
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(), ggc_alloc(), NULL_TREE, TREE_TYPE, and validate_arg().

Referenced by fold_builtin_n().

◆ fold_builtin_abs()

static tree fold_builtin_abs ( location_t loc,
tree arg,
tree type )
static
Fold a call to abs, labs, llabs or imaxabs with argument ARG.   

References fold_build1_loc(), fold_convert_loc(), ggc_alloc(), NULL_TREE, and validate_arg().

Referenced by fold_builtin_1().

◆ fold_builtin_addc_subc()

static tree fold_builtin_addc_subc ( location_t loc,
enum built_in_function fcode,
tree * args )
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, ggc_alloc(), save_expr(), TREE_TYPE, and void_type_node.

Referenced by fold_builtin_varargs().

◆ fold_builtin_arith_overflow()

static tree fold_builtin_arith_overflow ( location_t loc,
enum built_in_function fcode,
tree arg0,
tree arg1,
tree arg2 )
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, ggc_alloc(), IFN_LAST, omit_one_operand_loc(), save_expr(), TREE_CODE, TREE_OVERFLOW, TREE_TYPE, and void_type_node.

Referenced by fold_builtin_3().

◆ fold_builtin_atomic_always_lock_free()

static tree fold_builtin_atomic_always_lock_free ( tree arg0,
tree arg1 )
static

◆ fold_builtin_atomic_is_lock_free()

static tree fold_builtin_atomic_is_lock_free ( tree arg0,
tree arg1 )
static
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(), ggc_alloc(), and NULL_TREE.

Referenced by expand_builtin_atomic_is_lock_free(), and fold_builtin_2().

◆ fold_builtin_bit_query()

◆ fold_builtin_call_array()

tree fold_builtin_call_array ( location_t loc,
tree ,
tree fn,
int n,
tree * argarray )
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(), ggc_alloc(), 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_builtin_carg()

static tree fold_builtin_carg ( location_t loc,
tree arg,
tree type )
static

◆ fold_builtin_classify()

◆ fold_builtin_classify_type()

static tree fold_builtin_classify_type ( tree arg)
static
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_builtin_constant_p()

static tree fold_builtin_constant_p ( tree arg)
static

◆ fold_builtin_expect()

tree fold_builtin_expect ( location_t loc,
tree arg0,
tree arg1,
tree arg2,
tree arg3 )

◆ fold_builtin_fabs()

static tree fold_builtin_fabs ( location_t loc,
tree arg,
tree type )
static
Fold a call to fabs, fabsf or fabsl with argument ARG.   

References fold_build1_loc(), fold_convert_loc(), ggc_alloc(), NULL_TREE, and validate_arg().

Referenced by fold_builtin_1().

◆ fold_builtin_FILE()

static tree fold_builtin_FILE ( location_t loc)
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_builtin_fpclassify()

static tree fold_builtin_fpclassify ( location_t loc,
tree * args,
int nargs )
static
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(), ggc_alloc(), 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_builtin_frexp()

◆ fold_builtin_FUNCTION()

static tree fold_builtin_FUNCTION ( )
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_builtin_inf()

static tree fold_builtin_inf ( location_t loc,
tree type,
int warn )
static
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().

◆ fold_builtin_interclass_mathfn()

static tree fold_builtin_interclass_mathfn ( location_t loc,
tree fndecl,
tree arg )
static
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(), ggc_alloc(), 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_builtin_isascii()

static tree fold_builtin_isascii ( location_t loc,
tree arg )
static
Fold a call to builtin isascii with argument ARG.   

References build_int_cst(), fold_build2, fold_build2_loc(), ggc_alloc(), HOST_WIDE_INT_UC, integer_type_node, integer_zero_node, NULL_TREE, and validate_arg().

Referenced by fold_builtin_1().

◆ fold_builtin_isdigit()

static tree fold_builtin_isdigit ( location_t loc,
tree arg )
static

◆ fold_builtin_iseqsig()

static tree fold_builtin_iseqsig ( location_t loc,
tree arg0,
tree arg1 )
static
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(), ggc_alloc(), integer_type_node, NULL_TREE, TREE_CODE, TREE_TYPE, and TYPE_PRECISION.

Referenced by fold_builtin_2().

◆ fold_builtin_LINE()

static tree fold_builtin_LINE ( location_t loc,
tree type )
inlinestatic
Fold a call to __builtin_LINE to an integer constant.   

References build_int_cst(), and LOCATION_LINE.

Referenced by fold_builtin_0().

◆ fold_builtin_memcmp()

static tree fold_builtin_memcmp ( location_t loc,
tree arg1,
tree arg2,
tree len )
static

◆ fold_builtin_modf()

◆ fold_builtin_n()

static tree fold_builtin_n ( location_t loc,
tree expr,
tree fndecl,
tree * args,
int nargs,
bool  )
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(), ggc_alloc(), NULL_TREE, SET_EXPR_LOCATION, and TREE_TYPE.

Referenced by fold_builtin_call_array(), fold_call_expr(), and fold_call_stmt().

◆ fold_builtin_next_arg()

bool fold_builtin_next_arg ( tree exp,
bool va_start_p )
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(), ggc_alloc(), 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().

◆ fold_builtin_object_size()

static tree fold_builtin_object_size ( tree ptr,
tree ost,
enum built_in_function fcode )
static

◆ fold_builtin_sincos()

◆ fold_builtin_strcspn()

static tree fold_builtin_strcspn ( location_t loc,
tree expr,
tree s1,
tree s2 )
static
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(), ggc_alloc(), NULL_TREE, omit_one_operand_loc(), size_type_node, size_zero_node, and validate_arg().

Referenced by fold_builtin_2().

◆ fold_builtin_strlen()

static tree fold_builtin_strlen ( location_t loc,
tree expr,
tree type,
tree arg )
static
Fold a call EXPR (which may be null) to __builtin_strlen with argument
ARG.   

References c_strlen(), EXPR_HAS_LOCATION, EXPR_LOCATION, fold_convert_loc(), ggc_alloc(), input_location, NULL_TREE, UNKNOWN_LOCATION, validate_arg(), and warn_string_no_nul().

Referenced by fold_builtin_1().

◆ fold_builtin_strpbrk()

static tree fold_builtin_strpbrk ( location_t loc,
tree ,
tree s1,
tree s2,
tree type )
static
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(), ggc_alloc(), integer_type_node, integer_zero_node, NULL, NULL_TREE, omit_one_operand_loc(), r, TREE_TYPE, and validate_arg().

Referenced by fold_builtin_2().

◆ fold_builtin_strspn()

static tree fold_builtin_strspn ( location_t loc,
tree expr,
tree s1,
tree s2 )
static
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(), ggc_alloc(), NULL_TREE, omit_two_operands_loc(), size_type_node, size_zero_node, and validate_arg().

Referenced by fold_builtin_2().

◆ fold_builtin_toascii()

static tree fold_builtin_toascii ( location_t loc,
tree arg )
static
Fold a call to builtin toascii with argument ARG.   

References build_int_cst(), fold_build2_loc(), ggc_alloc(), integer_type_node, NULL_TREE, and validate_arg().

Referenced by fold_builtin_1().

◆ fold_builtin_unordered_cmp()

static tree fold_builtin_unordered_cmp ( location_t loc,
tree fndecl,
tree arg0,
tree arg1,
enum tree_code unordered_code,
enum tree_code ordered_code )
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(), ggc_alloc(), 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().

◆ fold_builtin_varargs()

static tree fold_builtin_varargs ( location_t loc,
tree fndecl,
tree * args,
int nargs )
static
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(), ggc_alloc(), NULL_TREE, SET_EXPR_LOCATION, suppress_warning(), and TREE_TYPE.

Referenced by fold_builtin_n().

◆ fold_call_expr()

tree fold_call_expr ( location_t loc,
tree exp,
bool ignore )
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(), ggc_alloc(), NULL_TREE, targetm, and TREE_CODE.

Referenced by fold(), and gimplify_call_expr().

◆ fold_call_stmt()

tree fold_call_stmt ( gcall * stmt,
bool ignore )
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(), ggc_alloc(), 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().

◆ gen_memset_value_from_prev()

◆ get_builtin_sync_mem()

◆ get_builtin_sync_mode()

static machine_mode get_builtin_sync_mode ( int fcode_diff)
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 ggc_alloc(), int_mode_for_size(), and opt_mode< T >::require().

Referenced by expand_builtin().

◆ get_memmodel()

◆ get_memory_rtx()

◆ get_object_alignment()

◆ get_object_alignment_1()

bool get_object_alignment_1 ( tree exp,
unsigned int * alignp,
unsigned HOST_WIDE_INT * bitposp )
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(), ggc_alloc(), 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().

◆ get_object_alignment_2()

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(), ggc_alloc(), 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().

◆ get_pointer_alignment()

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(), ggc_alloc(), 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().

◆ get_pointer_alignment_1()

bool get_pointer_alignment_1 ( tree exp,
unsigned int * alignp,
unsigned HOST_WIDE_INT * bitposp )
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(), ggc_alloc(), 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().

◆ init_target_chars()

◆ inline_expand_builtin_bytecmp()

static rtx inline_expand_builtin_bytecmp ( tree exp,
rtx target )
static

◆ inline_string_cmp()

static rtx inline_string_cmp ( rtx target,
tree var_str,
const char * const_str,
unsigned HOST_WIDE_INT length,
int const_str_n,
machine_mode mode )
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, 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(), ggc_alloc(), 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().

◆ interclass_mathfn_icode()

static enum insn_code interclass_mathfn_icode ( tree arg,
tree fndecl )
static
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, ggc_alloc(), optab_handler(), TREE_TYPE, TYPE_MODE, and unknown_optab.

Referenced by expand_builtin_interclass_mathfn(), and fold_builtin_interclass_mathfn().

◆ is_builtin_name()

static bool is_builtin_name ( const char * name)
static
Return true if NAME starts with __builtin_ or __sync_.   

References startswith().

Referenced by called_as_built_in().

◆ is_inexpensive_builtin()

bool is_inexpensive_builtin ( tree decl)
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(), ggc_alloc(), and is_simple_builtin().

Referenced by estimate_num_insns(), expression_expensive_p(), gimple_inexpensive_call_p(), loop_body_includes_call(), and num_calls().

◆ is_simple_builtin()

bool is_simple_builtin ( tree decl)
Return true if DECL is a builtin that expands to a constant or similarly
simple code.   

References BUILT_IN_NORMAL, DECL_FUNCTION_CODE(), fndecl_built_in_p(), and ggc_alloc().

Referenced by estimate_num_insns(), and is_inexpensive_builtin().

◆ mathfn_built_in() [1/2]

◆ mathfn_built_in() [2/2]

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().

◆ mathfn_built_in_1()

static tree mathfn_built_in_1 ( tree type,
combined_fn fn,
bool implicit_p )
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, ggc_alloc(), 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().

◆ mathfn_built_in_2()

static built_in_function mathfn_built_in_2 ( tree type,
combined_fn fn )
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, ggc_alloc(), long_double_type_node, SEQ_OF_CASE_MATHFN, and TYPE_MAIN_VARIANT.

Referenced by fold_builtin_sincos(), and mathfn_built_in_1().

◆ mathfn_built_in_explicit()

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().

◆ mathfn_built_in_type()

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().

◆ maybe_emit_call_builtin___clear_cache()

void maybe_emit_call_builtin___clear_cache ( rtx begin,
rtx end )
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, ggc_alloc(), maybe_expand_insn(), ptr_mode, and targetm.

Referenced by expand_builtin___clear_cache().

◆ maybe_emit_chk_warning()

static void maybe_emit_chk_warning ( tree exp,
enum built_in_function fcode )
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, ggc_alloc(), expand_operand::mode, and NULL_TREE.

Referenced by expand_builtin().

◆ maybe_emit_sprintf_chk_warning()

static void maybe_emit_sprintf_chk_warning ( tree exp,
enum built_in_function fcode )
static

◆ more_const_call_expr_args_p()

static bool more_const_call_expr_args_p ( const const_call_expr_arg_iterator * iter)
inlinestatic

◆ readonly_data_expr()

bool readonly_data_expr ( tree exp)
Returns true is EXP represents data that would potentially reside
in a readonly section.   

References decl_readonly_section(), exp(), get_base_address(), ggc_alloc(), STRIP_NOPS, TREE_CODE, TREE_OPERAND, TREE_STATIC, and VAR_P.

Referenced by expand_builtin_memory_chk(), and gimple_fold_builtin_memory_op().

◆ replacement_internal_fn()

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(), ggc_alloc(), gimple_bb(), gimple_call_builtin_p(), gimple_call_fndecl(), and IFN_LAST.

Referenced by can_use_internal_fn(), expand_call_stmt(), and use_internal_fn().

◆ result_vector()

static rtx result_vector ( int savep,
rtx result )
static
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(), ggc_alloc(), and INCOMING_REGNO.

Referenced by expand_builtin_apply(), and expand_builtin_return().

◆ rewrite_call_expr()

static tree rewrite_call_expr ( location_t loc,
tree exp,
int skip,
tree fndecl,
int n,
... )
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(), ggc_alloc(), and rewrite_call_expr_valist().

Referenced by expand_builtin_fork_or_exec().

◆ rewrite_call_expr_valist()

static tree rewrite_call_expr_valist ( location_t loc,
int oldnargs,
tree * args,
int skip,
tree fndecl,
int n,
va_list newargs )
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(), ggc_alloc(), and i.

Referenced by rewrite_call_expr().

◆ round_trampoline_addr()

static rtx round_trampoline_addr ( rtx tramp)
static
Given a trampoline address, make sure it satisfies TRAMPOLINE_ALIGNMENT.   

References expand_simple_binop(), gen_int_mode(), gen_reg_rtx(), ggc_alloc(), OPTAB_LIB_WIDEN, and TRAMPOLINE_ALIGNMENT.

Referenced by expand_builtin_adjust_trampoline(), and expand_builtin_init_trampoline().

◆ set_builtin_user_assembler_name()

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, ggc_alloc(), int_mode_for_size(), INT_TYPE_SIZE, opt_mode< T >::require(), set_optab_libfunc(), set_user_assembler_libfunc(), and set_user_assembler_name().

◆ stabilize_va_list_loc()

static tree stabilize_va_list_loc ( location_t loc,
tree valist,
int needs_lvalue )
static
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(), ggc_alloc(), save_expr(), targetm, TREE_CODE, TREE_SIDE_EFFECTS, and TREE_TYPE.

Referenced by expand_builtin_va_copy(), and expand_builtin_va_start().

◆ std_build_builtin_va_list()

tree std_build_builtin_va_list ( void )
The "standard" definition of va_list is void*.   

References ptr_type_node.

◆ std_canonical_va_list_type()

tree std_canonical_va_list_type ( tree type)
The "standard" type of va_list is va_list_type_node.   

References ggc_alloc(), NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, type(), TYPE_MAIN_VARIANT, and va_list_type_node.

◆ std_expand_builtin_va_start()

void std_expand_builtin_va_start ( tree valist,
rtx nextarg )
The "standard" implementation of va_start: just assign `nextarg' to
the variable.   

References convert_move(), expand_expr(), EXPAND_WRITE, ggc_alloc(), and NULL_RTX.

Referenced by expand_builtin_va_start().

◆ std_fn_abi_va_list()

tree std_fn_abi_va_list ( tree fndecl)
The "standard" abi va_list is va_list_type_node.   

References va_list_type_node.

◆ string_length()

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, and ggc_alloc().

Referenced by c_strlen(), and gimple_fold_builtin_memchr().

◆ target_char_cast()

static int target_char_cast ( tree cst,
char * p )
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, ggc_alloc(), 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().

◆ target_char_cst_p()

bool target_char_cst_p ( tree t,
char * p )
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, ggc_alloc(), 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().

◆ try_store_by_multiple_pieces()

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, ggc_alloc(), 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().

◆ type_to_class()

◆ validate_arg()

◆ validate_arglist()

static bool validate_arglist ( const_tree callexpr,
... )
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(), ggc_alloc(), 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().

◆ validate_gimple_arglist()

bool validate_gimple_arglist ( const gcall * call,
... )
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(), ggc_alloc(), gimple_call_arg(), gimple_call_num_args(), i, and validate_arg().

Referenced by interesting_stringop_to_profile_p().

Variable Documentation

◆ built_in_class_names

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().

◆ built_in_names

const char* built_in_names[(int) END_BUILTINS]

◆ builtin_info

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.   

◆ default_target_builtins

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.   

◆ force_folding_builtin_constant_p

bool force_folding_builtin_constant_p
Non-zero if __builtin_constant_p should be folded right away.   

Referenced by fold_builtin_constant_p().

◆ setjmp_alias_set

alias_set_type setjmp_alias_set = -1
static
Alias set used for setjmp buffer.   

Referenced by expand_builtin_longjmp(), and expand_builtin_setjmp_setup().

◆ target_c

unsigned HOST_WIDE_INT target_c
static

Referenced by init_target_chars().

◆ target_newline

◆ target_percent

◆ target_percent_c

◆ target_percent_s

◆ target_percent_s_newline

char target_percent_s_newline[4]

◆ target_s

unsigned HOST_WIDE_INT target_s
static

Referenced by init_target_chars().