GCC Middle and Back End API Reference
fold-const-call.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

tree fold_const_call (combined_fn, tree, tree)
 
tree fold_const_call (combined_fn, tree, tree, tree)
 
tree fold_const_call (combined_fn, tree, tree, tree, tree)
 
tree build_cmp_result (tree type, int res)
 

Function Documentation

◆ build_cmp_result()

tree build_cmp_result ( tree type,
int res )
RES is the result of a comparison in which < 0 means "less", 0 means
"equal" and > 0 means "more".  Canonicalize it to -1, 0 or 1 and
return it in type TYPE.   

References build_int_cst().

Referenced by fold_const_call(), fold_const_call(), and gimple_fold_builtin_string_compare().

◆ fold_const_call() [1/3]

tree fold_const_call ( combined_fn fn,
tree type,
tree arg )
Fold calls to built-in and internal functions with constant arguments.
   Copyright (C) 2015-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Try to fold FN (ARG) to a constant.  Return the constant on success,
otherwise return null.  TYPE is the type of the return value.   

References build_int_cst(), c_getstr(), CASE_FLT_FN_FLOATN_NX, fold_const_builtin_nan(), fold_const_call_1(), fold_const_reduction(), fold_const_vec_convert(), and NULL_TREE.

Referenced by expand_bitquery(), fold_builtin_1(), fold_builtin_2(), fold_builtin_3(), fold_builtin_sincos(), fully_constant_vn_reference_p(), gimple_resimplify1(), gimple_resimplify2(), gimple_resimplify3(), gimple_simplify(), gimple_simplify(), gimple_simplify(), and vect_recog_pow_pattern().

◆ fold_const_call() [2/3]

tree fold_const_call ( combined_fn fn,
tree type,
tree arg0,
tree arg1 )
Try to fold FN (ARG0, ARG1) to a constant.  Return the constant on success,
otherwise return null.  TYPE is the type of the return value.   

References arith_overflowed_p(), build_cmp_result(), build_complex(), build_int_cst(), c_getstr(), drop_tree_overflow(), fold_build_pointer_plus_hwi, fold_const_call_1(), fold_const_fold_left(), fold_convert, int_const_binop(), integer_cst_p(), NULL, NULL_TREE, r, target_char_cst_p(), TREE_CODE, TREE_OVERFLOW, TREE_TYPE, and type().

◆ fold_const_call() [3/3]

tree fold_const_call ( combined_fn fn,
tree type,
tree arg0,
tree arg1,
tree arg2 )