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 2, or (at your option) any later
+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
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
static tree fold_builtin_inf (tree, int);
static tree fold_builtin_nan (tree, tree, int);
static tree rewrite_call_expr (tree, int, tree, int, ...);
-static bool validate_arg (tree, enum tree_code code);
+static bool validate_arg (const_tree, enum tree_code code);
static bool integer_valued_real_p (tree);
static tree fold_trunc_transparent_mathfn (tree, tree);
static bool readonly_data_expr (tree);
}
/* Alias set used for setjmp buffer. */
-static HOST_WIDE_INT setjmp_alias_set = -1;
+static alias_set_type setjmp_alias_set = -1;
/* Construct the leading half of a __builtin_setjmp call. Control will
return to RECEIVER_LABEL. This is also called directly by the SJLJ
errno_set = false;
/* Before working hard, check whether the instruction is available. */
- if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing)
{
target = gen_reg_rtx (mode);
mode = TYPE_MODE (TREE_TYPE (exp));
/* Before working hard, check whether the instruction is available. */
- if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing)
return NULL_RTX;
target = gen_reg_rtx (mode);
/* Check if sincos insn is available, otherwise fallback
to sin or cos insn. */
- if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing)
switch (DECL_FUNCTION_CODE (fndecl))
{
CASE_FLT_FN (BUILT_IN_SIN):
}
/* Before working hard, check whether the instruction is available. */
- if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing)
{
target = gen_reg_rtx (mode);
mode = TYPE_MODE (TREE_TYPE (arg));
if (builtin_optab)
- icode = builtin_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (builtin_optab, mode)->insn_code;
/* Before working hard, check whether the instruction is available. */
if (icode != CODE_FOR_nothing)
mode = TYPE_MODE (TREE_TYPE (arg));
/* Check if sincos insn is available, otherwise emit the call. */
- if (sincos_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
+ if (optab_handler (sincos_optab, mode)->insn_code == CODE_FOR_nothing)
return NULL_RTX;
target1 = gen_reg_rtx (mode);
/* Try expanding via a sincos optab, fall back to emitting a libcall
to sincos or cexp. We are sure we have sincos or cexp because cexpi
is only generated from sincos, cexp or if we have either of them. */
- if (sincos_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ if (optab_handler (sincos_optab, mode)->insn_code != CODE_FOR_nothing)
{
op1 = gen_reg_rtx (mode);
op2 = gen_reg_rtx (mode);
if (GET_MODE (op1) != mode2)
op1 = convert_to_mode (mode2, op1, 0);
- target = emit_library_call_value (powi_optab->handlers[(int) mode].libfunc,
+ target = emit_library_call_value (optab_handler (powi_optab, mode)->libfunc,
target, LCT_CONST_MAKE_BLOCK, mode, 2,
op0, mode, op1, mode2);
/* Bail out if we can't compute strlen in the right mode. */
while (insn_mode != VOIDmode)
{
- icode = strlen_optab->handlers[(int) insn_mode].insn_code;
+ icode = optab_handler (strlen_optab, insn_mode)->insn_code;
if (icode != CODE_FOR_nothing)
break;
Otherwise the return value is END_BUILTINS. */
enum built_in_function
-builtin_mathfn_code (tree t)
+builtin_mathfn_code (const_tree t)
{
- tree fndecl, arg, parmlist;
- tree argtype, parmtype;
- call_expr_arg_iterator iter;
+ const_tree fndecl, arg, parmlist;
+ const_tree argtype, parmtype;
+ const_call_expr_arg_iterator iter;
if (TREE_CODE (t) != CALL_EXPR
|| TREE_CODE (CALL_EXPR_FN (t)) != ADDR_EXPR)
return END_BUILTINS;
parmlist = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
- init_call_expr_arg_iterator (t, &iter);
+ init_const_call_expr_arg_iterator (t, &iter);
for (; parmlist; parmlist = TREE_CHAIN (parmlist))
{
/* If a function doesn't take a variable number of arguments,
parmtype = TREE_VALUE (parmlist);
if (VOID_TYPE_P (parmtype))
{
- if (more_call_expr_args_p (&iter))
+ if (more_const_call_expr_args_p (&iter))
return END_BUILTINS;
return DECL_FUNCTION_CODE (fndecl);
}
- if (! more_call_expr_args_p (&iter))
+ if (! more_const_call_expr_args_p (&iter))
return END_BUILTINS;
- arg = next_call_expr_arg (&iter);
+ arg = next_const_call_expr_arg (&iter);
argtype = TREE_TYPE (arg);
if (SCALAR_FLOAT_TYPE_P (parmtype))
a type. */
static bool
-validate_arg (tree arg, enum tree_code code)
+validate_arg (const_tree arg, enum tree_code code)
{
if (!arg)
return false;
VOID_TYPE. */
bool
-validate_arglist (tree callexpr, ...)
+validate_arglist (const_tree callexpr, ...)
{
enum tree_code code;
bool res = 0;
va_list ap;
- call_expr_arg_iterator iter;
- tree arg;
+ const_call_expr_arg_iterator iter;
+ const_tree arg;
va_start (ap, callexpr);
- init_call_expr_arg_iterator (callexpr, &iter);
+ init_const_call_expr_arg_iterator (callexpr, &iter);
do
{
case VOID_TYPE:
/* This signifies an endlink, if no arguments remain, return
true, otherwise return false. */
- res = !more_call_expr_args_p (&iter);
+ res = !more_const_call_expr_args_p (&iter);
goto end;
default:
/* If no parameters remain or the parameter's code does not
match the specified code, return false. Otherwise continue
checking any remaining arguments. */
- arg = next_call_expr_arg (&iter);
+ arg = next_const_call_expr_arg (&iter);
if (!validate_arg (arg, code))
goto end;
break;