GCC Middle and Back End API Reference
fold-const.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 "gimple.h"
#include "predict.h"
#include "memmodel.h"
#include "tm_p.h"
#include "tree-ssa-operands.h"
#include "optabs-query.h"
#include "cgraph.h"
#include "diagnostic-core.h"
#include "flags.h"
#include "alias.h"
#include "fold-const.h"
#include "fold-const-call.h"
#include "stor-layout.h"
#include "calls.h"
#include "tree-iterator.h"
#include "expr.h"
#include "intl.h"
#include "langhooks.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "tree-dfa.h"
#include "builtins.h"
#include "generic-match.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-into-ssa.h"
#include "md5.h"
#include "case-cfn-macros.h"
#include "stringpool.h"
#include "tree-vrp.h"
#include "tree-ssanames.h"
#include "selftest.h"
#include "attribs.h"
#include "tree-vector-builder.h"
#include "vec-perm-indices.h"
#include "asan.h"
#include "gimple-range.h"
Include dependency graph for fold-const.cc:

Data Structures

struct  contains_label_data

Namespaces

namespace  inchash

Macros

#define INCLUDE_ALGORITHM
#define OP_SAME(N)
#define OP_SAME_WITH_NULL(N)
#define LOGICAL_OP_NON_SHORT_CIRCUIT
#define START_FOLD_INIT
#define END_FOLD_INIT
#define tree_expr_nonnegative_warnv_p(X, Y)
#define RECURSE(X)
#define integer_valued_real_p(X)
#define RECURSE(X)

Enumerations

enum  comparison_code {
  COMPCODE_FALSE = 0 , COMPCODE_LT = 1 , COMPCODE_EQ = 2 , COMPCODE_LE = 3 ,
  COMPCODE_GT = 4 , COMPCODE_LTGT = 5 , COMPCODE_GE = 6 , COMPCODE_ORD = 7 ,
  COMPCODE_UNORD = 8 , COMPCODE_UNLT = 9 , COMPCODE_UNEQ = 10 , COMPCODE_UNLE = 11 ,
  COMPCODE_UNGT = 12 , COMPCODE_NE = 13 , COMPCODE_UNGE = 14 , COMPCODE_TRUE = 15
}

Functions

static bool negate_expr_p (tree)
static tree negate_expr (tree)
static tree associate_trees (location_t, tree, tree, enum tree_code, tree)
static enum comparison_code comparison_to_compcode (enum tree_code)
static enum tree_code compcode_to_comparison (enum comparison_code)
static bool twoval_comparison_p (tree, tree *, tree *)
static tree eval_subst (location_t, tree, tree, tree, tree, tree)
static tree optimize_bit_field_compare (location_t, enum tree_code, tree, tree, tree)
static bool simple_operand_p (const_tree)
static tree range_binop (enum tree_code, tree, tree, int, tree, int)
static tree range_predecessor (tree)
static tree range_successor (tree)
static tree fold_range_test (location_t, enum tree_code, tree, tree, tree)
static tree fold_cond_expr_with_comparison (location_t, tree, enum tree_code, tree, tree, tree, tree)
static tree extract_muldiv (tree, tree, enum tree_code, tree, bool *)
static tree extract_muldiv_1 (tree, tree, enum tree_code, tree, bool *)
static tree fold_binary_op_with_conditional_arg (location_t, enum tree_code, tree, tree, tree, tree, tree, int)
static tree fold_negate_const (tree, tree)
static tree fold_not_const (const_tree, tree)
static tree fold_relational_const (enum tree_code, tree, tree, tree)
static tree fold_convert_const (enum tree_code, tree, tree)
static tree fold_view_convert_expr (tree, tree)
static tree fold_negate_expr (location_t, tree)
tree_code minmax_from_comparison (tree_code cmp, tree exp0, tree exp1, tree exp2, tree exp3)
static location_t expr_location_or (tree t, location_t loc)
tree protected_set_expr_location_unshare (tree x, location_t loc)
tree div_if_zero_remainder (const_tree arg1, const_tree arg2)
void fold_defer_overflow_warnings (void)
void fold_undefer_overflow_warnings (bool issue, const gimple *stmt, int code)
void fold_undefer_and_ignore_overflow_warnings (void)
bool fold_deferring_overflow_warnings_p (void)
void fold_overflow_warning (const char *gmsgid, enum warn_strict_overflow_code wc)
bool negate_mathfn_p (combined_fn fn)
bool may_negate_without_overflow_p (const_tree t)
static tree fold_negate_expr_1 (location_t loc, tree t)
static tree split_tree (tree in, tree type, enum tree_code code, tree *minus_varp, tree *conp, tree *minus_conp, tree *litp, tree *minus_litp, int negate_p)
static bool int_binop_types_match_p (enum tree_code code, const_tree type1, const_tree type2)
bool wide_int_binop (wide_int &res, enum tree_code code, const wide_int &arg1, const wide_int &arg2, signop sign, wi::overflow_type *overflow)
bool can_min_p (const_tree arg1, const_tree arg2, poly_wide_int &res)
bool poly_int_binop (poly_wide_int &res, enum tree_code code, const_tree arg1, const_tree arg2, signop sign, wi::overflow_type *overflow)
tree int_const_binop (enum tree_code code, const_tree arg1, const_tree arg2, int overflowable)
static bool distributes_over_addition_p (tree_code op, int opno)
static tree simplify_const_binop (tree_code code, tree op, tree other_op, int index)
tree vector_const_binop (tree_code code, tree arg1, tree arg2, tree(*elt_const_binop)(enum tree_code, tree, tree))
static tree const_binop (enum tree_code code, tree arg1, tree arg2)
tree const_binop (enum tree_code code, tree type, tree arg1, tree arg2)
tree const_unop (enum tree_code code, tree type, tree arg0)
tree size_int_kind (poly_int64 number, enum size_type_kind kind)
tree size_binop_loc (location_t loc, enum tree_code code, tree arg0, tree arg1)
tree size_diffop_loc (location_t loc, tree arg0, tree arg1)
static tree fold_convert_const_int_from_int (tree type, const_tree arg1)
static tree fold_convert_const_int_from_real (enum tree_code code, tree type, const_tree arg1)
static tree fold_convert_const_int_from_fixed (tree type, const_tree arg1)
static tree fold_convert_const_real_from_real (tree type, const_tree arg1)
static tree fold_convert_const_real_from_fixed (tree type, const_tree arg1)
static tree fold_convert_const_fixed_from_fixed (tree type, const_tree arg1)
static tree fold_convert_const_fixed_from_int (tree type, const_tree arg1)
static tree fold_convert_const_fixed_from_real (tree type, const_tree arg1)
static tree build_zero_vector (tree type)
bool fold_convertible_p (const_tree type, const_tree arg)
tree fold_convert_loc (location_t loc, tree type, tree arg)
static bool maybe_lvalue_p (const_tree x)
tree non_lvalue_loc (location_t loc, tree x)
enum tree_code invert_tree_comparison (enum tree_code code, bool honor_nans)
enum tree_code swap_tree_comparison (enum tree_code code)
bool inverse_conditions_p (const_tree cond1, const_tree cond2)
tree combine_comparisons (location_t loc, enum tree_code code, enum tree_code lcode, enum tree_code rcode, tree truth_type, tree ll_arg, tree lr_arg)
bool operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
void inchash::add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
static bool operand_equal_for_comparison_p (tree arg0, tree arg1)
tree omit_one_operand_loc (location_t loc, tree type, tree result, tree omitted)
tree omit_two_operands_loc (location_t loc, tree type, tree result, tree omitted1, tree omitted2)
static tree fold_truth_not_expr (location_t loc, tree arg)
static tree fold_invert_truthvalue (location_t loc, tree arg)
tree invert_truthvalue_loc (location_t loc, tree arg)
tree make_bit_field_ref (location_t loc, tree inner, tree orig_inner, tree type, HOST_WIDE_INT bitsize, poly_int64 bitpos, int unsignedp, int reversep)
tree sign_bit_p (tree exp, const_tree val)
bool simple_condition_p (tree exp)
tree make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1, tree exp_type, tree *p_low, tree *p_high, int *p_in_p, bool *strict_overflow_p)
tree make_range (tree exp, int *pin_p, tree *plow, tree *phigh, bool *strict_overflow_p)
static bool maskable_range_p (const_tree low, const_tree high, tree type, tree *mask, tree *value)
tree range_check_type (tree etype)
tree build_range_check (location_t loc, tree type, tree exp, int in_p, tree low, tree high)
bool merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0, tree high0, int in1_p, tree low1, tree high1)
static tree merge_truthop_with_opposite_arm (location_t loc, tree op, tree cmpop, bool rhs_only)
static tree fold_truth_andor_1 (location_t loc, enum tree_code code, tree truth_type, tree lhs, tree rhs)
tree constant_boolean_node (bool value, tree type)
bool fold_real_zero_addition_p (const_tree type, const_tree arg, const_tree zero_arg, int negate)
enum tree_code fold_div_compare (enum tree_code code, tree c1, tree c2, tree *lo, tree *hi, bool *neg_overflow)
bool tree_swap_operands_p (const_tree arg0, const_tree arg1)
static tree fold_to_nonsharp_ineq_using_bound (location_t loc, tree ineq, tree bound)
static tree fold_plusminus_mult_expr (location_t loc, enum tree_code code, tree type, tree arg0, tree arg1)
int native_encode_wide_int (tree type, const wide_int_ref &val, unsigned char *ptr, int len, int off)
static int native_encode_int (const_tree expr, unsigned char *ptr, int len, int off)
static int native_encode_fixed (const_tree expr, unsigned char *ptr, int len, int off)
int native_encode_real (scalar_float_mode mode, const REAL_VALUE_TYPE *val, unsigned char *ptr, int len, int off)
static int native_encode_complex (const_tree expr, unsigned char *ptr, int len, int off)
static int native_encode_vector_part (const_tree expr, unsigned char *ptr, int len, int off, unsigned HOST_WIDE_INT count)
static int native_encode_vector (const_tree expr, unsigned char *ptr, int len, int off)
static int native_encode_string (const_tree expr, unsigned char *ptr, int len, int off)
static int native_encode_constructor (const_tree expr, unsigned char *ptr, int len, int off)
int native_encode_expr (const_tree expr, unsigned char *ptr, int len, int off)
tree find_bitfield_repr_type (int fieldsize, int len)
int native_encode_initializer (tree init, unsigned char *ptr, int len, int off, unsigned char *mask)
static tree native_interpret_int (tree type, const unsigned char *ptr, int len)
static tree native_interpret_fixed (tree type, const unsigned char *ptr, int len)
tree native_interpret_real (tree type, const unsigned char *ptr, int len)
static tree native_interpret_complex (tree type, const unsigned char *ptr, int len)
static tree native_interpret_vector_part (tree type, const unsigned char *bytes, unsigned int len, unsigned int npatterns, unsigned int nelts_per_pattern)
static tree native_interpret_vector (tree type, const unsigned char *ptr, unsigned int len)
tree native_interpret_expr (tree type, const unsigned char *ptr, int len)
bool can_native_interpret_type_p (tree type)
tree native_interpret_aggregate (tree type, const unsigned char *ptr, int off, int len)
void shift_bytes_in_array_left (unsigned char *ptr, unsigned int sz, unsigned int amnt)
void shift_bytes_in_array_right (unsigned char *ptr, unsigned int sz, unsigned int amnt)
static tree fold_view_convert_vector_encoding (tree type, tree expr)
tree build_fold_addr_expr_with_type_loc (location_t loc, tree t, tree ptrtype)
tree build_fold_addr_expr_loc (location_t loc, tree t)
tree fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
tree fold_unary_ignore_overflow_loc (location_t loc, enum tree_code code, tree type, tree op0)
static tree fold_truth_andor (location_t loc, enum tree_code code, tree type, tree arg0, tree arg1, tree op0, tree op1)
static tree maybe_canonicalize_comparison_1 (location_t loc, enum tree_code code, tree type, tree arg0, tree arg1, bool *strict_overflow_p)
static tree maybe_canonicalize_comparison (location_t loc, enum tree_code code, tree type, tree arg0, tree arg1)
static bool pointer_may_wrap_p (tree base, tree offset, poly_int64 bitpos)
static int maybe_nonzero_address (tree decl)
static tree fold_comparison (location_t loc, enum tree_code code, tree type, tree op0, tree op1)
static tree fold_mult_zconjz (location_t loc, tree type, tree expr)
static bool vec_cst_ctor_to_array (tree arg, unsigned int nelts, tree *elts)
static bool valid_mask_for_fold_vec_perm_cst_p (tree arg0, tree arg1, const vec_perm_indices &sel, const char **reason=NULL)
static tree fold_vec_perm_cst (tree type, tree arg0, tree arg1, const vec_perm_indices &sel, const char **reason=NULL)
tree fold_vec_perm (tree type, tree arg0, tree arg1, const vec_perm_indices &sel)
static tree fold_addr_of_array_ref_difference (location_t loc, tree type, tree aref0, tree aref1, bool use_pointer_diff)
tree exact_inverse (tree type, tree cst)
static wide_int mask_with_tz (tree type, const wide_int &x, const wide_int &y)
static bool tree_expr_nonzero_warnv_p (tree t, bool *strict_overflow_p)
bool tree_expr_nonzero_p (tree t)
bool expr_not_equal_to (tree t, const wide_int &w)
tree fold_binary_loc (location_t loc, enum tree_code code, tree type, tree op0, tree op1)
tree fold_bit_and_mask (tree type, tree arg1, enum tree_code code, tree arg00, enum tree_code code00, tree arg000, tree arg001, tree arg01, enum tree_code code01, tree arg010, tree arg011, tree *pmop)
static tree contains_label_1 (tree *tp, int *walk_subtrees, void *data)
static bool contains_label_p (tree st)
tree fold_ternary_loc (location_t loc, enum tree_code code, tree type, tree op0, tree op1, tree op2)
tree get_array_ctor_element_at_index (tree ctor, offset_int access_index, unsigned *ctor_idx)
tree fold (tree expr)
tree fold_build1_loc (location_t loc, enum tree_code code, tree type, tree op0 MEM_STAT_DECL)
tree fold_build2_loc (location_t loc, enum tree_code code, tree type, tree op0, tree op1 MEM_STAT_DECL)
tree fold_build3_loc (location_t loc, enum tree_code code, tree type, tree op0, tree op1, tree op2 MEM_STAT_DECL)
tree fold_build_call_array_loc (location_t loc, tree type, tree fn, int nargs, tree *argarray)
tree fold_init (tree expr)
tree fold_build1_initializer_loc (location_t loc, enum tree_code code, tree type, tree op)
tree fold_build2_initializer_loc (location_t loc, enum tree_code code, tree type, tree op0, tree op1)
tree fold_build_call_array_initializer_loc (location_t loc, tree type, tree fn, int nargs, tree *argarray)
tree fold_binary_initializer_loc (location_t loc, tree_code code, tree type, tree lhs, tree rhs)
bool multiple_of_p (tree type, const_tree top, const_tree bottom, bool nowrap)
bool tree_expr_finite_p (const_tree x)
bool tree_expr_infinite_p (const_tree x)
bool tree_expr_maybe_infinite_p (const_tree x)
bool tree_expr_signaling_nan_p (const_tree x)
bool tree_expr_maybe_signaling_nan_p (const_tree x)
bool tree_expr_nan_p (const_tree x)
bool tree_expr_maybe_nan_p (const_tree x)
bool tree_expr_maybe_real_minus_zero_p (const_tree x)
static bool tree_simple_nonnegative_warnv_p (enum tree_code code, tree type)
bool tree_unary_nonnegative_warnv_p (enum tree_code code, tree type, tree op0, bool *strict_overflow_p, int depth)
bool tree_binary_nonnegative_warnv_p (enum tree_code code, tree type, tree op0, tree op1, bool *strict_overflow_p, int depth)
bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p, int depth)
bool tree_call_nonnegative_warnv_p (tree type, combined_fn fn, tree arg0, tree arg1, bool *strict_overflow_p, int depth)
static bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p, int depth)
bool tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p, int depth)
bool tree_expr_nonnegative_p (tree t)
bool tree_unary_nonzero_warnv_p (enum tree_code code, tree type, tree op0, bool *strict_overflow_p)
bool tree_binary_nonzero_warnv_p (enum tree_code code, tree type, tree op0, tree op1, bool *strict_overflow_p)
bool tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
bool integer_valued_real_unary_p (tree_code code, tree op0, int depth)
bool integer_valued_real_binary_p (tree_code code, tree op0, tree op1, int depth)
bool integer_valued_real_call_p (combined_fn fn, tree arg0, tree arg1, int depth)
bool integer_valued_real_single_p (tree t, int depth)
static bool integer_valued_real_invalid_p (tree t, int depth)
bool integer_valued_real_p (tree t, int depth)
tree fold_binary_to_constant (enum tree_code code, tree type, tree op0, tree op1)
tree fold_unary_to_constant (enum tree_code code, tree type, tree op0)
tree fold_read_from_constant_string (tree exp)
tree fold_read_from_vector (tree arg, poly_uint64 idx)
tree fold_abs_const (tree arg0, tree type)
tree fold_build_cleanup_point_expr (tree type, tree expr)
tree fold_indirect_ref_1 (location_t loc, tree type, tree op0)
tree build_fold_indirect_ref_loc (location_t loc, tree t)
tree fold_indirect_ref_loc (location_t loc, tree t)
tree fold_ignored_result (tree t)
tree round_up_loc (location_t loc, tree value, unsigned int divisor)
tree round_down_loc (location_t loc, tree value, int divisor)
static tree split_address_to_core_and_offset (tree exp, poly_int64 *pbitpos, tree *poffset)
bool ptr_difference_const (tree e1, tree e2, poly_int64 *diff)
tree convert_to_ptrofftype_loc (location_t loc, tree off)
tree fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)
tree fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
const char * getbyterep (tree src, unsigned HOST_WIDE_INT *strsize)
const char * c_getstr (tree str)
wide_int tree_nonzero_bits (const_tree t)
int address_compare (tree_code code, tree type, tree op0, tree op1, tree &base0, tree &base1, poly_int64 &off0, poly_int64 &off1, bool generic)
tree ctor_single_nonzero_element (const_tree t)

Variables

int folding_initializer = 0
bool folding_cxx_constexpr = false
static int fold_deferring_overflow_warnings
static const char * fold_deferred_overflow_warning
static enum warn_strict_overflow_code fold_deferred_overflow_code
static operand_compare default_compare_instance

Macro Definition Documentation

â—† END_FOLD_INIT

#define END_FOLD_INIT
Value:
flag_signaling_nans = saved_signaling_nans;\
flag_trapping_math = saved_trapping_math;\
flag_rounding_math = saved_rounding_math;\
flag_trapv = saved_trapv;\
folding_initializer = saved_folding_initializer;
int folding_initializer
Definition fold-const.cc:94

Referenced by fold_binary_initializer_loc(), fold_build1_initializer_loc(), fold_build2_initializer_loc(), fold_build_call_array_initializer_loc(), and fold_init().

â—† INCLUDE_ALGORITHM

#define INCLUDE_ALGORITHM
Fold a constant sub-tree into a single node for C-compiler Copyright (C) 1987-2025 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/>.
The entry points in this file are fold, size_int_wide and size_binop. fold takes a tree as argument and returns a simplified tree. size_binop takes a tree code for an arithmetic operation and two operands that are trees, and produces a tree for the result, assuming the type comes from `sizetype'. size_int takes an integer value, and creates a tree constant with type from `sizetype'. Note: Since the folders get called on non-gimple code as well as gimple code, we need to handle GIMPLE tuples as well as their corresponding tree equivalents.

â—† integer_valued_real_p

#define integer_valued_real_p ( X)
Value:
_Pragma ("GCC error \"Use RECURSE for recursive calls\"") 0

â—† LOGICAL_OP_NON_SHORT_CIRCUIT

#define LOGICAL_OP_NON_SHORT_CIRCUIT
Value:
false) >= 2)
#define cfun
Definition function.h:480
bool optimize_function_for_speed_p(struct function *fun)
Definition predict.cc:277

Referenced by fold_range_test(), fold_truth_andor(), and ifcombine_ifandif().

â—† OP_SAME

#define OP_SAME ( N)
Value:
TREE_OPERAND (arg1, N), flags)
bool operand_equal_p(const_tree arg0, const_tree arg1, unsigned int flags)
Definition fold-const.cc:4332
#define N
Definition gensupport.cc:202
#define TREE_OPERAND(NODE, I)
Definition tree.h:1300

Referenced by operand_compare::operand_equal_p().

â—† OP_SAME_WITH_NULL

#define OP_SAME_WITH_NULL ( N)
Value:
((!TREE_OPERAND (arg0, N) || !TREE_OPERAND (arg1, N)) \
? TREE_OPERAND (arg0, N) == TREE_OPERAND (arg1, N) : OP_SAME (N))
#define OP_SAME(N)

Referenced by operand_compare::operand_equal_p().

â—† RECURSE [1/2]

â—† RECURSE [2/2]

#define RECURSE ( X)
Value:
((integer_valued_real_p) (X, depth + 1))
#define integer_valued_real_p(X)
Definition fold-const.cc:15506

â—† START_FOLD_INIT

#define START_FOLD_INIT
Value:
int saved_signaling_nans = flag_signaling_nans;\
int saved_trapping_math = flag_trapping_math;\
int saved_rounding_math = flag_rounding_math;\
int saved_trapv = flag_trapv;\
int saved_folding_initializer = folding_initializer;\
flag_signaling_nans = 0;\
flag_trapping_math = 0;\
flag_rounding_math = 0;\
flag_trapv = 0;\
Perform constant folding and related simplification of initializer expression EXPR. These behave identically to "fold_buildN" but ignore potential run-time traps and exceptions that fold must preserve.

Referenced by fold_binary_initializer_loc(), fold_build1_initializer_loc(), fold_build2_initializer_loc(), fold_build_call_array_initializer_loc(), and fold_init().

â—† tree_expr_nonnegative_warnv_p

#define tree_expr_nonnegative_warnv_p ( X,
Y )
Value:
_Pragma ("GCC error \"Use RECURSE for recursive calls\"") 0

Referenced by create_iv(), fold_binary_loc(), tree_binary_nonzero_warnv_p(), and tree_expr_nonnegative_p().

Enumeration Type Documentation

â—† comparison_code

The following constants represent a bit based encoding of GCC's comparison operators. This encoding simplifies transformations on relational comparison operators, such as AND and OR.
Enumerator
COMPCODE_FALSE 
COMPCODE_LT 
COMPCODE_EQ 
COMPCODE_LE 
COMPCODE_GT 
COMPCODE_LTGT 
COMPCODE_GE 
COMPCODE_ORD 
COMPCODE_UNORD 
COMPCODE_UNLT 
COMPCODE_UNEQ 
COMPCODE_UNLE 
COMPCODE_UNGT 
COMPCODE_NE 
COMPCODE_UNGE 
COMPCODE_TRUE 

Function Documentation

â—† address_compare()

int address_compare ( tree_code code,
tree type,
tree op0,
tree op1,
tree & base0,
tree & base1,
poly_int64 & off0,
poly_int64 & off1,
bool generic )
Helper function for address compare simplifications in match.pd. OP0 and OP1 are ADDR_EXPR operands being compared by CODE. TYPE is the type of comparison operands. BASE0, BASE1, OFF0 and OFF1 are set by the function. GENERIC is true if GENERIC folding and false for GIMPLE folding. Returns 0 if OP0 is known to be unequal to OP1 regardless of OFF{0,1}, 1 if bases are known to be equal and OP0 cmp OP1 depends on OFF0 cmp OFF1, and 2 if unknown.

References DECL_HAS_VALUE_EXPR_P, decl_in_symtab_p(), DECL_P, DECL_SIZE_UNIT, symtab_node::equal_address_to(), folding_cxx_constexpr, folding_initializer, poly_int< N, C >::force_shwi(), gcc_checking_assert, get_addr_base_and_unit_offset(), symtab_node::get_create(), gimple_assign_rhs1(), INTEGRAL_TYPE_P, poly_int< N, C >::is_constant(), is_global_var(), known_eq, known_ne, mem_ref_offset(), MIN, NULL_TREE, POINTER_TYPE_P, SSA_NAME_DEF_STMT, TREE_CODE, tree_fits_poly_int64_p(), TREE_OPERAND, TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_poly_int64(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, and VAR_P.

â—† associate_trees()

tree associate_trees ( location_t loc,
tree t1,
tree t2,
enum tree_code code,
tree type )
static
Re-associate trees split by the above function. T1 and T2 are either expressions to associate or null. Return the new expression, if any. LOC is the location of the new expression. If we build an operation, do it in TYPE and with CODE.

References build2_loc(), fold_build2_loc(), fold_convert_loc(), gcc_assert, integer_zerop(), TREE_CODE, and TREE_OPERAND.

Referenced by fold_binary_loc().

â—† build_fold_addr_expr_loc()

â—† build_fold_addr_expr_with_type_loc()

tree build_fold_addr_expr_with_type_loc ( location_t loc,
tree t,
tree ptrtype )
Build an expression for the address of T. Folds away INDIRECT_REF to avoid confusing the gimplify process.

References build1_loc(), build_fold_addr_expr_loc(), convert_to_ptrofftype, fold_binary, fold_convert_loc(), INDIRECT_REF_P, integer_zerop(), TREE_CODE, TREE_OPERAND, and TREE_TYPE.

Referenced by build_fold_addr_expr_loc(), and stabilize_va_list_loc().

â—† build_fold_indirect_ref_loc()

â—† build_range_check()

tree build_range_check ( location_t loc,
tree type,
tree exp,
int in_p,
tree low,
tree high )

â—† build_zero_vector()

tree build_zero_vector ( tree type)
static
Construct a vector of zero elements of vector type TYPE.

References build_vector_from_val(), fold_convert_const(), integer_zero_node, and TREE_TYPE.

Referenced by fold_convert_loc().

â—† c_getstr()

â—† can_min_p()

bool can_min_p ( const_tree arg1,
const_tree arg2,
poly_wide_int & res )
Returns true if we know who is smaller or equal, ARG1 or ARG2, and set the min value to RES.

References known_le, wi::to_poly_wide(), and wi::to_poly_widest().

Referenced by poly_int_binop().

â—† can_native_interpret_type_p()

bool can_native_interpret_type_p ( tree type)
Returns true if we can interpret the contents of a native encoding as TYPE.

References TREE_CODE.

Referenced by fold_ctor_reference(), fold_ternary_loc(), and native_interpret_aggregate().

â—† combine_comparisons()

tree combine_comparisons ( location_t loc,
enum tree_code code,
enum tree_code lcode,
enum tree_code rcode,
tree truth_type,
tree ll_arg,
tree lr_arg )
Return a tree for the comparison which is the combination of doing the AND or OR (depending on CODE) of the two operations LCODE and RCODE on the identical operands LL_ARG and LR_ARG. Take into account the possibility of trapping if the mode has NaNs, and return NULL_TREE if this makes the transformation invalid.

References comparison_to_compcode(), COMPCODE_EQ, COMPCODE_FALSE, COMPCODE_LTGT, COMPCODE_NE, COMPCODE_ORD, compcode_to_comparison(), COMPCODE_TRUE, COMPCODE_UNORD, constant_boolean_node(), fold_build2_loc(), HONOR_NANS(), and NULL_TREE.

Referenced by and_comparisons_1(), fold_truth_andor_1(), and or_comparisons_1().

â—† comparison_to_compcode()

enum comparison_code comparison_to_compcode ( enum tree_code code)
static
Convert a comparison tree code from an enum tree_code representation into a compcode bit-based encoding. This function is the inverse of compcode_to_comparison.

References COMPCODE_EQ, COMPCODE_GE, COMPCODE_GT, COMPCODE_LE, COMPCODE_LT, COMPCODE_LTGT, COMPCODE_NE, COMPCODE_ORD, COMPCODE_UNEQ, COMPCODE_UNGE, COMPCODE_UNGT, COMPCODE_UNLE, COMPCODE_UNLT, COMPCODE_UNORD, and gcc_unreachable.

Referenced by combine_comparisons().

â—† compcode_to_comparison()

enum tree_code compcode_to_comparison ( enum comparison_code code)
static
Convert a compcode bit-based encoding of a comparison operator back to GCC's enum tree_code representation. This function is the inverse of comparison_to_compcode.

References COMPCODE_EQ, COMPCODE_GE, COMPCODE_GT, COMPCODE_LE, COMPCODE_LT, COMPCODE_LTGT, COMPCODE_NE, COMPCODE_ORD, COMPCODE_UNEQ, COMPCODE_UNGE, COMPCODE_UNGT, COMPCODE_UNLE, COMPCODE_UNLT, COMPCODE_UNORD, and gcc_unreachable.

Referenced by combine_comparisons().

â—† const_binop() [1/2]

tree const_binop ( enum tree_code code,
tree arg1,
tree arg2 )
static
Combine two constants ARG1 and ARG2 under operation CODE to produce a new constant. We assume ARG1 and ARG2 have the same data type, or at least are the same kind of constant and the same machine mode. Return zero if combining the constants is not allowed in the current operating mode.

References boolean_type_node, build_complex(), build_fixed(), build_real(), commutative_tree_code(), COMPLEX_FLOAT_TYPE_P, const_binop(), d1, d2, dconst0, do_mpc_arg2(), generic_wide_int< storage >::elt(), f1, f2, fixed_arithmetic(), FIXED_VALUE_TYPE, fold_abs_const(), fold_build2, fold_convert, folding_initializer, HONOR_SNANS(), i1, i2, int_const_binop(), integer_nonzerop(), MODE_COMPOSITE_P, MODE_HAS_INFINITIES, MODE_HAS_NANS, NULL_TREE, poly_int_tree_p(), real_arithmetic(), real_convert(), real_equal(), real_identical(), REAL_VALUE_ISINF, REAL_VALUE_ISNAN, REAL_VALUE_ISSIGNALING_NAN, REAL_VALUE_TYPE, simplify_const_binop(), STRIP_NOPS, wi::to_wide(), TREE_CODE, TREE_FIXED_CST, TREE_IMAGPART, TREE_OVERFLOW, TREE_REAL_CST, TREE_REALPART, TREE_TYPE, TYPE_MODE, TYPE_SATURATING, generic_wide_int< storage >::ulow(), value, and vector_const_binop().

Referenced by attempt_builtin_copysign(), build_range_check(), const_binop(), const_binop(), tree_switch_conversion::jump_table_cluster::emit(), extract_muldiv_1(), fold_binary_loc(), fold_const_fold_left(), fold_const_reduction(), generate_range_test(), gimple_resimplify2(), gimple_simplify(), maybe_warn_nonstring_arg(), optimize_bit_field_compare(), optimize_pow_to_exp(), and valid_mask_for_fold_vec_perm_cst_p().

â—† const_binop() [2/2]

â—† const_unop()

â—† constant_boolean_node()

â—† contains_label_1()

tree contains_label_1 ( tree * tp,
int * walk_subtrees,
void * data )
static
Callback for walk_tree, looking for LABEL_EXPR. Return *TP if it is a LABEL_EXPR or CASE_LABEL_EXPR not inside of another SWITCH_EXPR; otherwise return NULL_TREE. Do not check the subtrees of GOTO_EXPR.

References contains_label_1(), contains_label_data::inside_switch_p, NULL_TREE, contains_label_data::pset, SWITCH_BODY, SWITCH_COND, TREE_CODE, and walk_tree.

Referenced by contains_label_1(), and contains_label_p().

â—† contains_label_p()

bool contains_label_p ( tree st)
static
Return whether the sub-tree ST contains a label which is accessible from outside the sub-tree.

References contains_label_1(), NULL_TREE, and walk_tree.

Referenced by fold_ternary_loc().

â—† convert_to_ptrofftype_loc()

tree convert_to_ptrofftype_loc ( location_t loc,
tree off )
Return OFF converted to a pointer offset type suitable as offset for POINTER_PLUS_EXPR. Use location LOC for this conversion.

References fold_convert_loc(), ptrofftype_p(), sizetype, and TREE_TYPE.

Referenced by fold_build_pointer_plus_loc(), gimplify_self_mod_expr(), and omp_adjust_for_condition().

â—† ctor_single_nonzero_element()

tree ctor_single_nonzero_element ( const_tree t)
Return the single non-zero element of a CONSTRUCTOR or NULL_TREE.

References CONSTRUCTOR_ELTS, integer_zerop(), NULL_TREE, real_zerop(), TREE_CODE, constructor_elt::value, and vec_safe_iterate().

â—† distributes_over_addition_p()

bool distributes_over_addition_p ( tree_code op,
int opno )
static
Return true if binary operation OP distributes over addition in operand OPNO, with the other operand being held constant. OPNO counts from 1.

Referenced by vector_const_binop().

â—† div_if_zero_remainder()

tree div_if_zero_remainder ( const_tree arg1,
const_tree arg2 )
If ARG2 divides ARG1 with zero remainder, carries out the exact division and returns the quotient. Otherwise returns NULL_TREE.

References wi::multiple_of_p(), NULL_TREE, SIGNED, wi::to_widest(), TREE_TYPE, and wide_int_to_tree().

â—† eval_subst()

tree eval_subst ( location_t loc,
tree arg,
tree old0,
tree new0,
tree old1,
tree new1 )
static
ARG is a tree that is known to contain just arithmetic operations and comparisons. Evaluate the operations in the tree substituting NEW0 for any occurrence of OLD0 as an operand of a comparison and likewise for NEW1 and OLD1.

References eval_subst(), fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), operand_equal_p(), tcc_binary, tcc_comparison, tcc_expression, tcc_unary, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and TREE_TYPE.

Referenced by eval_subst(), and fold_comparison().

â—† exact_inverse()

tree exact_inverse ( tree type,
tree cst )

â—† expr_location_or()

location_t expr_location_or ( tree t,
location_t loc )
static
Return EXPR_LOCATION of T if it is not UNKNOWN_LOCATION. Otherwise, return LOC.

References EXPR_LOCATION, and UNKNOWN_LOCATION.

Referenced by fold_ternary_loc(), and fold_truth_not_expr().

â—† expr_not_equal_to()

â—† extract_muldiv()

tree extract_muldiv ( tree t,
tree c,
enum tree_code code,
tree wide_type,
bool * strict_overflow_p )
static
T is an integer expression that is being multiplied, divided, or taken a modulus (CODE says which and what kind of divide or modulus) by a constant C. See if we can eliminate that operation by folding it with other operations already in T. WIDE_TYPE, if non-null, is a type that should be used for the computation if wider than our type. For example, if we are dividing (X * 8) + (Y * 16) by 4, we can return (X * 2) + (Y * 4). We must, however, be assured that either the original expression would not overflow or that overflow is undefined for the type in the language in question. If we return a non-null expression, it is an equivalent form of the original computation, but need not be in the original type. We set *STRICT_OVERFLOW_P to true if the return values depends on signed overflow being undefined. Otherwise we do not change *STRICT_OVERFLOW_P.

References extract_muldiv_1(), and NULL.

Referenced by extract_muldiv_1(), and fold_binary_loc().

â—† extract_muldiv_1()

â—† find_bitfield_repr_type()

tree find_bitfield_repr_type ( int fieldsize,
int len )
Try to find a type whose byte size is smaller or equal to LEN bytes larger or equal to FIELDSIZE bytes, with underlying mode precision/size multiple of BITS_PER_UNIT. As native_{interpret,encode}_int works in term of machine modes, we can't just use build_nonstandard_integer_type.

References FOR_EACH_MODE_IN_CLASS, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_SIZE(), i, int_n_data, int_n_enabled_p, int_n_trees, known_eq, known_ge, known_le, NULL_TREE, lang_hooks_for_types::type_for_mode, TYPE_MODE, and lang_hooks::types.

Referenced by native_encode_initializer(), and native_interpret_aggregate().

â—† fold()

tree fold ( tree expr)
Perform constant folding and related simplification of EXPR. The related simplifications include x*1 => x, x*0 => 0, etc., and application of the associative law. NOP_EXPR conversions may be removed freely (as long as we are careful not to change the type of the overall expression). We cannot simplify through a CONVERT_EXPR, FIX_EXPR or FLOAT_EXPR, but we can constant-fold them if they have constant operands.

References build_int_cst(), build_vector_from_ctor(), CONSTANT_CLASS_P, CONSTRUCTOR_ELT, CONSTRUCTOR_ELTS, DECL_INITIAL, EXPR_LOCATION, fold(), fold_binary_loc(), fold_call_expr(), fold_ternary_loc(), fold_unary_loc(), FOR_EACH_CONSTRUCTOR_VALUE, gcc_checking_assert, get_array_ctor_element_at_index(), i, IS_EXPR_CODE_CLASS, NULL_TREE, RAW_DATA_LENGTH, RAW_DATA_UCHAR_ELT, tcc_constant, tcc_vl_exp, wi::to_offset(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_OPERAND, TREE_TYPE, and type_contains_placeholder_p().

Referenced by expand_expr_real_1(), expand_simple_operations(), fold(), fold_init(), fold_mem_refs(), simplify_replace_tree(), substitute_in_expr(), and substitute_placeholder_in_expr().

â—† fold_abs_const()

tree fold_abs_const ( tree arg0,
tree type )
Return the tree for abs (ARG0) when ARG0 is known to be either an integer constant or real constant. TYPE is the type of the result.

References build_real(), force_fit_type(), gcc_unreachable, wi::neg(), wi::neg_p(), NULL_TREE, wi::OVF_NONE, real_value_negate(), REAL_VALUE_NEGATIVE, wi::to_wide(), TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST, TREE_TYPE, and TYPE_SIGN.

Referenced by const_binop(), and const_unop().

â—† fold_addr_of_array_ref_difference()

tree fold_addr_of_array_ref_difference ( location_t loc,
tree type,
tree aref0,
tree aref1,
bool use_pointer_diff )
static
Try to fold a pointer difference of type TYPE two address expressions of array references AREF0 and AREF1 using location LOC. Return a simplified expression for the difference or NULL_TREE.

References array_ref_element_size(), build_int_cst(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_build2_loc(), fold_convert, fold_convert_loc(), INDIRECT_REF_P, NULL_TREE, OEP_ADDRESS_OF, operand_equal_p(), TREE_CODE, and TREE_OPERAND.

Referenced by fold_addr_of_array_ref_difference(), and fold_binary_loc().

â—† fold_binary_initializer_loc()

tree fold_binary_initializer_loc ( location_t loc,
tree_code code,
tree type,
tree lhs,
tree rhs )

â—† fold_binary_loc()

tree fold_binary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 )
Fold a binary expression of code CODE and type TYPE with operands OP0 and OP1. LOC is the location of the resulting expression. Return the folded expression if folding is successful. Otherwise, return NULL_TREE.

References ANY_INTEGRAL_TYPE_P, associate_trees(), wi::bit_and_not(), boolean_false_node, boolean_true_node, boolean_type_node, build1(), build1_loc(), build2(), build2_loc(), build_fold_indirect_ref_loc(), build_int_cst(), build_one_cst(), build_pointer_type(), build_qualified_type(), build_zero_cst(), CALL_EXPR_ARG, call_expr_nargs, char_type_node, commutative_tree_code(), compare_tree_int(), COMPARISON_CLASS_P, COMPLEX_FLOAT_TYPE_P, const_binop(), constant_boolean_node(), CONSTANT_CLASS_P, CONVERT_EXPR_P, element_precision(), wi::exact_log2(), extract_muldiv(), FLOAT_TYPE_P, fndecl_built_in_p(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_binary_op_with_conditional_arg(), fold_build1_loc(), fold_build2, fold_build2_loc(), fold_comparison(), fold_convert, fold_convert_loc(), fold_mult_zconjz(), fold_overflow_warning(), fold_plusminus_mult_expr(), fold_to_nonsharp_ineq_using_bound(), fold_truth_andor(), fold_unary_loc(), wide_int_storage::from(), gcc_assert, gcc_unreachable, generic_simplify(), get_addr_base_and_unit_offset(), get_callee_fndecl(), GET_MODE_UNIT_PRECISION, handled_component_p(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), HONOR_SNANS(), int_const_binop(), integer_one_node, integer_onep(), integer_pow2p(), integer_zero_node, integer_zerop(), INTEGRAL_TYPE_P, invert_truthvalue_loc(), IS_EXPR_CODE_CLASS, is_truth_type_for(), wi::mask(), mask_with_tz(), MODE_HAS_INFINITIES, multiple_of_p(), negate_expr(), negate_expr_p(), non_lvalue_loc(), NULL_TREE, OEP_ONLY_CONST, omit_one_operand_loc(), omit_two_operands_loc(), operand_equal_p(), optimize_bit_field_compare(), POINTER_TYPE_P, wi::popcount(), pow2p_hwi(), real_minus_onep(), real_onep(), REAL_VALUE_NEGATIVE, real_zerop(), save_expr(), signed_type_for(), size_int, sizetype, split_tree(), strip_float_extensions(), STRIP_NOPS, STRIP_SIGN_NOPS, swap_tree_comparison(), tcc_binary, tcc_comparison, wi::to_wide(), wi::to_widest(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_CONSTANT, tree_expr_nonnegative_warnv_p, TREE_IMAGPART, tree_int_cst_lt(), tree_int_cst_sgn(), TREE_OPERAND, TREE_OVERFLOW, TREE_OVERFLOW_P, TREE_REAL_CST, TREE_REALPART, TREE_SIDE_EFFECTS, tree_swap_operands_p(), TREE_TYPE, truth_value_p(), TYPE_MODE, TYPE_OVERFLOW_SANITIZED, TYPE_OVERFLOW_UNDEFINED, TYPE_OVERFLOW_WRAPS, TYPE_PRECISION, TYPE_QUAL_CONST, TYPE_SATURATING, TYPE_UNSIGNED, UNSIGNED, VECTOR_INTEGER_TYPE_P, VECTOR_TYPE_P, WARN_STRICT_OVERFLOW_CONDITIONAL, WARN_STRICT_OVERFLOW_MISC, and wide_int_to_tree().

Referenced by combine_cond_expr_cond(), copy_prop_visit_cond_stmt(), fold(), fold_addr_of_array_ref_difference(), fold_binary_initializer_loc(), fold_binary_loc(), fold_build2_loc(), fold_builtin_arith_overflow(), fold_to_nonsharp_ineq_using_bound(), gimple_fold_stmt_to_constant_1(), and dom_opt_dom_walker::optimize_stmt().

â—† fold_binary_op_with_conditional_arg()

tree fold_binary_op_with_conditional_arg ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1,
tree cond,
tree arg,
int cond_first_p )
static
Transform `a + (b ? x : y)' into `b ? (a + x) : (a + y)'. Transform, `a + (x < y)' into `(x < y) ? (a + 1) : (a + 0)'. Here CODE corresponds to the `+', COND to the `(b ? x : y)' or `(x < y)' expression, and ARG to `a'. If COND_FIRST_P is nonzero, then the COND is the first argument to CODE; otherwise (as in the example given here), it is the second argument. TYPE is the type of the original expression. Return NULL_TREE if no simplification is possible.

References ANY_INTEGRAL_TYPE_P, arg_type, constant_boolean_node(), FLOAT_TYPE_P, fold_build2_loc(), fold_build3_loc(), fold_convert_loc(), NULL_TREE, operation_could_trap_p(), TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_OVERFLOW_TRAPS, VECTOR_TYPE_P, and VOID_TYPE_P.

Referenced by fold_binary_loc().

â—† fold_binary_to_constant()

tree fold_binary_to_constant ( enum tree_code code,
tree type,
tree op0,
tree op1 )
Given the components of a binary expression CODE, TYPE, OP0 and OP1, attempt to fold the expression to a constant without modifying TYPE, OP0 or OP1. If the expression could be simplified to a constant, then return the constant. If the expression would not be simplified to a constant, then return NULL_TREE.

References fold_binary, NULL_TREE, and TREE_CONSTANT.

Referenced by compare_values_warnv(), evaluate_conditions_for_known_args(), maybe_fold_tmr(), number_of_iterations_cond(), and number_of_iterations_ne().

â—† fold_bit_and_mask()

tree fold_bit_and_mask ( tree type,
tree arg1,
enum tree_code code,
tree arg00,
enum tree_code code00,
tree arg000,
tree arg001,
tree arg01,
enum tree_code code01,
tree arg010,
tree arg011,
tree * pmop )
For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M, ((A & N) + B) & M -> (A + B) & M Similarly if (N & M) == 0, ((A | N) + B) & M -> (A + B) & M and for - instead of + (or unary - instead of +) and/or ^ instead of |. If B is constant and (B & M) == 0, fold into A & M. This function is a helper for match.pd patterns. Return non-NULL type in which the simplified operation should be performed only if any optimization is possible. ARG1 is M above, ARG00 is left operand of +/-, if CODE00 is BIT_*_EXPR, then ARG00{0,1} are operands of that bitop, otherwise CODE00 is ERROR_MARK. Similarly for ARG01, CODE01 and ARG01{0,1}, just for the right operand of +/-.

References build_int_cst(), gcc_assert, gcc_unreachable, INTEGRAL_TYPE_P, wi::max_value(), NULL_TREE, wi::to_wide(), TREE_CODE, TYPE_OVERFLOW_WRAPS, and unsigned_type_for().

â—† fold_build1_initializer_loc()

tree fold_build1_initializer_loc ( location_t loc,
enum tree_code code,
tree type,
tree op )

â—† fold_build1_loc()

â—† fold_build2_initializer_loc()

tree fold_build2_initializer_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 )

â—† fold_build2_loc()

tree fold_build2_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 MEM_STAT_DECL )
Fold a binary tree expression with code CODE of type TYPE with operands OP0 and OP1. LOC is the location of the resulting expression. Return a folded expression if successful. Otherwise, return a tree expression with code CODE of type TYPE with operands OP0 and OP1.

References build2_loc(), fold_binary_loc(), MEM_STAT_DECL, and PASS_MEM_STAT.

Referenced by adjust_related_strinfos(), array_type_nelts_top(), associate_trees(), tree_switch_conversion::switch_conversion::build_arrays(), build_debug_ref_for_model(), build_range_check(), build_ref_for_offset(), c_strlen(), combine_comparisons(), compute_access_range(), dr_analyze_indices(), tree_switch_conversion::bit_test_cluster::emit(), eval_subst(), expand_builtin_cexpi(), expand_builtin_signbit(), expand_builtin_sincos(), expand_builtin_strncmp(), expand_builtin_strnlen(), expand_omp_ordered_sink(), expand_parallel_call(), expand_single_bit_test(), expand_task_call(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_binary_op_with_conditional_arg(), fold_build2_initializer_loc(), fold_build_pointer_plus_hwi_loc(), fold_build_pointer_plus_loc(), fold_builtin_addc_subc(), fold_builtin_arith_overflow(), fold_builtin_classify(), fold_builtin_fpclassify(), fold_builtin_frexp(), fold_builtin_isascii(), fold_builtin_isdigit(), fold_builtin_iseqsig(), fold_builtin_memcmp(), fold_builtin_modf(), fold_builtin_toascii(), fold_builtin_unordered_cmp(), fold_comparison(), fold_cond_expr_with_comparison(), fold_convert_loc(), fold_mult_zconjz(), fold_negate_expr_1(), fold_or_predicates(), fold_plusminus_mult_expr(), fold_ternary_loc(), fold_to_nonsharp_ineq_using_bound(), fold_truth_andor(), fold_truth_andor_for_ifcombine(), fold_unary_loc(), gimple_load_first_char(), gimplify_bind_expr(), gimplify_expr(), gimplify_omp_affinity(), gimplify_omp_depend(), gimplify_scalar_mode_aggregate_compare(), strlen_pass::handle_builtin_memcmp(), strlen_pass::handle_builtin_memcpy(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_strlen(), strlen_pass::handle_store(), ifcombine_ifandif(), lower_omp_for_scan(), lower_omp_target(), lower_rec_input_clauses(), lower_reduction_clauses(), make_range_step(), maybe_canonicalize_comparison_1(), maybe_optimize_arith_overflow(), maybe_optimize_mod_cmp(), merge_truthop_with_opposite_arm(), ipa_param_adjustments::modify_call(), omp_accumulate_sibling_list(), omp_adjust_for_condition(), omp_extract_for_data(), optimize_bit_field_compare(), optimize_range_tests_to_bit_test(), rhs_to_tree(), set_endptr_and_length(), simplify_builtin_call(), size_binop_loc(), stabilize_va_list_loc(), std_gimplify_va_arg_expr(), and try_transform_to_exit_first_loop_alt().

â—† fold_build3_loc()

tree fold_build3_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1,
tree op2 MEM_STAT_DECL )
Fold a ternary tree expression with code CODE of type TYPE with operands OP0, OP1, and OP2. Return a folded expression if successful. Otherwise, return a tree expression with code CODE of type TYPE with operands OP0, OP1, and OP2.

References build3_loc(), fold_ternary_loc(), gcc_assert, MEM_STAT_DECL, PASS_MEM_STAT, tcc_vl_exp, and TREE_CODE_CLASS.

Referenced by build_ref_for_model(), c_strlen(), eval_subst(), expand_omp_ordered_sink(), expand_task_call(), expand_vector_ubsan_overflow(), fold_binary_op_with_conditional_arg(), fold_builtin_classify(), fold_builtin_fpclassify(), fold_indirect_ref_1(), fold_ternary_loc(), fold_unary_loc(), gimplify_omp_affinity(), gimplify_omp_depend(), and rhs_to_tree().

â—† fold_build_call_array_initializer_loc()

tree fold_build_call_array_initializer_loc ( location_t loc,
tree type,
tree fn,
int nargs,
tree * argarray )

â—† fold_build_call_array_loc()

tree fold_build_call_array_loc ( location_t loc,
tree type,
tree fn,
int nargs,
tree * argarray )
Fold a CALL_EXPR expression of type TYPE with operands FN and NARGS arguments in ARGARRAY, and a null static chain. Return a folded expression if successful. Otherwise, return a CALL_EXPR of type TYPE from the given operands as constructed by build_call_array.

References build_call_array_loc(), fold_builtin_call_array(), i, and NULL_TREE.

Referenced by build_call_expr_loc_array(), and fold_build_call_array_initializer_loc().

â—† fold_build_cleanup_point_expr()

tree fold_build_cleanup_point_expr ( tree type,
tree expr )
If necessary, return a CLEANUP_POINT_EXPR for EXPR with the indicated TYPE. If no CLEANUP_POINT_EXPR is necessary, return EXPR itself.

References build1_loc(), EXPR_LOCATION, TREE_CODE, TREE_OPERAND, and TREE_SIDE_EFFECTS.

â—† fold_build_pointer_plus_hwi_loc()

tree fold_build_pointer_plus_hwi_loc ( location_t loc,
tree ptr,
HOST_WIDE_INT off )
Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.

References fold_build2_loc(), size_int, and TREE_TYPE.

Referenced by fold_builtin_strpbrk(), and thunk_adjust().

â—† fold_build_pointer_plus_loc()

tree fold_build_pointer_plus_loc ( location_t loc,
tree ptr,
tree off )
Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.

References convert_to_ptrofftype_loc(), fold_build2_loc(), and TREE_TYPE.

Referenced by compute_access_range(), fold_unary_loc(), gimple_fold_builtin_strcat(), omp_adjust_for_condition(), and thunk_adjust().

â—† fold_comparison()

tree fold_comparison ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 )
static

â—† fold_cond_expr_with_comparison()

tree fold_cond_expr_with_comparison ( location_t loc,
tree type,
enum tree_code comp_code,
tree arg00,
tree arg01,
tree arg1,
tree arg2 )
static
Subroutine of fold, looking inside expressions of the form A op B ? A : C, where (ARG00, COMP_CODE, ARG01), ARG1 and ARG2 are the three operands of the COND_EXPR. This function is being used also to optimize A op B ? C : A, by reversing the comparison first. Return a folded expression whose code is not a COND_EXPR anymore, or NULL_TREE if no folding opportunity is found.

References ANY_INTEGRAL_TYPE_P, build_zero_cst(), FLOAT_TYPE_P, fold_build1_loc(), fold_build2_loc(), fold_convert_loc(), gcc_assert, HONOR_NANS(), HONOR_SIGNED_ZEROS(), in_gimple_form, integer_zerop(), lang_GNU_CXX(), maybe_lvalue_p(), lang_hooks::name, negate_expr(), NULL_TREE, operand_equal_for_comparison_p(), operand_equal_p(), real_zerop(), STRIP_NOPS, tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, TYPE_OVERFLOW_WRAPS, TYPE_UNSIGNED, unsigned_type_for(), and VECTOR_TYPE_P.

Referenced by fold_ternary_loc().

â—† fold_convert_const()

â—† fold_convert_const_fixed_from_fixed()

tree fold_convert_const_fixed_from_fixed ( tree type,
const_tree arg1 )
static
A subroutine of fold_convert_const handling conversions a FIXED_CST to another fixed-point type.

References build_fixed(), fixed_convert(), FIXED_VALUE_TYPE, SCALAR_TYPE_MODE, TREE_FIXED_CST, TREE_OVERFLOW, TYPE_SATURATING, and value.

Referenced by fold_convert_const().

â—† fold_convert_const_fixed_from_int()

tree fold_convert_const_fixed_from_int ( tree type,
const_tree arg1 )
static

â—† fold_convert_const_fixed_from_real()

tree fold_convert_const_fixed_from_real ( tree type,
const_tree arg1 )
static
A subroutine of fold_convert_const handling conversions a REAL_CST to a fixed-point type.

References build_fixed(), fixed_convert_from_real(), FIXED_VALUE_TYPE, SCALAR_TYPE_MODE, TREE_OVERFLOW, TREE_REAL_CST, TYPE_SATURATING, and value.

Referenced by fold_convert_const().

â—† fold_convert_const_int_from_fixed()

tree fold_convert_const_int_from_fixed ( tree type,
const_tree arg1 )
static

â—† fold_convert_const_int_from_int()

tree fold_convert_const_int_from_int ( tree type,
const_tree arg1 )
static
A subroutine of fold_convert_const handling conversions of an INTEGER_CST to another integer type.

References force_fit_type(), wide_int_storage::from(), MAX, POINTER_TYPE_P, wi::to_wide(), TREE_OVERFLOW, TREE_TYPE, TYPE_PRECISION, and TYPE_SIGN.

Referenced by fold_convert_const().

â—† fold_convert_const_int_from_real()

tree fold_convert_const_int_from_real ( enum tree_code code,
tree type,
const_tree arg1 )
static

â—† fold_convert_const_real_from_fixed()

tree fold_convert_const_real_from_fixed ( tree type,
const_tree arg1 )
static
A subroutine of fold_convert_const handling conversions a FIXED_CST to a floating point type.

References build_real(), real_convert_from_fixed(), REAL_VALUE_TYPE, SCALAR_FLOAT_TYPE_MODE, TREE_FIXED_CST, TREE_OVERFLOW, and value.

Referenced by fold_convert_const().

â—† fold_convert_const_real_from_real()

tree fold_convert_const_real_from_real ( tree type,
const_tree arg1 )
static

â—† fold_convert_loc()

tree fold_convert_loc ( location_t loc,
tree type,
tree arg )
Convert expression ARG to type TYPE. Used by the middle-end for simple conversions in preference to calling the front-end's convert.

References build_zero_vector(), error_mark_node, fold_build1_loc(), fold_build2_loc(), fold_convert_const(), fold_convert_loc(), fold_ignored_result(), gcc_assert, gcc_unreachable, integer_zero_node, integer_zerop(), INTEGRAL_TYPE_P, NULL_TREE, POINTER_TYPE_P, protected_set_expr_location_unshare(), save_expr(), TREE_CODE, tree_int_cst_equal(), TREE_OPERAND, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_MAIN_VARIANT, TYPE_SIZE, and VECTOR_TYPE_P.

Referenced by adjust_related_strinfos(), array_ref_element_size(), associate_trees(), tree_switch_conversion::switch_conversion::build_arrays(), build_builtin_expect_predicate(), build_fold_addr_expr_with_type_loc(), build_range_check(), c_strlen(), component_ref_field_offset(), compute_access_range(), convert_to_ptrofftype_loc(), tree_switch_conversion::bit_test_cluster::emit(), expand_arith_overflow(), expand_builtin_bzero(), expand_builtin_memcmp(), expand_builtin_strncmp(), expand_builtin_strnlen(), expand_expr_real_1(), expand_expr_real_2(), expand_omp_atomic_fetch_op(), expand_omp_ordered_sink(), expand_omp_target(), expand_parallel_call(), expand_single_bit_test(), expand_task_call(), finish_taskreg_scan(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_binary_op_with_conditional_arg(), fold_builtin_abs(), fold_builtin_arith_overflow(), fold_builtin_expect(), fold_builtin_fabs(), fold_builtin_isdigit(), fold_builtin_iseqsig(), fold_builtin_memcmp(), fold_builtin_strcspn(), fold_builtin_strlen(), fold_builtin_strpbrk(), fold_builtin_unordered_cmp(), fold_comparison(), fold_cond_expr_with_comparison(), fold_convert_loc(), fold_negate_expr(), fold_negate_expr_1(), fold_plusminus_mult_expr(), fold_read_from_constant_string(), fold_ternary_loc(), fold_to_nonsharp_ineq_using_bound(), fold_truth_andor_for_ifcombine(), fold_unary_loc(), tree_switch_conversion::switch_conversion::gen_inbound_check(), get_ws_args_for(), gimple_boolify(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strcpy(), gimple_fold_builtin_strncpy(), gimplify_addr_expr(), gimplify_expr(), gimplify_modify_expr(), gimplify_omp_depend(), strlen_pass::handle_builtin_memcmp(), strlen_pass::handle_builtin_memcpy(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_strlen(), layout_decl(), lower_builtin_setjmp(), lower_copyprivate_clauses(), lower_omp_for_scan(), lower_omp_single_copy(), lower_omp_single_simple(), lower_omp_target(), lower_omp_taskreg(), lower_rec_input_clauses(), lower_reduction_clauses(), make_bit_field_ref(), make_range_step(), maybe_optimize_arith_overflow(), maybe_optimize_mod_cmp(), ipa_param_adjustments::modify_call(), negate_expr(), omit_one_operand_loc(), omit_two_operands_loc(), omp_accumulate_sibling_list(), omp_extract_for_data(), omp_reduction_init_op(), optimize_bit_field_compare(), optimize_range_tests_to_bit_test(), optimize_stdarg_builtin(), predicate_bbs(), record_edge_info(), set_endptr_and_length(), simplify_builtin_call(), size_diffop_loc(), store_expr(), update_range_test(), and worker_single_simple().

â—† fold_convertible_p()

â—† fold_defer_overflow_warnings()

â—† fold_deferring_overflow_warnings_p()

bool fold_deferring_overflow_warnings_p ( void )
Whether we are deferring overflow warnings.

References fold_deferring_overflow_warnings.

Referenced by verify_interpass_invariants().

â—† fold_div_compare()

enum tree_code fold_div_compare ( enum tree_code code,
tree c1,
tree c2,
tree * lo,
tree * hi,
bool * neg_overflow )
Subroutine of match.pd that optimizes comparisons of a division by a nonzero integer constant against an integer constant, i.e. X/C1 op C2. CODE is the comparison operator: EQ_EXPR, NE_EXPR, GT_EXPR, LT_EXPR, GE_EXPR or LE_EXPR. ARG01 and ARG1 must be a INTEGER_CST.

References wi::add(), build_int_cst(), fold_negate_const(), force_fit_type(), gcc_unreachable, int_const_binop(), wi::mul(), NULL_TREE, operand_equal_p(), swap_tree_comparison(), wi::to_wide(), tree_int_cst_sgn(), TREE_OVERFLOW, TREE_TYPE, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_SIGN, and UNSIGNED.

â—† fold_ignored_result()

tree fold_ignored_result ( tree t)
Strip non-trapping, non-side-effecting tree nodes from an expression whose result is ignored. The type of the returned tree need not be the same as the original expression.

References integer_zero_node, tcc_binary, tcc_comparison, tcc_expression, tcc_unary, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and TREE_SIDE_EFFECTS.

Referenced by fold_convert_loc(), and omit_one_operand_loc().

â—† fold_indirect_ref_1()

â—† fold_indirect_ref_loc()

tree fold_indirect_ref_loc ( location_t loc,
tree t )
Given an INDIRECT_REF T, return either T or a simplified version.

References fold_indirect_ref_1(), TREE_OPERAND, and TREE_TYPE.

Referenced by gimplify_compound_lval(), and gimplify_expr().

â—† fold_init()

tree fold_init ( tree expr)

â—† fold_invert_truthvalue()

tree fold_invert_truthvalue ( location_t loc,
tree arg )
static
Fold the truth-negation of ARG. This never alters ARG itself. We assume that ARG is an operation that returns a truth value (0 or 1 for scalars, 0 or -1 for vectors). Return the folded expression if folding is successful. Otherwise, return NULL_TREE.

References fold_unary_loc(), TREE_TYPE, and VECTOR_TYPE_P.

Referenced by fold_ternary_loc().

â—† fold_mult_zconjz()

tree fold_mult_zconjz ( location_t loc,
tree type,
tree expr )
static
Subroutine of fold_binary. Optimize complex multiplications of the form z * conj(z), as pow(realpart(z),2) + pow(imagpart(z),2). The argument EXPR represents the expression "z" of type TYPE.

References build_zero_cst(), fold_build1_loc(), fold_build2_loc(), save_expr(), TREE_CODE, TREE_IMAGPART, TREE_OPERAND, TREE_REALPART, and TREE_TYPE.

Referenced by fold_binary_loc().

â—† fold_negate_const()

tree fold_negate_const ( tree arg0,
tree type )
static
Return the tree for neg (ARG0) when ARG0 is known to be either an integer constant, real, or fixed-point constant. TYPE is the type of the result.

References build_fixed(), build_real(), fixed_arithmetic(), FIXED_VALUE_TYPE, force_fit_type(), gcc_unreachable, wi::neg(), NULL, NULL_TREE, poly_int_tree_p(), real_value_negate(), wi::to_poly_wide(), TREE_CODE, TREE_FIXED_CST, TREE_OVERFLOW, TREE_REAL_CST, TYPE_SATURATING, and TYPE_UNSIGNED.

Referenced by const_unop(), fold_div_compare(), and fold_negate_expr_1().

â—† fold_negate_expr()

tree fold_negate_expr ( location_t loc,
tree t )
static

â—† fold_negate_expr_1()

â—† fold_not_const()

tree fold_not_const ( const_tree arg0,
tree type )
static
Return the tree for not (ARG0) when ARG0 is known to be an integer constant. TYPE is the type of the result.

References force_fit_type(), gcc_assert, wi::to_wide(), TREE_CODE, and TREE_OVERFLOW.

Referenced by const_unop().

â—† fold_overflow_warning()

void fold_overflow_warning ( const char * gmsgid,
enum warn_strict_overflow_code wc )

â—† fold_plusminus_mult_expr()

tree fold_plusminus_mult_expr ( location_t loc,
enum tree_code code,
tree type,
tree arg0,
tree arg1 )
static

â—† fold_range_test()

tree fold_range_test ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 )
static

â—† fold_read_from_constant_string()

tree fold_read_from_constant_string ( tree exp)
If EXP represents referencing an element in a constant string (either via pointer arithmetic or array indexing), return the tree representing the value accessed, otherwise return NULL.

References array_ref_low_bound(), build_int_cst_type(), compare_tree_int(), exp(), EXPR_LOCATION, fold_convert_loc(), GET_MODE_SIZE(), INDIRECT_REF_P, integer_zerop(), is_int_mode(), NULL, size_diffop_loc(), sizetype, string_constant(), TREE_CODE, tree_fits_uhwi_p(), TREE_INT_CST_LOW, TREE_OPERAND, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TYPE, and TYPE_MODE.

Referenced by expand_expr_real_1(), fold_const_aggregate_ref_1(), and fold_indirect_ref_1().

â—† fold_read_from_vector()

tree fold_read_from_vector ( tree arg,
poly_uint64 idx )

â—† fold_real_zero_addition_p()

bool fold_real_zero_addition_p ( const_tree type,
const_tree arg,
const_tree zero_arg,
int negate )
Subroutine of fold() that checks for the addition of ARG +/- 0.0. If !NEGATE, return true if ZERO_ARG is +/-0.0 and, for all ARG of type TYPE, ARG + ZERO_ARG is the same as ARG. If NEGATE, return true if ARG - ZERO_ARG is the same as X. If ARG is NULL, check for any value of type TYPE. X + 0 and X - 0 both give X when X is NaN, infinite, or nonzero and finite. The problematic cases are when X is zero, and its mode has signed zeros. In the case of rounding towards -infinity, X - 0 is not the same as X because 0 - 0 is -0. In other rounding modes, X + 0 is not the same as X because -0 + 0 is 0.

References HONOR_SIGN_DEPENDENT_ROUNDING(), HONOR_SIGNED_ZEROS(), HONOR_SNANS(), REAL_VALUE_MINUS_ZERO, real_zerop(), TREE_CODE, tree_expr_maybe_real_minus_zero_p(), tree_expr_maybe_signaling_nan_p(), TREE_REAL_CST, and uniform_vector_p().

Referenced by eliminate_using_constants().

â—† fold_relational_const()

â—† fold_ternary_loc()

tree fold_ternary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1,
tree op2 )
Fold a ternary expression of code CODE and type TYPE with operands OP0, OP1, and OP2. Return the folded expression if folding is successful. Otherwise, return NULL_TREE.

References b, wi::bit_or(), tree_vector_builder::build(), can_native_interpret_type_p(), commutative_ternary_tree_code(), COMPARISON_CLASS_P, CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, contains_label_p(), expr_location_or(), fold_build1, fold_build2_loc(), fold_build3_loc(), fold_cond_expr_with_comparison(), fold_convert_loc(), fold_invert_truthvalue(), fold_vec_perm(), FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, gcc_unreachable, generic_simplify(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), i, integer_all_onesp(), integer_onep(), integer_pow2p(), integer_zerop(), invert_tree_comparison(), invert_truthvalue_loc(), IS_EXPR_CODE_CLASS, known_le, wi::lshift(), native_encode_expr(), native_interpret_expr(), NULL, NULL_TREE, OEP_ONLY_CONST, operand_equal_for_comparison_p(), operand_equal_p(), protected_set_expr_location_unshare(), wi::shifted_mask(), sign_bit_p(), signed_type_for(), STRIP_NOPS, wi::to_wide(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, tree_fits_uhwi_p(), tree_log2(), TREE_OPERAND, TREE_SIDE_EFFECTS, tree_swap_operands_p(), tree_to_uhwi(), tree_to_vec_perm_builder(), TREE_TYPE, truth_value_p(), type_contains_placeholder_p(), TYPE_PRECISION, TYPE_SIZE, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), unsigned_type_for(), value, VECTOR_CST_ELT, VECTOR_CST_NELTS, VECTOR_TYPE_P, VOID_TYPE_P, wide_int_to_tree(), and wi::zext().

Referenced by fold(), fold_build3_loc(), fold_gimple_assign(), gimple_fold_stmt_to_constant_1(), and maybe_fold_reference().

â—† fold_to_nonsharp_ineq_using_bound()

tree fold_to_nonsharp_ineq_using_bound ( location_t loc,
tree ineq,
tree bound )
static
Fold A < X && A + 1 > Y to A < X && A >= Y. Normally A + 1 > Y means A >= Y && A != MAX, but in this case we know that A < X <= MAX. INEQ is A + 1 > Y, BOUND is A < X.

References a, fold_binary_loc(), fold_build2_loc(), fold_convert_loc(), integer_onep(), INTEGRAL_TYPE_P, NULL_TREE, POINTER_TYPE_P, ssizetype, TREE_CODE, TREE_OPERAND, TREE_TYPE, and y.

Referenced by fold_binary_loc().

â—† fold_truth_andor()

tree fold_truth_andor ( location_t loc,
enum tree_code code,
tree type,
tree arg0,
tree arg1,
tree op0,
tree op1 )
static
Fold a binary bitwise/truth expression of code CODE and type TYPE with operands OP0 and OP1. LOC is the location of the resulting expression. ARG0 and ARG1 are the NOP_STRIPed results of OP0 and OP1. Return the folded expression if folding is successful. Otherwise, return NULL_TREE.

References fold_build2_loc(), fold_range_test(), fold_truth_andor_1(), LOGICAL_OP_NON_SHORT_CIRCUIT, merge_truthop_with_opposite_arm(), NULL_TREE, operand_equal_p(), sanitize_coverage_p(), simple_condition_p(), TREE_CODE, TREE_OPERAND, and TREE_SIDE_EFFECTS.

Referenced by fold_binary_loc().

â—† fold_truth_andor_1()

tree fold_truth_andor_1 ( location_t loc,
enum tree_code code,
tree truth_type,
tree lhs,
tree rhs )
static
Find ways of folding logical expressions of LHS and RHS: Try to merge two comparisons to the same innermost item. Look for range tests like "ch >= '0' && ch <= '9'". Look for combinations of simple terms on machines with expensive branches and evaluate the RHS unconditionally. We check for both normal comparisons and the BIT_AND_EXPRs made this by function and the one above. CODE is the logical operation being done. It can be TRUTH_ANDIF_EXPR, TRUTH_AND_EXPR, TRUTH_ORIF_EXPR, or TRUTH_OR_EXPR. TRUTH_TYPE is the type of the logical operand and LHS and RHS are its two operands. We return the simplified tree or 0 if no optimization is possible.

References build2(), build2_loc(), build_int_cst(), cfun, combine_comparisons(), FLOAT_TYPE_P, integer_onep(), integer_zerop(), INTEGRAL_TYPE_P, operand_equal_p(), optimize_function_for_speed_p(), simple_operand_p(), swap_tree_comparison(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_SIDE_EFFECTS, and TREE_TYPE.

Referenced by fold_truth_andor().

â—† fold_truth_not_expr()

tree fold_truth_not_expr ( location_t loc,
tree arg )
static
Return a simplified tree node for the truth-negation of ARG. This never alters ARG itself. We assume that ARG is an operation that returns a truth value (0 or 1). FIXME: one would think we would fold the result, but it causes problems with the dominator optimizer.

References build1_loc(), build2_loc(), build3_loc(), build_int_cst(), CASE_CONVERT, constant_boolean_node(), copy_warning(), expr_location_or(), FLOAT_TYPE_P, HONOR_NANS(), integer_onep(), integer_zerop(), invert_tree_comparison(), invert_truthvalue_loc(), NULL_TREE, tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, and VOID_TYPE_P.

Referenced by fold_unary_loc().

â—† fold_unary_ignore_overflow_loc()

tree fold_unary_ignore_overflow_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0 )
If the operation was a conversion do _not_ mark a resulting constant with TREE_OVERFLOW if the original constant was not. These conversions have implementation defined behavior and retaining the TREE_OVERFLOW flag here would confuse later passes such as VRP.

References CONVERT_EXPR_CODE_P, fold_unary_loc(), TREE_CODE, and TREE_OVERFLOW.

â—† fold_unary_loc()

tree fold_unary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0 )
Fold a unary expression of code CODE and type TYPE with operand OP0. Return the folded expression if folding is successful. Otherwise, return NULL_TREE.

References BITS_PER_WORD, build1_loc(), build2(), build2_loc(), build3(), build3_loc(), build_aligned_type(), build_fold_addr_expr_loc(), CASE_CONVERT, COMPARISON_CLASS_P, const_unop(), constant_boolean_node(), CONSTANT_CLASS_P, CONVERT_EXPR_CODE_P, CONVERT_EXPR_P, DECL_BIT_FIELD, fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), fold_build_pointer_plus_loc(), fold_convert_loc(), fold_negate_expr(), fold_truth_not_expr(), fold_unary_loc(), force_fit_type(), wide_int_storage::from(), gcc_assert, generic_simplify(), get_inner_reference(), handled_component_p(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_M1U, in_gimple_form, INTEGRAL_TYPE_P, IS_EXPR_CODE_CLASS, known_eq, load_extend_op(), MAX, maybe_lvalue_p(), min_align_of_type(), NULL_TREE, POINTER_TYPE_P, REF_REVERSE_STORAGE_ORDER, SANITIZE_ALIGNMENT, sanitize_flags_p(), SANITIZE_NULL, SANITIZE_SI_OVERFLOW, strip_float_extensions(), STRIP_NOPS, STRIP_SIGN_NOPS, suppress_warning(), tcc_unary, wi::to_wide(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_CONSTANT, tree_fits_uhwi_p(), TREE_OPERAND, TREE_OVERFLOW, TREE_READONLY, tree_to_uhwi(), TREE_TYPE, TREE_USED, TYPE_ALIGN, TYPE_MAIN_VARIANT, TYPE_MODE, TYPE_OVERFLOW_WRAPS, TYPE_PRECISION, TYPE_QUALS, TYPE_SIGN, TYPE_UNQUALIFIED, TYPE_UNSIGNED, unsigned_type_for(), VAR_P, and VOID_TYPE_P.

Referenced by expand_expr_real_1(), fold(), fold_binary_loc(), fold_build1_loc(), fold_invert_truthvalue(), fold_unary_ignore_overflow_loc(), fold_unary_loc(), gimple_fold_stmt_to_constant_1(), and maybe_fold_reference().

â—† fold_unary_to_constant()

tree fold_unary_to_constant ( enum tree_code code,
tree type,
tree op0 )
Given the components of a unary expression CODE, TYPE and OP0, attempt to fold the expression to a constant without modifying TYPE or OP0. If the expression could be simplified to a constant, then return the constant. If the expression would not be simplified to a constant, then return NULL_TREE.

References fold_unary, NULL_TREE, and TREE_CONSTANT.

â—† fold_undefer_and_ignore_overflow_warnings()

void fold_undefer_and_ignore_overflow_warnings ( void )

â—† fold_undefer_overflow_warnings()

void fold_undefer_overflow_warnings ( bool issue,
const gimple * stmt,
int code )
Stop deferring overflow warnings. If there is a pending warning, and ISSUE is true, then issue the warning if appropriate. STMT is the statement with which the warning should be associated (used for location information); STMT may be NULL. CODE is the level of the warning--a warn_strict_overflow_code value. This function will use the smaller of CODE and the deferred code when deciding whether to issue the warning. CODE may be zero to mean to always use the deferred code.

References fold_deferred_overflow_code, fold_deferred_overflow_warning, fold_deferring_overflow_warnings, gcc_assert, gimple_location(), input_location, issue_strict_overflow_warning, NULL, warning_at(), and warning_suppressed_p().

Referenced by cleanup_control_expr_graph(), combine_cond_expr_cond(), evaluate_stmt(), fold_stmt_1(), fold_undefer_and_ignore_overflow_warnings(), and jump_threader::simplify_control_stmt_condition_1().

â—† fold_vec_perm()

tree fold_vec_perm ( tree type,
tree arg0,
tree arg1,
const vec_perm_indices & sel )
Attempt to fold vector permutation of ARG0 and ARG1 vectors using SEL selector. Return the folded VECTOR_CST or CONSTRUCTOR if successful, NULL_TREE otherwise.

References build_constructor(), CONSTRUCTOR_APPEND_ELT, fold_vec_perm_cst(), gcc_assert, i, poly_int< N, C >::is_constant(), known_eq, vec_perm_indices::length(), NULL_TREE, TREE_CODE, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), vec_alloc(), and vec_cst_ctor_to_array().

Referenced by fold_ternary_loc().

â—† fold_vec_perm_cst()

tree fold_vec_perm_cst ( tree type,
tree arg0,
tree arg1,
const vec_perm_indices & sel,
const char ** reason = NULL )
static
Try to fold permutation of ARG0 and ARG1 with SEL selector when the input vectors are VECTOR_CST. Return NULL_TREE otherwise. REASON has same purpose as described in valid_mask_for_fold_vec_perm_cst_p.

References tree_vector_builder::build(), vec_perm_indices::encoding(), i, vector_builder< T, poly_uint64, int_vector_builder< T > >::nelts_per_pattern(), vector_builder< T, poly_uint64, int_vector_builder< T > >::npatterns(), NULL, NULL_TREE, r, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), valid_mask_for_fold_vec_perm_cst_p(), vector_cst_elt(), and VECTOR_CST_NELTS_PER_PATTERN.

Referenced by fold_vec_perm().

â—† fold_view_convert_expr()

tree fold_view_convert_expr ( tree type,
tree expr )
static
Fold a VIEW_CONVERT_EXPR of a constant expression EXPR to type TYPE at compile-time. If we're unable to perform the conversion return NULL_TREE.

References CHAR_BIT, fold_view_convert_vector_encoding(), int_size_in_bytes(), native_encode_expr(), native_interpret_expr(), NULL_TREE, TREE_CODE, VECTOR_TYPE_P, and WIDE_INT_MAX_PRECISION.

Referenced by const_unop().

â—† fold_view_convert_vector_encoding()

tree fold_view_convert_vector_encoding ( tree type,
tree expr )
static
Try to view-convert VECTOR_CST EXPR to VECTOR_TYPE TYPE by operating directly on the VECTOR_CST encoding, in a way that works for variable- length vectors. Return the resulting VECTOR_CST on success or null on failure.

References CEIL, INTEGRAL_TYPE_P, known_gt, least_common_multiple(), native_encode_vector_part(), native_interpret_vector_part(), NULL_TREE, poly_int_tree_p(), TREE_TYPE, TYPE_SIZE, TYPE_VECTOR_SUBPARTS(), VECTOR_CST_NELTS_PER_PATTERN, VECTOR_CST_NPATTERNS, VECTOR_CST_STEPPED_P, and vector_element_size.

Referenced by fold_view_convert_expr().

â—† get_array_ctor_element_at_index()

tree get_array_ctor_element_at_index ( tree ctor,
offset_int access_index,
unsigned * ctor_idx )
Gets the element ACCESS_INDEX from CTOR, which must be a CONSTRUCTOR of an array (or vector). *CTOR_IDX if non-NULL is updated with the constructor element index of the value returned. If the element is not found NULL_TREE is returned and *CTOR_IDX is updated to the index of the element after the ACCESS_INDEX position (which may be outside of the CTOR array).

References wi::cmp(), CONSTRUCTOR_ELTS, wi::ext(), FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, gcc_checking_assert, wi::gt_p(), in_gimple_form, wi::le_p(), NULL_TREE, RAW_DATA_LENGTH, SIGNED, wi::to_offset(), wi::to_wide(), TREE_CODE, tree_int_cst_lt(), TREE_OPERAND, TREE_TYPE, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_PRECISION, TYPE_SIGN, TYPE_UNSIGNED, and UNSIGNED.

Referenced by fold(), and fold_array_ctor_reference().

â—† getbyterep()

const char * getbyterep ( tree src,
unsigned HOST_WIDE_INT * strsize )
Return a pointer to a NUL-terminated string containing the sequence of bytes corresponding to the representation of the object referred to by SRC (or a subsequence of such bytes within it if SRC is a reference to an initialized constant array plus some constant offset). Set *STRSIZE the number of bytes in the constant sequence including the terminating NUL byte. *STRSIZE is equal to sizeof(A) - OFFSET where A is the array that stores the constant sequence that SRC points to and OFFSET is the byte offset of SRC from the beginning of A. SRC need not point to a string or even an array of characters but may point to an object of any type.

References array_size, byte_representation(), NULL, NULL_TREE, string_constant(), tree_fits_uhwi_p(), TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_uhwi(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by c_getstr(), expand_builtin_memcmp(), expand_builtin_memory_copy_args(), fold_const_call(), gimple_fold_builtin_memchr(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_string_compare(), and inline_expand_builtin_bytecmp().

â—† int_binop_types_match_p()

bool int_binop_types_match_p ( enum tree_code code,
const_tree type1,
const_tree type2 )
static
Check whether TYPE1 and TYPE2 are equivalent integer types, suitable for use in int_const_binop, size_binop and size_diffop.

References INTEGRAL_TYPE_P, POINTER_TYPE_P, TYPE_MODE, TYPE_PRECISION, and TYPE_UNSIGNED.

Referenced by size_binop_loc(), and size_diffop_loc().

â—† int_const_binop()

tree int_const_binop ( enum tree_code code,
const_tree arg1,
const_tree arg2,
int overflowable )
Combine two integer constants ARG1 and ARG2 under operation CODE to produce a new constant. Return NULL_TREE if we don't know how to evaluate CODE at compile-time.

References force_fit_type(), NULL_TREE, wi::OVF_NONE, poly_int_binop(), poly_int_tree_p(), SIGNED, TREE_OVERFLOW, TREE_TYPE, and TYPE_SIGN.

Referenced by tree_switch_conversion::switch_conversion::build_constructors(), build_debug_ref_for_model(), build_ref_for_offset(), build_user_friendly_ref_for_offset(), tree_switch_conversion::switch_conversion::collect(), const_binop(), create_component_ref_by_pieces_1(), do_vec_narrow_conversion(), tree_switch_conversion::bit_test_cluster::emit(), tree_switch_conversion::switch_conversion::exp_index_transform(), expand_vector_comparison(), expand_vector_condition(), expand_vector_conversion(), expand_vector_piecewise(), extract_bit_test_mask(), find_case_label_range(), fold_binary_loc(), fold_comparison(), fold_const_call(), fold_const_call(), fold_div_compare(), get_up_bounds_for_array_ref(), inbounds_memaccess_p(), initialize_ao_ref_for_dse(), instrument_bool_enum_load(), inverse(), layout_type(), maybe_canonicalize_comparison_1(), maybe_canonicalize_mem_ref_addr(), maybe_fold_tmr(), maybe_rewrite_mem_ref_base(), ipa_param_adjustments::modify_call(), rt_bb_visited::push_rtcfg_pair(), simplify_using_ranges::simplify(), simplify_using_ranges::simplify_div_or_mod_using_ranges(), simplify_using_ranges::simplify_truth_ops_using_ranges(), size_binop_loc(), tree_fold_divides_p(), type_has_padding_at_level_p(), value_replacement(), vectorizable_live_operation(), vectorizable_live_operation_1(), vectorizable_load(), vectorizable_reduction(), vectorizable_scan_store(), vn_reference_lookup_3(), and rt_bb_visited::vword().

â—† integer_valued_real_binary_p()

bool integer_valued_real_binary_p ( tree_code code,
tree op0,
tree op1,
int depth )
Return true if the floating point result of (CODE OP0 OP1) has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.

References RECURSE.

Referenced by gimple_assign_integer_valued_real_p(), and integer_valued_real_p().

â—† integer_valued_real_call_p()

bool integer_valued_real_call_p ( combined_fn fn,
tree arg0,
tree arg1,
int depth )
Return true if the floating point result of calling FNDECL with arguments ARG0 and ARG1 has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. If FNDECL takes fewer than 2 arguments, the remaining ARGn are null. DEPTH is the current nesting depth of the query.

References RECURSE.

Referenced by gimple_call_integer_valued_real_p(), and integer_valued_real_p().

â—† integer_valued_real_invalid_p()

bool integer_valued_real_invalid_p ( tree t,
int depth )
static
Return true if the floating point expression T (a GIMPLE_INVALID_RHS) has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.

References RECURSE, TREE_CODE, and TREE_OPERAND.

Referenced by integer_valued_real_p().

â—† integer_valued_real_p()

bool integer_valued_real_p ( tree t,
int depth )
Return true if the floating point expression T has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.

References CALL_EXPR_ARG, call_expr_nargs, error_mark_node, get_call_combined_fn(), integer_valued_real_binary_p(), integer_valued_real_call_p(), integer_valued_real_invalid_p(), integer_valued_real_single_p(), integer_valued_real_unary_p(), NULL_TREE, STRIP_ANY_LOCATION_WRAPPER, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_reference, tcc_unary, TREE_CODE, TREE_CODE_CLASS, and TREE_OPERAND.

â—† integer_valued_real_single_p()

bool integer_valued_real_single_p ( tree t,
int depth )
Return true if the floating point expression T (a GIMPLE_SINGLE_RHS) has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.

References gimple_stmt_integer_valued_real_p(), name_registered_for_update_p(), real_isinteger(), RECURSE, SSA_NAME_DEF_STMT, TREE_CODE, TREE_OPERAND, TREE_REAL_CST_PTR, TREE_TYPE, and TYPE_MODE.

Referenced by gimple_assign_integer_valued_real_p(), gimple_phi_integer_valued_real_p(), and integer_valued_real_p().

â—† integer_valued_real_unary_p()

bool integer_valued_real_unary_p ( tree_code code,
tree op0,
int depth )
Return true if the floating point result of (CODE OP0) has an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.

References CASE_CONVERT, RECURSE, SCALAR_FLOAT_TYPE_P, TREE_CODE, and TREE_TYPE.

Referenced by gimple_assign_integer_valued_real_p(), and integer_valued_real_p().

â—† inverse_conditions_p()

bool inverse_conditions_p ( const_tree cond1,
const_tree cond2 )
Return true if COND1 tests the opposite condition of COND2.

References COMPARISON_CLASS_P, HONOR_NANS(), invert_tree_comparison(), operand_equal_p(), TREE_CODE, and TREE_OPERAND.

Referenced by check_redundant_cond_expr().

â—† invert_tree_comparison()

â—† invert_truthvalue_loc()

tree invert_truthvalue_loc ( location_t loc,
tree arg )
Return a simplified tree node for the truth-negation of ARG. This never alters ARG itself. We assume that ARG is an operation that returns a truth value (0 or 1 for scalars, 0 or -1 for vectors).

References fold_build1_loc(), TREE_CODE, TREE_TYPE, and VECTOR_TYPE_P.

Referenced by build_range_check(), fold_binary_loc(), fold_range_test(), fold_ternary_loc(), fold_truth_not_expr(), record_edge_info(), and update_range_test().

â—† make_bit_field_ref()

tree make_bit_field_ref ( location_t loc,
tree inner,
tree orig_inner,
tree type,
HOST_WIDE_INT bitsize,
poly_int64 bitpos,
int unsignedp,
int reversep )
Return a BIT_FIELD_REF of type TYPE to refer to BITSIZE bits of INNER starting at BITPOS. The field is unsigned if UNSIGNEDP is nonzero and uses reverse storage order if REVERSEP is nonzero. ORIG_INNER is the original memory reference used to preserve the alias set of the access.

References bitsize_int, build3_loc(), build_fold_addr_expr, build_int_cst(), build_nonstandard_integer_type(), fold_build2, fold_convert_loc(), get_alias_set(), get_inner_reference(), INTEGRAL_TYPE_P, known_eq, NULL_TREE, POINTER_TYPE_P, ptr_type_node, REF_REVERSE_STORAGE_ORDER, TREE_CODE, tree_fits_shwi_p(), TREE_OPERAND, tree_to_shwi(), TREE_TYPE, TYPE_PRECISION, TYPE_SIZE, and TYPE_UNSIGNED.

Referenced by make_bit_field_load(), and optimize_bit_field_compare().

â—† make_range()

tree make_range ( tree exp,
int * pin_p,
tree * plow,
tree * phigh,
bool * strict_overflow_p )
Given EXP, a logical expression, set the range it is testing into variables denoted by PIN_P, PLOW, and PHIGH. Return the expression actually being tested. *PLOW and *PHIGH will be made of the same type as the returned expression. If EXP is not a comparison, we will most likely not be returning a useful value and range. Set *STRICT_OVERFLOW_P to true if the return value is only valid because signed overflow is undefined; otherwise, do not change *STRICT_OVERFLOW_P.

References build_int_cst(), exp(), EXPR_LOCATION, integer_onep(), integer_type_node, IS_EXPR_CODE_CLASS, make_range_step(), NULL_TREE, range_binop(), tcc_binary, tcc_comparison, tcc_expression, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OPERAND_LENGTH, and TREE_TYPE.

Referenced by fold_range_test().

â—† make_range_step()

tree make_range_step ( location_t loc,
enum tree_code code,
tree arg0,
tree arg1,
tree exp_type,
tree * p_low,
tree * p_high,
int * p_in_p,
bool * strict_overflow_p )

â—† mask_with_tz()

wide_int mask_with_tz ( tree type,
const wide_int & x,
const wide_int & y )
static
Mask out the tz least significant bits of X of type TYPE where tz is the number of trailing zeroes in Y.

References wi::ctz(), wi::mask(), TYPE_PRECISION, and y.

Referenced by fold_binary_loc().

â—† maskable_range_p()

bool maskable_range_p ( const_tree low,
const_tree high,
tree type,
tree * mask,
tree * value )
static
Returns TRUE if [LOW, HIGH] range check can be optimized to a bitwise check i.e. when LOW == 0xXX...X00...0 HIGH == 0xXX...X11...1 Return corresponding mask in MASK and stem in VALUE.

References wi::to_wide(), TREE_CODE, TYPE_PRECISION, value, and wide_int_to_tree().

Referenced by build_range_check().

â—† may_negate_without_overflow_p()

bool may_negate_without_overflow_p ( const_tree t)
Check whether we may negate an integer constant T without causing overflow.

References gcc_assert, wi::only_sign_bit_p(), wi::to_wide(), TREE_CODE, TREE_TYPE, and TYPE_UNSIGNED.

Referenced by create_iv(), and negate_expr_p().

â—† maybe_canonicalize_comparison()

tree maybe_canonicalize_comparison ( location_t loc,
enum tree_code code,
tree type,
tree arg0,
tree arg1 )
static
Canonicalize the comparison ARG0 CODE ARG1 with type TYPE with undefined overflow further. Try to decrease the magnitude of constants involved by changing LE_EXPR and GE_EXPR to LT_EXPR and GT_EXPR or vice versa and put sole constants at the second argument position. Returns the canonicalized tree if changed, otherwise NULL_TREE.

References fold_overflow_warning(), G_, maybe_canonicalize_comparison_1(), swap_tree_comparison(), and WARN_STRICT_OVERFLOW_MAGNITUDE.

Referenced by fold_comparison().

â—† maybe_canonicalize_comparison_1()

tree maybe_canonicalize_comparison_1 ( location_t loc,
enum tree_code code,
tree type,
tree arg0,
tree arg1,
bool * strict_overflow_p )
static
Helper that tries to canonicalize the comparison ARG0 CODE ARG1 by changing CODE to reduce the magnitude of constants involved in ARG0 of the comparison. Returns a canonicalized comparison tree if a simplification was possible, otherwise returns NULL_TREE. Set *STRICT_OVERFLOW_P to true if the canonicalization is only valid if signed overflow is undefined.

References ANY_INTEGRAL_TYPE_P, build_int_cst(), fold_build2_loc(), fold_convert, int_const_binop(), integer_zerop(), INTEGRAL_TYPE_P, NULL_TREE, POINTER_TYPE_P, TREE_CODE, tree_int_cst_equal(), tree_int_cst_sgn(), TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, TYPE_MAX_VALUE, TYPE_MIN_VALUE, and TYPE_OVERFLOW_UNDEFINED.

Referenced by maybe_canonicalize_comparison().

â—† maybe_lvalue_p()

bool maybe_lvalue_p ( const_tree x)
static
Return false if expr can be assumed not to be an lvalue, true otherwise.

References NUM_TREE_CODES, and TREE_CODE.

Referenced by fold_cond_expr_with_comparison(), fold_unary_loc(), and non_lvalue_loc().

â—† maybe_nonzero_address()

int maybe_nonzero_address ( tree decl)
static
Return a positive integer when the symbol DECL is known to have a nonzero address, zero when it's known not to (e.g., it's a weak symbol), and a negative integer when the symbol is not yet in the symbol table and so whether or not its address is zero is unknown. For function local objects always return positive integer.

References auto_var_in_fn_p(), DECL_CONTEXT, decl_in_symtab_p(), DECL_P, folding_cxx_constexpr, folding_initializer, symtab_node::get(), symtab_node::get_create(), and TREE_CODE.

Referenced by fold_comparison(), and tree_single_nonzero_warnv_p().

â—† merge_ranges()

bool merge_ranges ( int * pin_p,
tree * plow,
tree * phigh,
int in0_p,
tree low0,
tree high0,
int in1_p,
tree low1,
tree high1 )

â—† merge_truthop_with_opposite_arm()

tree merge_truthop_with_opposite_arm ( location_t loc,
tree op,
tree cmpop,
bool rhs_only )
static
For an expression that has the form (A && B) || ~B or (A || B) && ~B, we can drop one of the inner expressions and simplify to A || ~B or A && ~B LOC is the location of the resulting expression. OP is the inner logical operation; the left-hand side in the examples above, while CMPOP is the right-hand side. RHS_ONLY is used to prevent us from accidentally removing a condition that guards another, as in (A != NULL && A->...) || A == NULL which we must not transform. If RHS_ONLY is true, only eliminate the right-most operand of the inner logical operation.

References fold_build2_loc(), HONOR_NANS(), invert_tree_comparison(), merge_truthop_with_opposite_arm(), NULL_TREE, operand_equal_p(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_SIDE_EFFECTS, and TREE_TYPE.

Referenced by fold_truth_andor(), and merge_truthop_with_opposite_arm().

â—† minmax_from_comparison()

tree_code minmax_from_comparison ( tree_code cmp,
tree exp0,
tree exp1,
tree exp2,
tree exp3 )
This is a helper function to detect min/max for some operands of COND_EXPR. The form is "(EXP0 CMP EXP1) ? EXP2 : EXP3".

References cfun, get_range_query(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), operand_equal_p(), r, path_range_query::range_of_expr(), wi::to_widest(), TREE_CODE, TREE_TYPE, and TYPE_SIGN.

â—† multiple_of_p()

bool multiple_of_p ( tree type,
const_tree top,
const_tree bottom,
bool nowrap )
Determine if first argument is a multiple of second argument. Return false if it is not, or we cannot easily determined it to be. An example of the sort of thing we care about (at this point; this routine could surely be made more general, and expanded to do what the *_DIV_EXPR's fold cases do now) is discovering that SAVE_EXPR (I) * SAVE_EXPR (J * 8) is a multiple of SAVE_EXPR (J * 8) when we know that the two SAVE_EXPR (J * 8) nodes are the same node. This code also handles discovering that SAVE_EXPR (I) * SAVE_EXPR (J * 8) is a multiple of 8 so we don't have to worry about dealing with a possible remainder. Note that we *look* inside a SAVE_EXPR only to determine how it was calculated; it is not safe for fold to do much of anything else with the internals of a SAVE_EXPR, since it cannot know when it will be evaluated at run time. For example, the latter example above *cannot* be implemented as SAVE_EXPR (I) * J or any variant thereof, since the value of J at evaluation time of the original SAVE_EXPR is not necessarily the same at the time the new expression is evaluated. The only optimization of this sort that would be valid is changing SAVE_EXPR (I) * SAVE_EXPR (SAVE_EXPR (J) * 8) divided by 8 to SAVE_EXPR (I) * SAVE_EXPR (J) (where the same SAVE_EXPR (J) is used in the original and the transformed version). NOWRAP specifies whether all outer operations in TYPE should be considered not wrapping. Any type conversion within TOP acts as a barrier and we will fall back to NOWRAP being false. NOWRAP is mostly used to treat expressions in TYPE_SIZE and friends as not wrapping even though they are generally using unsigned arithmetic.

References CASE_CONVERT, wi::fits_to_tree_p(), fold_build1, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), integer_pow2p(), integer_zerop(), multiple_of_p(), wi::multiple_of_p(), NULL, NULL_TREE, wi::one(), operand_equal_p(), POLY_INT_CST_P, poly_int_tree_p(), wi::sdiv_trunc(), SIGNED, SSA_NAME_DEF_STMT, wi::to_poly_widest(), wi::to_wide(), wi::to_widest(), TREE_CODE, tree_int_cst_sign_bit(), TREE_OPERAND, TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, TYPE_UNSIGNED, and wide_int_to_tree().

Referenced by determine_exit_conditions(), extract_muldiv_1(), fold_binary_loc(), handle_warn_if_not_align(), multiple_of_p(), number_of_iterations_ne(), number_of_iterations_ne_max(), place_field(), round_down_loc(), round_up_loc(), and should_interchange_loops().

â—† native_encode_complex()

int native_encode_complex ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the COMPLEX_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References GET_MODE_SIZE(), MAX, native_encode_expr(), NULL, SCALAR_TYPE_MODE, TREE_IMAGPART, TREE_REALPART, and TREE_TYPE.

Referenced by native_encode_expr().

â—† native_encode_constructor()

int native_encode_constructor ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the CONSTRUCTOR specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References CHAR_BIT, CONSTRUCTOR_NELTS, MIN, NULL, tree_fits_shwi_p(), tree_to_shwi(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by native_encode_expr().

â—† native_encode_expr()

int native_encode_expr ( const_tree expr,
unsigned char * ptr,
int len,
int off )
Subroutine of fold_view_convert_expr. Encode the INTEGER_CST, REAL_CST, FIXED_CST, COMPLEX_CST, STRING_CST, or VECTOR_CST specified by EXPR into the buffer PTR of size LEN bytes. If PTR is NULL, don't actually store anything, just do a dry run. Fail either if OFF is -1 and LEN isn't sufficient to encode the entire EXPR, or if OFF is out of bounds. Otherwise, start at byte offset OFF and encode at most LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References native_encode_complex(), native_encode_constructor(), native_encode_fixed(), native_encode_int(), native_encode_real(), native_encode_string(), native_encode_vector(), SCALAR_FLOAT_TYPE_MODE, TREE_CODE, TREE_REAL_CST_PTR, and TREE_TYPE.

Referenced by clear_padding_type(), const_with_all_bytes_same(), constant_byte_string(), strlen_pass::count_nonzero_bytes(), fold_array_ctor_reference(), fold_ctor_reference(), fold_ternary_loc(), fold_view_convert_expr(), fully_constant_vn_reference_p(), native_encode_complex(), native_encode_initializer(), native_encode_vector_part(), native_interpret_expr(), vn_walk_cb_data::push_partial_def(), vect_check_store_rhs(), and vn_reference_lookup_3().

â—† native_encode_fixed()

int native_encode_fixed ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the FIXED_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References double_int_to_tree(), FIXED_VALUE_TYPE, GET_MODE_BITSIZE(), GET_MODE_SIZE(), HOST_BITS_PER_DOUBLE_INT, native_encode_int(), NULL_TREE, SCALAR_TYPE_MODE, TREE_FIXED_CST, TREE_TYPE, lang_hooks_for_types::type_for_size, TYPE_PRECISION, lang_hooks::types, and value.

Referenced by native_encode_expr().

â—† native_encode_initializer()

int native_encode_initializer ( tree init,
unsigned char * ptr,
int len,
int off,
unsigned char * mask )

â—† native_encode_int()

int native_encode_int ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the INTEGER_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References native_encode_wide_int(), wi::to_widest(), and TREE_TYPE.

Referenced by native_encode_expr(), native_encode_fixed(), and native_encode_initializer().

â—† native_encode_real()

int native_encode_real ( scalar_float_mode mode,
const REAL_VALUE_TYPE * val,
unsigned char * ptr,
int len,
int off )
Subroutine of native_encode_expr. Encode the REAL_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References gcc_assert, GET_MODE_SIZE(), MIN, NULL, real_to_target(), REAL_VALUE_TYPE, and value.

Referenced by native_encode_expr().

â—† native_encode_string()

int native_encode_string ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the STRING_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References CHAR_BIT, MIN, NULL, TREE_CODE, tree_fits_shwi_p(), TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_shwi(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by native_encode_expr().

â—† native_encode_vector()

int native_encode_vector ( const_tree expr,
unsigned char * ptr,
int len,
int off )
static
Subroutine of native_encode_expr. Encode the VECTOR_CST specified by EXPR into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References count, native_encode_vector_part(), and VECTOR_CST_NELTS.

Referenced by native_encode_expr().

â—† native_encode_vector_part()

int native_encode_vector_part ( const_tree expr,
unsigned char * ptr,
int len,
int off,
unsigned HOST_WIDE_INT count )
static
Like native_encode_vector, but only encode the first COUNT elements. The other arguments are as for native_encode_vector.

References CEIL, count, GET_MODE_SIZE(), i, integer_nonzerop(), MIN, native_encode_expr(), NULL, SCALAR_TYPE_MODE, TREE_CODE, TREE_TYPE, TYPE_PRECISION, VECTOR_BOOLEAN_TYPE_P, and VECTOR_CST_ELT.

Referenced by fold_view_convert_vector_encoding(), and native_encode_vector().

â—† native_encode_wide_int()

int native_encode_wide_int ( tree type,
const wide_int_ref & val,
unsigned char * ptr,
int len,
int off )
Subroutine of native_encode_int. Encode the integer VAL with type TYPE into the buffer PTR of length LEN bytes. Return the number of bytes placed in the buffer, or zero upon failure.

References as_a(), bitint_info::big_endian, wi::extract_uhwi(), gcc_assert, gcc_checking_assert, GET_MODE_PRECISION(), GET_MODE_SIZE(), bitint_info::limb_mode, MIN, NULL, SCALAR_INT_TYPE_MODE, targetm, TREE_CODE, tree_to_uhwi(), TYPE_PRECISION, TYPE_SIZE_UNIT, and value.

Referenced by native_encode_int().

â—† native_interpret_aggregate()

â—† native_interpret_complex()

tree native_interpret_complex ( tree type,
const unsigned char * ptr,
int len )
static
Subroutine of native_interpret_expr. Interpret the contents of the buffer PTR of length LEN as a COMPLEX_CST of type TYPE. If the buffer cannot be interpreted, return NULL_TREE.

References build_complex(), GET_MODE_SIZE(), native_interpret_expr(), NULL_TREE, SCALAR_TYPE_MODE, and TREE_TYPE.

Referenced by native_interpret_expr().

â—† native_interpret_expr()

tree native_interpret_expr ( tree type,
const unsigned char * ptr,
int len )
Subroutine of fold_view_convert_expr. Interpret the contents of the buffer PTR of length LEN as a constant of type TYPE. For INTEGRAL_TYPE_P we return an INTEGER_CST, for SCALAR_FLOAT_TYPE_P we return a REAL_CST, etc... If the buffer cannot be interpreted, return NULL_TREE.

References clear_type_padding_in_mask(), GET_MODE_SIZE(), native_encode_expr(), native_interpret_complex(), native_interpret_fixed(), native_interpret_int(), native_interpret_real(), native_interpret_vector(), NULL_TREE, SCALAR_FLOAT_TYPE_MODE, and TREE_CODE.

Referenced by clear_padding_flush(), fold_array_ctor_reference(), fold_ctor_reference(), fold_ternary_loc(), fold_view_convert_expr(), fully_constant_vn_reference_p(), native_interpret_aggregate(), native_interpret_complex(), native_interpret_vector_part(), vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

â—† native_interpret_fixed()

tree native_interpret_fixed ( tree type,
const unsigned char * ptr,
int len )
static
Subroutine of native_interpret_expr. Interpret the contents of the buffer PTR of length LEN as a FIXED_CST of type TYPE. If the buffer cannot be interpreted, return NULL_TREE.

References build_fixed(), fixed_from_double_int(), FIXED_VALUE_TYPE, double_int::from_buffer(), GET_MODE_SIZE(), HOST_BITS_PER_DOUBLE_INT, NULL_TREE, and SCALAR_TYPE_MODE.

Referenced by native_interpret_expr().

â—† native_interpret_int()

tree native_interpret_int ( tree type,
const unsigned char * ptr,
int len )
static
Subroutine of native_interpret_expr. Interpret the contents of the buffer PTR of length LEN as an INTEGER_CST of type TYPE. If the buffer cannot be interpreted, return NULL_TREE.

References as_a(), bitint_info::big_endian, wi::from_buffer(), gcc_assert, gcc_checking_assert, GET_MODE_PRECISION(), GET_MODE_SIZE(), bitint_info::limb_mode, NULL_TREE, SCALAR_INT_TYPE_MODE, targetm, TREE_CODE, tree_to_uhwi(), TYPE_PRECISION, TYPE_SIZE_UNIT, and wide_int_to_tree().

Referenced by native_interpret_expr().

â—† native_interpret_real()

tree native_interpret_real ( tree type,
const unsigned char * ptr,
int len )
Subroutine of native_interpret_expr. Interpret the contents of the buffer PTR of length LEN as a REAL_CST of type TYPE. If the buffer cannot be interpreted, return NULL_TREE.

References build_real(), gcc_assert, GET_MODE_SIZE(), MIN, NULL_TREE, r, real_from_target(), REAL_VALUE_TYPE, SCALAR_FLOAT_TYPE_MODE, and value.

Referenced by clear_padding_type(), and native_interpret_expr().

â—† native_interpret_vector()

tree native_interpret_vector ( tree type,
const unsigned char * ptr,
unsigned int len )
static
Subroutine of native_interpret_expr. Interpret the contents of the buffer PTR of length LEN as a VECTOR_CST of type TYPE. If the buffer cannot be interpreted, return NULL_TREE.

References count, native_interpret_vector_part(), NULL_TREE, poly_int< N, C >::to_constant(), tree_to_poly_uint64(), TYPE_SIZE_UNIT, and TYPE_VECTOR_SUBPARTS().

Referenced by native_interpret_expr().

â—† native_interpret_vector_part()

tree native_interpret_vector_part ( tree type,
const unsigned char * bytes,
unsigned int len,
unsigned int npatterns,
unsigned int nelts_per_pattern )
static
Read a vector of type TYPE from the target memory image given by BYTES, which contains LEN bytes. The vector is known to be encodable using NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each. Return the vector on success, otherwise return null.

References tree_vector_builder::build(), build_all_ones_cst(), build_zero_cst(), vector_builder< T, Shape, Derived >::encoded_nelts(), i, native_interpret_expr(), NULL_TREE, tree_to_uhwi(), TREE_TYPE, TYPE_PRECISION, TYPE_SIZE_UNIT, and VECTOR_BOOLEAN_TYPE_P.

Referenced by fold_view_convert_vector_encoding(), and native_interpret_vector().

â—† negate_expr()

tree negate_expr ( tree t)
static
Like fold_negate_expr, but return a NEGATE_EXPR tree, if T cannot be negated in a simpler way. Also allow for T to be NULL_TREE, in which case return NULL_TREE.

References build1_loc(), EXPR_LOCATION, fold_convert_loc(), fold_negate_expr(), NULL_TREE, STRIP_SIGN_NOPS, and TREE_TYPE.

Referenced by extract_muldiv_1(), fold_binary_loc(), fold_cond_expr_with_comparison(), fold_negate_expr_1(), fold_plusminus_mult_expr(), and make_range_step().

â—† negate_expr_p()

â—† negate_mathfn_p()

bool negate_mathfn_p ( combined_fn fn)
Return true if the built-in mathematical function specified by CODE is odd, i.e. -f(x) == f(-x).

Referenced by fold_negate_expr_1(), and negate_expr_p().

â—† non_lvalue_loc()

tree non_lvalue_loc ( location_t loc,
tree x )
Return an expr equal to X but certainly not valid as an lvalue.

References build1_loc(), in_gimple_form, maybe_lvalue_p(), and TREE_TYPE.

Referenced by fold_binary_loc(), fold_builtin_1(), omit_one_operand_loc(), and omit_two_operands_loc().

â—† omit_one_operand_loc()

tree omit_one_operand_loc ( location_t loc,
tree type,
tree result,
tree omitted )
Return a tree for the case when the result of an expression is RESULT converted to TYPE and OMITTED was previously an operand of the expression but is now not needed (e.g., we folded OMITTED * 0). If OMITTED has side effects, we must evaluate it. Otherwise, just do the conversion of RESULT to TYPE.

References build1_loc(), build2_loc(), fold_convert_loc(), fold_ignored_result(), IS_EMPTY_STMT, non_lvalue_loc(), TREE_SIDE_EFFECTS, and void_type_node.

Referenced by build_range_check(), fold_binary_loc(), fold_builtin_arith_overflow(), fold_builtin_classify(), fold_builtin_memcmp(), fold_builtin_strcspn(), fold_builtin_strpbrk(), and fold_comparison().

â—† omit_two_operands_loc()

tree omit_two_operands_loc ( location_t loc,
tree type,
tree result,
tree omitted1,
tree omitted2 )
Return a tree for the case when the result of an expression is RESULT converted to TYPE and OMITTED1 and OMITTED2 were previously operands of the expression but are now not needed. If OMITTED1 or OMITTED2 has side effects, they must be evaluated. If both OMITTED1 and OMITTED2 have side effects, OMITTED1 is evaluated before OMITTED2. Otherwise, if neither has side effects, just do the conversion of RESULT to TYPE.

References build2_loc(), fold_convert_loc(), non_lvalue_loc(), TREE_CODE, and TREE_SIDE_EFFECTS.

Referenced by fold_binary_loc(), fold_builtin_memcmp(), fold_builtin_strspn(), and fold_builtin_unordered_cmp().

â—† operand_equal_for_comparison_p()

bool operand_equal_for_comparison_p ( tree arg0,
tree arg1 )
static
Similar to operand_equal_p, but see if ARG0 might be a variant of ARG1 with a different signedness or a narrower precision.

References CONVERT_EXPR_P, INTEGRAL_TYPE_P, operand_equal_p(), STRIP_NOPS, TREE_OPERAND, TREE_TYPE, and TYPE_PRECISION.

Referenced by fold_cond_expr_with_comparison(), and fold_ternary_loc().

â—† operand_equal_p()

bool operand_equal_p ( const_tree arg0,
const_tree arg1,
unsigned int flags )
Conveinece wrapper around operand_compare class because usually we do not need to play with the valueizer.

References default_compare_instance.

Referenced by add_candidate_1(), add_type_duplicate(), adjust_offsets_for_equal_base_address(), aff_combination_add_elt(), aff_combination_find_elt(), affine_function_equal_p(), all_phi_incrs_profitable_1(), vect_scalar_ops_slice::all_same_p(), analyze_evolution_in_loop(), loop_cand::analyze_oloop_reduction_var(), analyze_overlapping_iterations(), and_comparisons_1(), arith_overflow_check_p(), bitwise_equal_p(), bitwise_inverted_equal_p(), bound_difference(), build_classic_dist_vector_1(), build_range_check(), bump_vector_ptr(), can_group_stmts_p(), cand_increment(), ccp_lattice_meet(), check_bounds_or_overlap(), check_loadstore(), check_loadstore(), check_redundant_cond_expr(), check_stmt_for_type_change(), chrec_apply(), loop_distribution::classify_builtin_ldst(), loop_cand::classify_simple_reduction(), clear_live_bytes_for_ref(), compare_values_warnv(), compatible_calls_p(), compatible_complex_nodes_p(), compute_access_range(), compute_avail(), cond_if_else_store_replacement(), cond_if_else_store_replacement_1(), convert_atomic_bit_not(), convert_to_divmod(), create_add_ssa_cand(), create_component_ref_by_pieces_1(), create_ifn_alias_checks(), create_intersect_range_checks_index(), create_phi_basis_1(), create_waw_or_war_checks(), degenerate_phi_result(), determine_group_iv_cost_cond(), determine_group_iv_cost_generic(), pcom_worker::determine_offset(), dr_may_alias_p(), dse_classify_store(), dse_optimize_stmt(), dump_alias_pair(), dump_mem_ref(), eliminate_redundant_comparison(), eliminate_dom_walker::eliminate_stmt(), pointer_equiv_analyzer::enter(), eq_evolutions_p(), asan_mem_ref_hasher::equal(), cand_chain_hasher::equal(), default_hash_traits< scalar_cond_masked_key >::equal(), gimplify_hasher::equal(), innermost_loop_behavior_hash::equal(), iv_common_cand_hasher::equal(), iv_inv_expr_hasher::equal(), log_entry_hasher::equal(), mem_ref_hasher::equal(), refs_hasher::equal(), sanopt_tree_couple_hash::equal(), sanopt_tree_triplet_hash::equal(), tm_memop_hasher::equal(), tree_operand_hash::equal(), tree_operand_hash_no_se::equal(), vect_scalar_ops_slice_hash::equal(), equal_mem_array_ref_p(), tree_vector_builder::equal_p(), ipa_call_context::equal_to(), ipa_icf::sem_variable::equals_wpa(), eval_subst(), evaluate_control_stmt_using_entry_checks(), execute_update_addresses_taken(), expand_assignment(), expand_builtin_memory_chk(), expand_complex_addition(), expand_expr_real_2(), expand_omp_atomic_cas(), expand_omp_atomic_fetch_op(), expand_omp_for_static_chunk(), expand_operands(), expr_expected_value_1(), expr_to_aff_combination(), expressions_equal_p(), extr_type_from_vtbl_ptr_store(), find_basis_for_base_expr(), find_matching_predicate_in_rest_chains(), find_or_create_group(), find_range_for_lhs(), find_tail_calls(), vn_walk_cb_data::finish(), finish_bitfield_layout(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_builtin_memcmp(), fold_comparison(), fold_cond_expr_with_comparison(), fold_div_compare(), fold_plusminus_mult_expr(), fold_range_test(), fold_ternary_loc(), fold_truth_andor(), fold_truth_andor_1(), fold_truth_andor_for_ifcombine(), fuse_memset_builtins(), gather_mem_refs_stmt(), get_computation_cost(), get_initial_defs_for_reduction(), get_shiftadd_cost(), gimple_bitwise_equal_p(), gimple_bitwise_inverted_equal_p(), gimple_canonical_types_compatible_p(), gimple_compare_field_offset(), gimple_equal_p(), gimple_expand_builtin_cabs(), gimple_fold_builtin_memory_chk(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_realloc(), gimple_fold_builtin_strcpy(), gimple_fold_builtin_string_compare(), gimple_fold_builtin_stxcpy_chk(), gimple_fold_call(), gimple_fold_stmt_to_constant_1(), gimple_operand_equal_value_p(), strlen_pass::handle_builtin_memset(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_pointer_plus(), hashable_expr_equal_p(), hoist_adjacent_loads(), idx_infer_loop_bounds(), indirect_refs_may_alias_p(), infer_nonnull_range_by_attribute(), predicate::init_from_control_deps(), initialize_data_dependence_relation(), initializer_constant_valid_p_1(), inverse_conditions_p(), is_combined_permutation_identity(), is_divmod_with_given_divisor(), is_strlen_related_p(), loop_exits_before_overflow(), loop_iter_phi_semi_invariant_p(), lower_vec_perm(), make_bit_field_load(), make_forwarders_with_degenerate_phis(), mark_aliased_reaching_defs_necessary_1(), match_arith_overflow(), maybe_diag_stxncpy_trunc(), maybe_optimize_guarding_check(), maybe_optimize_mod_cmp(), maybe_optimize_ubsan_ptr_ifn(), ipa_polymorphic_call_context::meet_with(), mem_attrs_eq_p(), mem_expr_equal_p(), merge_last(), merge_ranges(), merge_truthop_with_opposite_arm(), minmax_from_comparison(), move_hint_to_base(), move_variant_to_index(), multiple_of_p(), narrowing_initializer_constant_valid_p(), ncd_with_phi(), non_rewritable_lvalue_p(), nonoverlapping_array_refs_p(), nonoverlapping_refs_since_match_p(), tree_vector_builder::note_representative(), oacc_entry_exit_ok_1(), odr_types_equivalent_p(), omp_accumulate_sibling_list(), operand_equal_for_comparison_p(), operand_equal_for_phi_arg_p(), operator==(), optimize_agr_copyprop(), optimize_atomic_bit_test_and(), optimize_bitfield_assignment_op(), optimize_memcpy_to_memset(), optimize_pow_to_exp(), optimize_spaceship(), dom_opt_dom_walker::optimize_stmt(), optimize_successive_divisions_p(), or_comparisons_1(), phi_args_equal_on_edges(), phi_convertible_by_degenerating_args(), phi_incr_cost_1(), pred_equal_p(), pred_expr_equal_p(), pred_neg_p(), predicate_rhs_code(), prune_runtime_alias_test_list(), ptr_difference_const(), range_predecessor(), range_successor(), record_biv_for_address_use(), record_group_use(), record_increment(), record_phi_increments_1(), refine_bounds_using_guard(), refine_value_range_using_guard(), remove_unused_ivs(), replace_mult_candidate(), replace_one_candidate(), replace_rhs_if_not_dup(), replace_stmt_with_simplification(), same_access_path_p(), same_bool_comparison_p(), same_bool_result_p(), same_data_refs(), same_data_refs_base_objects(), same_handler_p(), same_phi_args_p(), scan_operand_equal_p(), set_copy_of_val(), set_lattice_value(), set_ssa_val_to(), loop_distribution::share_memory_accesses(), should_interchange_loops(), simplify_1b(), simplify_builtin_call(), simplify_peeled_chrec(), simplify_replace_tree(), simplify_using_initial_conditions(), simplify_vector_constructor(), sink_common_stores_to_bb(), slsr_process_add(), slsr_process_phi(), sm_seq_valid_bb(), spaceship_replacement(), split_at_bb_p(), statement_sink_location(), stmt_is_power_of_op(), stmt_kills_ref_p(), stmt_may_generate_copy(), subset_of(), substitute_in_expr(), suitable_cond_bb(), test_for_singularity(), transform_add_to_multiply(), loop_distribution::transform_reduction_loop(), tree_binary_nonnegative_warnv_p(), twoval_comparison_p(), uniform_vector_p(), pcom_worker::valid_initializer_p(), valid_lattice_transition(), valid_mask_for_fold_vec_perm_cst_p(), values_equal_for_ipcp_p(), vect_add_slp_permutation(), vect_analyze_group_access_1(), vect_build_slp_tree_1(), vect_build_slp_tree_2(), vect_check_gather_scatter(), vect_check_lower_bound(), vect_create_constant_vectors(), vect_dr_aligned_if_peeled_dr_is(), vect_enhance_data_refs_alignment(), vect_find_reusable_accumulator(), vect_get_and_check_slp_defs(), vect_prune_runtime_alias_test_list(), vect_slp_analyze_instance_dependence(), vect_slp_tree_uniform_p(), vect_transform_cycle_phi(), vectorizable_shift(), vectorizable_with_step_bound_p(), verify_type_variant(), copy_prop::visit_phi(), vn_reference_insert(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_pieces(), vrp_operand_equal_p(), and warn_types_mismatch().

â—† optimize_bit_field_compare()

tree optimize_bit_field_compare ( location_t loc,
enum tree_code code,
tree compare_type,
tree lhs,
tree rhs )
static
Optimize a bit-field compare. There are two cases: First is a compare against a constant and the second is a comparison of two items where the fields are at the same bit position relative to the start of a chunk (byte, halfword, word) large enough to contain it. In these cases we can avoid the shift implicit in bitfield extractions. For constants, we emit a compare of the shifted constant with the BIT_AND_EXPR of a mask and a byte, halfword, or word of the operand being compared. For two fields at the same position, we do the ANDs with the similar mask and compare the result of the ANDs. CODE is the comparison code, known to be either NE_EXPR or EQ_EXPR. COMPARE_TYPE is the type of the comparison, and LHS and RHS are the left and right operands of the comparison, respectively. If the optimization described above can be done, we return the resulting tree. Otherwise we return zero.

References wi::arshift(), BITS_PER_WORD, build2(), build2_loc(), build_int_cst(), build_int_cst_type(), const_binop(), constant_boolean_node(), fold_build2_loc(), fold_convert_loc(), get_best_mode(), get_bit_range(), get_inner_reference(), GET_MODE_BITSIZE(), integer_zerop(), poly_int< N, C >::is_constant(), known_eq, wi::lrshift(), make_bit_field_ref(), MIN, NULL_TREE, size_int, wi::to_wide(), TREE_CODE, TREE_TYPE, TYPE_ALIGN, lang_hooks_for_types::type_for_mode, lang_hooks::types, and warning().

Referenced by fold_binary_loc().

â—† pointer_may_wrap_p()

bool pointer_may_wrap_p ( tree base,
tree offset,
poly_int64 bitpos )
static
Return whether BASE + OFFSET + BITPOS may wrap around the address space. This is used to avoid issuing overflow warnings for expressions like &p->x which cannot wrap.

References wi::add(), bits_to_bytes_round_down, known_eq, known_le, NULL_TREE, POINTER_TYPE_P, poly_int_tree_p(), wi::shwi(), wi::to_poly_wide(), poly_int< N, C >::to_uhwi(), TREE_CODE, TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, TYPE_PRECISION, TYPE_SIZE_UNIT, UNSIGNED, and wi::zero().

Referenced by fold_comparison().

â—† poly_int_binop()

bool poly_int_binop ( poly_wide_int & res,
enum tree_code code,
const_tree arg1,
const_tree arg2,
signop sign,
wi::overflow_type * overflow )
Combine two poly int's ARG1 and ARG2 under operation CODE to produce a new constant in RES. Return FALSE if we don't know how to evaluate CODE at compile-time.

References wi::add(), can_min_p(), gcc_assert, wi::mul(), NULL_TREE, NUM_POLY_INT_COEFFS, poly_int_tree_p(), wi::sub(), wi::to_poly_wide(), wi::to_wide(), TREE_CODE, TREE_TYPE, TYPE_PRECISION, and wide_int_binop().

Referenced by int_const_binop().

â—† protected_set_expr_location_unshare()

tree protected_set_expr_location_unshare ( tree x,
location_t loc )
Similar to protected_set_expr_location, but never modify x in place, if location can and needs to be set, unshare it.

References CAN_HAVE_LOCATION_P, copy_node(), EXPR_LOCATION, SET_EXPR_LOCATION, and TREE_CODE.

Referenced by decl_value_expr_insert(), fold_convert_loc(), and fold_ternary_loc().

â—† ptr_difference_const()

bool ptr_difference_const ( tree e1,
tree e2,
poly_int64 * diff )
Returns true if addresses of E1 and E2 differ by a constant, false otherwise. If they do, E1 - E2 is stored in *DIFF.

References cst_and_fits_in_hwi(), fold_build2, fold_convert, int_cst_value(), operand_equal_p(), split_address_to_core_and_offset(), and TREE_TYPE.

â—† range_binop()

tree range_binop ( enum tree_code code,
tree type,
tree arg0,
int upper0_p,
tree arg1,
int upper1_p )
static
The following functions are subroutines to fold_range_test and allow it to try to change a logical combination of comparisons into a range test. For example, both X == 2 || X == 3 || X == 4 || X == 5 and X >= 2 && X <= 5 are converted to (unsigned) (X - 2) <= 3 We describe each set of comparisons as being either inside or outside a range, using a variable named like IN_P, and then describe the range with a lower and upper bound. If one of the bounds is omitted, it represents either the highest or lowest value of the type. In the comments below, we represent a range by two numbers in brackets preceded by a "+" to designate being inside that range, or a "-" to designate being outside that range, so the condition can be inverted by flipping the prefix. An omitted bound is represented by a "-". For example, "- [-, 10]" means being outside the range starting at the lowest possible value and ending at 10, in other words, being greater than 10. The range "+ [-, -]" is always true and hence the range "- [-, -]" is always false. We set up things so that the missing bounds are handled in a consistent manner so neither a missing bound nor "true" and "false" need to be handled using a special case.
Return the result of applying CODE to ARG0 and ARG1, but handle the case of ARG0 and/or ARG1 being omitted, meaning an unlimited range. UPPER0_P and UPPER1_P are nonzero if the respective argument is an upper bound and zero for a lower. TYPE, if nonzero, is the type of the result; it must be specified for a comparison. ARG1 will be converted to ARG0's type if both are specified.

References constant_boolean_node(), fold_build2, fold_convert, gcc_unreachable, STRIP_NOPS, tcc_comparison, TREE_CODE, TREE_CODE_CLASS, and TREE_TYPE.

Referenced by make_range(), make_range_step(), merge_ranges(), range_check_type(), range_predecessor(), and range_successor().

â—† range_check_type()

â—† range_predecessor()

tree range_predecessor ( tree val)
static
Return the predecessor of VAL in its type, handling the infinite case.

References build_int_cst(), INTEGRAL_TYPE_P, NULL_TREE, operand_equal_p(), range_binop(), TREE_TYPE, and TYPE_MIN_VALUE.

Referenced by merge_ranges().

â—† range_successor()

tree range_successor ( tree val)
static
Return the successor of VAL in its type, handling the infinite case.

References build_int_cst(), INTEGRAL_TYPE_P, NULL_TREE, operand_equal_p(), range_binop(), TREE_TYPE, and TYPE_MAX_VALUE.

Referenced by merge_ranges().

â—† round_down_loc()

tree round_down_loc ( location_t loc,
tree value,
int divisor )

â—† round_up_loc()

tree round_up_loc ( location_t loc,
tree value,
unsigned int divisor )
Return the value of VALUE, rounded up to a multiple of DIVISOR.

References build_int_cst(), force_fit_type(), multiple_of_p(), NULL_TREE, pow2_or_zerop(), size_binop_loc(), wi::to_wide(), TREE_CODE, TREE_OVERFLOW, TREE_TYPE, and value.

â—† shift_bytes_in_array_left()

void shift_bytes_in_array_left ( unsigned char * ptr,
unsigned int sz,
unsigned int amnt )
Routines for manipulation of native_encode_expr encoded data if the encoded or extracted constant positions and/or sizes aren't byte aligned.
Shift left the bytes in PTR of SZ elements by AMNT bits, carrying over the bits between adjacent elements. AMNT should be within [0, BITS_PER_UNIT). Example, AMNT = 2: 00011111|11100000 << 2 = 01111111|10000000 PTR[1] | PTR[0] PTR[1] | PTR[0].

References i.

Referenced by vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

â—† shift_bytes_in_array_right()

void shift_bytes_in_array_right ( unsigned char * ptr,
unsigned int sz,
unsigned int amnt )
Like shift_bytes_in_array_left but for big-endian. Shift right the bytes in PTR of SZ elements by AMNT bits, carrying over the bits between adjacent elements. AMNT should be within [0, BITS_PER_UNIT). Example, AMNT = 2: 00011111|11100000 >> 2 = 00000111|11111000 PTR[0] | PTR[1] PTR[0] | PTR[1].

References i.

Referenced by vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

â—† sign_bit_p()

tree sign_bit_p ( tree exp,
const_tree val )
Subroutine for fold: determine if VAL is the INTEGER_CONST that represents the sign bit of EXP's type. If EXP represents a sign or zero extension, also test VAL against the unextended type. The return value is the (sub)expression whose sign bit is VAL, or NULL_TREE otherwise.

References exp(), INTEGRAL_TYPE_P, NULL_TREE, wi::only_sign_bit_p(), sign_bit_p(), wi::to_wide(), TREE_CODE, TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, and TYPE_PRECISION.

Referenced by fold_ternary_loc(), and sign_bit_p().

â—† simple_condition_p()

bool simple_condition_p ( tree exp)
Determine if an operand is simple enough to be evaluated unconditionally. In addition to simple_operand_p, we assume that comparisons, conversions, and logic-not operations are simple, if their operands are simple, too.

References CONVERT_EXPR_P, exp(), generic_expr_could_trap_p(), simple_condition_p(), simple_operand_p(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and TREE_SIDE_EFFECTS.

Referenced by fold_truth_andor(), gimplify_call_expr(), and simple_condition_p().

â—† simple_operand_p()

bool simple_operand_p ( const_tree exp)
static
Subroutine for fold_truth_andor_1 and simple_condition_p: determine if an operand is simple enough to be evaluated unconditionally.

References CONSTANT_CLASS_P, DECL_EXTERNAL, DECL_HAS_VALUE_EXPR_P, DECL_NONLOCAL, DECL_P, DECL_REGISTER, DECL_WEAK, exp(), STRIP_NOPS, TREE_ADDRESSABLE, TREE_CODE, TREE_PUBLIC, TREE_STATIC, TREE_THIS_VOLATILE, VAR_OR_FUNCTION_DECL_P, and VAR_P.

Referenced by fold_range_test(), fold_truth_andor_1(), and simple_condition_p().

â—† simplify_const_binop()

tree simplify_const_binop ( tree_code code,
tree op,
tree other_op,
int index )
static
OP is the INDEXth operand to CODE (counting from zero) and OTHER_OP is the other operand. Try to use the value of OP to simplify the operation in one step, without having to process individual elements.

References integer_zerop(), NULL_TREE, and TREE_CODE.

Referenced by const_binop().

â—† size_binop_loc()

tree size_binop_loc ( location_t loc,
enum tree_code code,
tree arg0,
tree arg1 )

â—† size_diffop_loc()

tree size_diffop_loc ( location_t loc,
tree arg0,
tree arg1 )
Given two values, either both of sizetype or both of bitsizetype, compute the difference between the two values. Return the value in signed type corresponding to the type of the operands.

References bitsizetype, build_int_cst(), fold_convert_loc(), gcc_assert, int_binop_types_match_p(), sbitsizetype, signed_type_for(), size_binop_loc(), sizetype, ssizetype, TREE_CODE, tree_int_cst_equal(), tree_int_cst_lt(), TREE_TYPE, and TYPE_UNSIGNED.

Referenced by expand_expr_real_1(), and fold_read_from_constant_string().

â—† size_int_kind()

tree size_int_kind ( poly_int64 number,
enum size_type_kind kind )
Create a sizetype INT_CST node with NUMBER sign extended. KIND indicates which particular sizetype to create.

References build_int_cst(), and sizetype_tab.

â—† split_address_to_core_and_offset()

tree split_address_to_core_and_offset ( tree exp,
poly_int64 * pbitpos,
tree * poffset )
static
Returns the pointer to the base of the object addressed by EXP and extracts the information about the offset of the access, storing it to PBITPOS and POFFSET.

References build_fold_addr_expr_loc(), dyn_cast(), exp(), EXPR_LOCATION, get_inner_reference(), gimple_assign_rhs1(), gimple_assign_rhs_code(), NULL_TREE, poly_int_tree_p(), wi::sext(), SSA_NAME_DEF_STMT, STRIP_NOPS, wi::to_poly_offset(), poly_int< N, C >::to_shwi(), TREE_CODE, TREE_OPERAND, TREE_TYPE, and TYPE_PRECISION.

Referenced by ptr_difference_const().

â—† split_tree()

tree split_tree ( tree in,
tree type,
enum tree_code code,
tree * minus_varp,
tree * conp,
tree * minus_conp,
tree * litp,
tree * minus_litp,
int negate_p )
static
Split a tree IN into a constant, literal and variable parts that could be combined with CODE to make IN. "constant" means an expression with TREE_CONSTANT but that isn't an actual constant. CODE must be a commutative arithmetic operation. Store the constant part into *CONP, the literal in *LITP and return the variable part. If a part isn't present, set it to null. If the tree does not decompose in this way, return the entire tree as the variable part and the other parts as null. If CODE is PLUS_EXPR we also split trees that use MINUS_EXPR. In that case, we negate an operand that was subtracted. Except if it is a literal for which we use *MINUS_LITP instead. If NEGATE_P is true, we are negating all of IN, again except a literal for which we use *MINUS_LITP instead. If a variable part is of pointer type, it is negated after converting to TYPE. This prevents us from generating illegal MINUS pointer expression. LOC is the location of the converted variable part. If IN is itself a literal or constant, return it as appropriate. Note that we do not guarantee that any of the three values will be the same type as IN, but they will have the same signedness and mode.

References build_minus_one_cst(), drop_tree_overflow(), FLOAT_TYPE_P, SAT_FIXED_POINT_TYPE_P, STRIP_SIGN_NOPS, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_OVERFLOW_P, and TREE_TYPE.

Referenced by fold_binary_loc().

â—† swap_tree_comparison()

â—† tree_binary_nonnegative_warnv_p()

bool tree_binary_nonnegative_warnv_p ( enum tree_code code,
tree type,
tree op0,
tree op1,
bool * strict_overflow_p,
int depth )
Return true if (CODE OP0 OP1) is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References ANY_INTEGRAL_TYPE_P, FLOAT_TYPE_P, MAX, operand_equal_p(), RECURSE, TREE_CODE, tree_expr_maybe_nan_p(), tree_int_cst_min_precision(), tree_int_cst_sgn(), TREE_OPERAND, tree_simple_nonnegative_warnv_p(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, TYPE_UNSIGNED, and UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

â—† tree_binary_nonzero_warnv_p()

bool tree_binary_nonzero_warnv_p ( enum tree_code code,
tree type,
tree op0,
tree op1,
bool * strict_overflow_p )
Return true when (CODE OP0 OP1) is an address and is known to be nonzero. For floating point we further ensure that T is not denormal. Similar logic is present in nonzero_address in rtlanal.h. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P.

References ANY_INTEGRAL_TYPE_P, tree_expr_nonnegative_warnv_p, tree_expr_nonzero_warnv_p(), and TYPE_OVERFLOW_UNDEFINED.

Referenced by tree_expr_nonzero_warnv_p().

â—† tree_call_nonnegative_warnv_p()

bool tree_call_nonnegative_warnv_p ( tree type,
combined_fn fn,
tree arg0,
tree arg1,
bool * strict_overflow_p,
int depth )
Return true if T is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References HONOR_SIGNED_ZEROS(), real_from_integer(), real_identical(), real_to_integer(), REAL_VALUE_TYPE, RECURSE, SIGNED, TREE_CODE, tree_expr_maybe_nan_p(), tree_expr_maybe_signaling_nan_p(), TREE_INT_CST_LOW, TREE_REAL_CST, and tree_simple_nonnegative_warnv_p().

Referenced by gimple_call_nonnegative_warnv_p(), and tree_invalid_nonnegative_warnv_p().

â—† tree_expr_finite_p()

bool tree_expr_finite_p ( const_tree x)
Return true if expression X cannot be (or contain) a NaN or infinity. This function returns true for integer expressions, and returns false if uncertain.

References CALL_EXPR_ARG, element_mode(), get_call_combined_fn(), HONOR_INFINITIES(), HONOR_NANS(), real_isfinite(), TREE_CODE, tree_expr_finite_p(), TREE_IMAGPART, TREE_OPERAND, TREE_REAL_CST_PTR, and TREE_REALPART.

Referenced by fold_builtin_classify(), tree_expr_finite_p(), and tree_expr_maybe_nan_p().

â—† tree_expr_infinite_p()

bool tree_expr_infinite_p ( const_tree x)
Return true if expression X evaluates to an infinity. This function returns false for integer expressions.

References HONOR_INFINITIES(), real_isinf(), TREE_CODE, tree_expr_infinite_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), and tree_expr_infinite_p().

â—† tree_expr_maybe_infinite_p()

bool tree_expr_maybe_infinite_p ( const_tree x)
Return true if expression X could evaluate to an infinity. This function returns false for integer expressions, and returns true if uncertain.

References HONOR_INFINITIES(), real_isinf(), TREE_CODE, tree_expr_maybe_infinite_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), fold_builtin_fpclassify(), and tree_expr_maybe_infinite_p().

â—† tree_expr_maybe_nan_p()

bool tree_expr_maybe_nan_p ( const_tree x)

â—† tree_expr_maybe_real_minus_zero_p()

bool tree_expr_maybe_real_minus_zero_p ( const_tree x)
Return true if expression X could evaluate to -0.0. This function returns true if uncertain.

References get_call_combined_fn(), HONOR_SIGNED_ZEROS(), REAL_VALUE_MINUS_ZERO, TREE_CODE, tree_expr_maybe_real_minus_zero_p(), TREE_OPERAND, and TREE_REAL_CST.

Referenced by fold_real_zero_addition_p(), and tree_expr_maybe_real_minus_zero_p().

â—† tree_expr_maybe_signaling_nan_p()

bool tree_expr_maybe_signaling_nan_p ( const_tree x)
Return true if expression X could evaluate to a signaling NaN. This function returns false for integer expressions, and returns true if uncertain.

References CALL_EXPR_ARG, get_call_combined_fn(), HONOR_SNANS(), real_issignaling_nan(), TREE_CODE, tree_expr_maybe_signaling_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_real_zero_addition_p(), tree_call_nonnegative_warnv_p(), and tree_expr_maybe_signaling_nan_p().

â—† tree_expr_nan_p()

bool tree_expr_nan_p ( const_tree x)
Return true if expression X evaluates to a NaN. This function returns false for integer expressions.

References HONOR_NANS(), real_isnan(), TREE_CODE, tree_expr_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), fold_builtin_unordered_cmp(), and tree_expr_nan_p().

â—† tree_expr_nonnegative_p()

bool tree_expr_nonnegative_p ( tree t)
Return true if `t' is known to be non-negative. Handle warnings about undefined signed overflow.

References fold_overflow_warning(), tree_expr_nonnegative_warnv_p, and WARN_STRICT_OVERFLOW_MISC.

Referenced by derive_constant_upper_bound_ops(), and gimple_expand_builtin_pow().

â—† tree_expr_nonnegative_warnv_p()

bool tree_expr_nonnegative_warnv_p ( tree t,
bool * strict_overflow_p,
int depth )
Return true if T is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References error_mark_node, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_reference, tcc_unary, tree_binary_nonnegative_warnv_p(), TREE_CODE, TREE_CODE_CLASS, tree_invalid_nonnegative_warnv_p(), TREE_OPERAND, tree_single_nonnegative_warnv_p(), TREE_TYPE, and tree_unary_nonnegative_warnv_p().

â—† tree_expr_nonzero_p()

bool tree_expr_nonzero_p ( tree t)
Return true when T is an address and is known to be nonzero. Handle warnings about undefined signed overflow.

References fold_overflow_warning(), tree_expr_nonzero_warnv_p(), and WARN_STRICT_OVERFLOW_MISC.

Referenced by strlen_pass::count_nonzero_bytes(), infer_nonnull_range_by_attribute(), and match_single_bit_test().

â—† tree_expr_nonzero_warnv_p()

bool tree_expr_nonzero_warnv_p ( tree t,
bool * strict_overflow_p )
static
Return true when T is an address and is known to be nonzero. For floating point we further ensure that T is not denormal. Similar logic is present in nonzero_address in rtlanal.h. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P.

References alloca_call_p(), DECL_IS_OPERATOR_NEW_P, get_callee_fndecl(), INTEGRAL_TYPE_P, lookup_attribute(), POINTER_TYPE_P, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_reference, tcc_unary, tree_binary_nonzero_warnv_p(), TREE_CODE, TREE_CODE_CLASS, tree_expr_nonzero_warnv_p(), TREE_NOTHROW, TREE_OPERAND, tree_single_nonzero_warnv_p(), TREE_TYPE, tree_unary_nonzero_warnv_p(), and TYPE_ATTRIBUTES.

Referenced by tree_binary_nonzero_warnv_p(), tree_expr_nonzero_p(), tree_expr_nonzero_warnv_p(), tree_single_nonzero_warnv_p(), and tree_unary_nonzero_warnv_p().

â—† tree_expr_signaling_nan_p()

bool tree_expr_signaling_nan_p ( const_tree x)
Return true if expression X evaluates to a signaling NaN. This function returns false for integer expressions.

References HONOR_SNANS(), real_issignaling_nan(), TREE_CODE, tree_expr_signaling_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by tree_expr_signaling_nan_p().

â—† tree_invalid_nonnegative_warnv_p()

bool tree_invalid_nonnegative_warnv_p ( tree t,
bool * strict_overflow_p,
int depth )
static
Return true if T is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References BIND_EXPR_BODY, CALL_EXPR_ARG, call_expr_nargs, expr_last(), get_call_combined_fn(), NULL_TREE, RECURSE, TARGET_EXPR_INITIAL, TARGET_EXPR_SLOT, tree_call_nonnegative_warnv_p(), TREE_CODE, TREE_OPERAND, tree_simple_nonnegative_warnv_p(), TREE_TYPE, TYPE_UNSIGNED, and VOID_TYPE_P.

Referenced by tree_expr_nonnegative_warnv_p().

â—† tree_nonzero_bits()

â—† tree_simple_nonnegative_warnv_p()

bool tree_simple_nonnegative_warnv_p ( enum tree_code code,
tree type )
static

â—† tree_single_nonnegative_warnv_p()

bool tree_single_nonnegative_warnv_p ( tree t,
bool * strict_overflow_p,
int depth )
Return true if T is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References FIXED_VALUE_NEGATIVE, gimple_stmt_nonnegative_warnv_p(), name_registered_for_update_p(), REAL_VALUE_NEGATIVE, RECURSE, SSA_NAME_DEF_STMT, TREE_CODE, TREE_FIXED_CST, tree_int_cst_sgn(), TREE_OPERAND, TREE_REAL_CST, tree_simple_nonnegative_warnv_p(), TREE_TYPE, and TYPE_UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), gimple_phi_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

â—† tree_single_nonzero_warnv_p()

bool tree_single_nonzero_warnv_p ( tree t,
bool * strict_overflow_p )
Return true when T is an address and is known to be nonzero. For floating point we further ensure that T is not denormal. Similar logic is present in nonzero_address in rtlanal.h. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P.

References CONSTANT_CLASS_P, DECL_P, expr_not_equal_to(), get_base_address(), integer_zerop(), INTEGRAL_TYPE_P, maybe_nonzero_address(), TARGET_EXPR_SLOT, TREE_CODE, tree_expr_nonzero_warnv_p(), TREE_OPERAND, TREE_TYPE, TYPE_PRECISION, and wi::zero().

Referenced by absorbing_element_p(), range_query::get_tree_range(), ipa_compute_jump_functions_for_edge(), fold_using_range::range_of_address(), and tree_expr_nonzero_warnv_p().

â—† tree_swap_operands_p()

â—† tree_unary_nonnegative_warnv_p()

bool tree_unary_nonnegative_warnv_p ( enum tree_code code,
tree type,
tree op0,
bool * strict_overflow_p,
int depth )
Return true if (CODE OP0) is known to be non-negative. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.

References ANY_INTEGRAL_TYPE_P, CASE_CONVERT, INTEGRAL_TYPE_P, RECURSE, SCALAR_FLOAT_TYPE_P, tree_simple_nonnegative_warnv_p(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, and TYPE_UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

â—† tree_unary_nonzero_warnv_p()

bool tree_unary_nonzero_warnv_p ( enum tree_code code,
tree type,
tree op0,
bool * strict_overflow_p )
Return true when (CODE OP0) is an address and is known to be nonzero. For floating point we further ensure that T is not denormal. Similar logic is present in nonzero_address in rtlanal.h. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P.

References tree_expr_nonzero_warnv_p(), TREE_TYPE, and TYPE_PRECISION.

Referenced by tree_expr_nonzero_warnv_p().

â—† twoval_comparison_p()

bool twoval_comparison_p ( tree arg,
tree * cval1,
tree * cval2 )
static
See if ARG is an expression that is either a comparison or is performing arithmetic on comparisons. The comparisons must only be comparing two different values, which will be stored in *CVAL1 and *CVAL2; if they are nonzero it means that some operands have already been found. No variables may be used anywhere else in the expression except in the comparisons. If this is true, return 1. Otherwise, return zero.

References operand_equal_p(), tcc_binary, tcc_comparison, tcc_constant, tcc_expression, tcc_unary, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and twoval_comparison_p().

Referenced by fold_comparison(), and twoval_comparison_p().

â—† valid_mask_for_fold_vec_perm_cst_p()

bool valid_mask_for_fold_vec_perm_cst_p ( tree arg0,
tree arg1,
const vec_perm_indices & sel,
const char ** reason = NULL )
static
Helper routine for fold_vec_perm_cst to check if SEL is a suitable mask for VLA vec_perm folding. REASON if specified, will contain the reason why SEL is not suitable. Used only for debugging and unit-testing.

References const_binop(), vec_perm_indices::encoding(), poly_int< N, C >::is_constant(), vec_perm_indices::length(), vector_builder< T, poly_uint64, int_vector_builder< T > >::nelts_per_pattern(), vector_builder< T, poly_uint64, int_vector_builder< T > >::npatterns(), NULL, operand_equal_p(), pow2p_hwi(), TREE_TYPE, TYPE_VECTOR_SUBPARTS(), vector_cst_elt(), and VECTOR_CST_NPATTERNS.

Referenced by fold_vec_perm_cst().

â—† vec_cst_ctor_to_array()

bool vec_cst_ctor_to_array ( tree arg,
unsigned int nelts,
tree * elts )
static
Helper function for fold_vec_perm. Store elements of VECTOR_CST or CONSTRUCTOR ARG into array ELTS, which has NELTS elements, and return true if successful.

References CONSTRUCTOR_ELTS, fold_convert, FOR_EACH_VEC_SAFE_ELT, i, integer_zero_node, TREE_CODE, TREE_TYPE, constructor_elt::value, VECTOR_CST_ELT, and VECTOR_CST_NELTS.

Referenced by fold_vec_perm().

â—† vector_const_binop()

tree vector_const_binop ( tree_code code,
tree arg1,
tree arg2,
tree(* elt_const_binop )(enum tree_code, tree, tree) )
If ARG1 and ARG2 are constants, and if performing CODE on them would be an elementwise vector operation, try to fold the operation to a constant vector, using ELT_CONST_BINOP to fold each element. Return the folded value on success, otherwise return null.

References tree_vector_builder::build(), count, distributes_over_addition_p(), vector_builder< T, Shape, Derived >::encoded_nelts(), i, known_eq, vector_builder< T, Shape, Derived >::new_binary_operation(), vector_builder< T, Shape, Derived >::new_unary_operation(), NULL_TREE, TREE_CODE, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), VECTOR_CST_ELT, and VECTOR_CST_STEPPED_P.

Referenced by const_binop().

â—† wide_int_binop()

bool wide_int_binop ( wide_int & res,
enum tree_code code,
const wide_int & arg1,
const wide_int & arg2,
signop sign,
wi::overflow_type * overflow )
Combine two wide ints ARG1 and ARG2 under operation CODE to produce a new constant in RES. Return FALSE if we don't know how to evaluate CODE at compile-time.

References wi::add(), wi::bit_and(), wi::bit_or(), wi::bit_xor(), wi::div_ceil(), wi::div_floor(), wi::div_round(), wi::div_trunc(), wi::lrotate(), wi::lshift(), wi::max(), wi::min(), wi::mod_ceil(), wi::mod_floor(), wi::mod_round(), wi::mod_trunc(), wi::mul(), wi::mul_high(), wi::neg_p(), wi::OVF_NONE, wi::rrotate(), wi::rshift(), and wi::sub().

Referenced by poly_int_binop().

Variable Documentation

â—† default_compare_instance

operand_compare default_compare_instance
static

â—† fold_deferred_overflow_code

enum warn_strict_overflow_code fold_deferred_overflow_code
static
If a warning about undefined overflow is deferred, this is the level at which the warning should be emitted.

Referenced by fold_overflow_warning(), and fold_undefer_overflow_warnings().

â—† fold_deferred_overflow_warning

const char* fold_deferred_overflow_warning
static
If a warning about undefined overflow is deferred, this is the warning. Note that this may cause us to turn two warnings into one, but that is fine since it is sufficient to only give one warning per expression.

Referenced by fold_overflow_warning(), and fold_undefer_overflow_warnings().

â—† fold_deferring_overflow_warnings

int fold_deferring_overflow_warnings
static
This is nonzero if we should defer warnings about undefined overflow. This facility exists because these warnings are a special case. The code to estimate loop iterations does not want to issue any warnings, since it works with expressions which do not occur in user code. Various bits of cleanup code call fold(), but only use the result if it has certain characteristics (e.g., is a constant); that code only wants to issue a warning if the result is used.

Referenced by fold_defer_overflow_warnings(), fold_deferring_overflow_warnings_p(), fold_overflow_warning(), and fold_undefer_overflow_warnings().

â—† folding_cxx_constexpr

bool folding_cxx_constexpr = false
Nonzero if we are folding C++ manifestly-constant-evaluated context; zero otherwise. Should be used when certain constructs shouldn't be optimized during folding in that context.

Referenced by address_compare(), and maybe_nonzero_address().

â—† folding_initializer

int folding_initializer = 0
Nonzero if we are folding constants inside an initializer or a C++ manifestly-constant-evaluated context; zero otherwise. Should be used when folding in initializer enables additional optimizations.

Referenced by address_compare(), const_binop(), symtab_node::equal_address_to(), fold_builtin_constant_p(), and maybe_nonzero_address().