* expr.h: Remove prototypes of functions defined in builtins.c.
* tree.h: (build_call_expr_*, build_string_literal): Add prototypes.
Remove prototypes of functions defined in builtins.c.
* builtins.h: Update prototype list to include all exported functions.
* builtins.c: (default_libc_has_function, gnu_libc_has_function,
no_c99_libc_has_function): Move to targhooks.c
(build_string_literal, build_call_expr_loc_array,
build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move
to tree.c.
(expand_builtin_object_size, fold_builtin_object_size): Make static.
* targhooks.c (default_libc_has_function, gnu_libc_has_function,
no_c99_libc_has_function): Relocate from builtins.c.
* tree.c: Include builtins.h.
(build_call_expr_loc_array, build_call_expr_loc_vec,
build_call_expr_loc, build_call_expr, build_string_literal): Relocate
from builtins.c.
* fold-const.h (fold_fma): Move prototype to builtins.h.
* realmpfr.h (do_mpc_arg2): Move prototype to builtins.h.
* fortran/trans.c (trans_runtime_error_vararg): Call
fold_build_call_array_loc instead of fold_builtin_call_array.
* asan.c: Include builtins.h.
* cfgexpand.c: Likewise.
* convert.c: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* expr.c: Likewise.
* fold-const.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimplify.c: Likewise.
* ipa-inline.c: Likewise.
* ipa-prop.c: Likewise.
* lto-streamer-out.c: Likewise.
* stmt.c: Likewise.
* tree-inline.c: Likewise.
* tree-object-size.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-math-opts.c: Likewise.
* tree-ssa-reassoc.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-streamer-in.c: Likewise.
* tree-vect-data-refs.c: Likewise.
* tree-vect-patterns.c: Likewise.
* tree-vect-stmts.c: Likewise.
c
* c-decl.c: Include builtins.h.
* c-parser.c: Likewise.
cp
* decl.c: Include builtins.h.
* semantics.c: Likewise.
go
* go-gcc.cc: Include builtins.h.
lto
* lto-symtab.c: Include builtins.h.
config
* aarch64/aarch64.c: Include builtins.h.
* alpha/alpha.c: Likewise.
* arc/arc.c: Likewise.
* arm/arm.c: Likewise.
* avr/avr.c: Likewise.
* bfin/bfin.c: Likewise.
* c6x/c6x.c: Likewise.
* cr16/cr16.c: Likewise.
* cris/cris.c: Likewise.
* epiphany/epiphany.c: Likewise.
* fr30/fr30.c: Likewise.
* frv/frv.c: Likewise.
* h8300/h8300.c: Likewise.
* i386/i386.c: Likewise.
* i386/winnt.c: Likewise.
* ia64/ia64.c: Likewise.
* iq2000/iq2000.c: Likewise.
* lm32/lm32.c: Likewise.
* m32c/m32c.c: Likewise.
* m32r/m32r.c: Likewise.
* m68k/m68k.c: Likewise.
* mcore/mcore.c: Likewise.
* mep/mep.c: Likewise.
* microblaze/microblaze.c: Likewise.
* mips/mips.c: Likewise.
* mmix/mmix.c: Likewise.
* mn10300/mn10300.c: Likewise.
* moxie/moxie.c: Likewise.
* msp430/msp430.c: Likewise.
* nds32/nds32.c: Likewise.
* pa/pa.c: Likewise.
* pdp11/pdp11.c: Likewise.
* picochip/picochip.c: Likewise.
* rl78/rl78.c: Likewise.
* rs6000/rs6000.c: Likewise.
* rx/rx.c: Likewise.
* s390/s390.c: Likewise.
* score/score.c: Likewise.
* sh/sh.c: Likewise.
* sparc/sparc.c: Likewise.
* spu/spu.c: Likewise.
* stormy16/stormy16.c: Likewise.
* tilegx/tilegx.c: Likewise.
* tilepro/tilepro.c: Likewise.
* v850/v850.c: Likewise.
* vax/vax.c: Likewise.
* xtensa/xtensa.c: Likewise.
From-SVN: r211145
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * expr.h: Remove prototypes of functions defined in builtins.c.
+ * tree.h: (build_call_expr_*, build_string_literal): Add prototypes.
+ Remove prototypes of functions defined in builtins.c.
+ * builtins.h: Update prototype list to include all exported functions.
+ * builtins.c: (default_libc_has_function, gnu_libc_has_function,
+ no_c99_libc_has_function): Move to targhooks.c
+ (build_string_literal, build_call_expr_loc_array,
+ build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move
+ to tree.c.
+ (expand_builtin_object_size, fold_builtin_object_size): Make static.
+ * targhooks.c (default_libc_has_function, gnu_libc_has_function,
+ no_c99_libc_has_function): Relocate from builtins.c.
+ * tree.c: Include builtins.h.
+ (build_call_expr_loc_array, build_call_expr_loc_vec,
+ build_call_expr_loc, build_call_expr, build_string_literal): Relocate
+ from builtins.c.
+ * fold-const.h (fold_fma): Move prototype to builtins.h.
+ * realmpfr.h (do_mpc_arg2): Move prototype to builtins.h.
+ * asan.c: Include builtins.h.
+ * cfgexpand.c: Likewise.
+ * convert.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * except.c: Likewise.
+ * expr.c: Likewise.
+ * fold-const.c: Likewise.
+ * gimple-fold.c: Likewise.
+ * gimple-ssa-strength-reduction.c: Likewise.
+ * gimplify.c: Likewise.
+ * ipa-inline.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * lto-streamer-out.c: Likewise.
+ * stmt.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-sra.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-forwprop.c: Likewise.
+ * tree-ssa-loop-ivcanon.c: Likewise.
+ * tree-ssa-loop-ivopts.c: Likewise.
+ * tree-ssa-math-opts.c: Likewise.
+ * tree-ssa-reassoc.c: Likewise.
+ * tree-ssa-threadedge.c: Likewise.
+ * tree-streamer-in.c: Likewise.
+ * tree-vect-data-refs.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-vect-stmts.c: Likewise.
+ * config/aarch64/aarch64.c: Likewise.
+ * config/alpha/alpha.c: Likewise.
+ * config/arc/arc.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/avr/avr.c: Likewise.
+ * config/bfin/bfin.c: Likewise.
+ * config/c6x/c6x.c: Likewise.
+ * config/cr16/cr16.c: Likewise.
+ * config/cris/cris.c: Likewise.
+ * config/epiphany/epiphany.c: Likewise.
+ * config/fr30/fr30.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/h8300/h8300.c: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/i386/winnt.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/iq2000/iq2000.c: Likewise.
+ * config/lm32/lm32.c: Likewise.
+ * config/m32c/m32c.c: Likewise.
+ * config/m32r/m32r.c: Likewise.
+ * config/m68k/m68k.c: Likewise.
+ * config/mcore/mcore.c: Likewise.
+ * config/mep/mep.c: Likewise.
+ * config/microblaze/microblaze.c: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/mmix/mmix.c: Likewise.
+ * config/mn10300/mn10300.c: Likewise.
+ * config/moxie/moxie.c: Likewise.
+ * config/msp430/msp430.c: Likewise.
+ * config/nds32/nds32.c: Likewise.
+ * config/pa/pa.c: Likewise.
+ * config/pdp11/pdp11.c: Likewise.
+ * config/picochip/picochip.c: Likewise.
+ * config/rl78/rl78.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/rx/rx.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/score/score.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/tilegx/tilegx.c: Likewise.
+ * config/tilepro/tilepro.c: Likewise.
+ * config/v850/v850.c: Likewise.
+ * config/vax/vax.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+
2014-06-02 Jeff Law <law@redhat.com>
PR rtl-optimization/61094
#include "ubsan.h"
#include "predict.h"
#include "params.h"
+#include "builtins.h"
/* AddressSanitizer finds out-of-bounds and use-after-free bugs
with <2x slowdown on average.
return TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl);
}
-/* By default we assume that c99 functions are present at the runtime,
- but sincos is not. */
-bool
-default_libc_has_function (enum function_class fn_class)
-{
- if (fn_class == function_c94
- || fn_class == function_c99_misc
- || fn_class == function_c99_math_complex)
- return true;
-
- return false;
-}
-
-bool
-gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
-{
- return true;
-}
-
-bool
-no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
-{
- return false;
-}
-
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
its "internal" name, which normally contains the prefix "__builtin". */
return expand_copysign (op0, op1, target);
}
-/* Create a new constant string literal and return a char* pointer to it.
- The STRING_CST value is the LEN characters at STR. */
-tree
-build_string_literal (int len, const char *str)
-{
- tree t, elem, index, type;
-
- t = build_string (len, str);
- elem = build_type_variant (char_type_node, 1, 0);
- index = build_index_type (size_int (len - 1));
- type = build_array_type (elem, index);
- TREE_TYPE (t) = type;
- TREE_CONSTANT (t) = 1;
- TREE_READONLY (t) = 1;
- TREE_STATIC (t) = 1;
-
- type = build_pointer_type (elem);
- t = build1 (ADDR_EXPR, type,
- build4 (ARRAY_REF, elem,
- t, integer_zero_node, NULL_TREE, NULL_TREE));
- return t;
-}
-
/* Expand a call to __builtin___clear_cache. */
static rtx
return NULL_TREE;
}
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called and N arguments are passed in the array
- ARGARRAY. */
-
-tree
-build_call_expr_loc_array (location_t loc, tree fndecl, int n, tree *argarray)
-{
- tree fntype = TREE_TYPE (fndecl);
- tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
-
- return fold_builtin_call_array (loc, TREE_TYPE (fntype), fn, n, argarray);
-}
-
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called and the arguments are passed in the vector
- VEC. */
-
-tree
-build_call_expr_loc_vec (location_t loc, tree fndecl, vec<tree, va_gc> *vec)
-{
- return build_call_expr_loc_array (loc, fndecl, vec_safe_length (vec),
- vec_safe_address (vec));
-}
-
-
-/* Conveniently construct a function call expression. FNDECL names the
- function to be called, N is the number of arguments, and the "..."
- parameters are the argument expressions. */
-
-tree
-build_call_expr_loc (location_t loc, tree fndecl, int n, ...)
-{
- va_list ap;
- tree *argarray = XALLOCAVEC (tree, n);
- int i;
-
- va_start (ap, n);
- for (i = 0; i < n; i++)
- argarray[i] = va_arg (ap, tree);
- va_end (ap);
- return build_call_expr_loc_array (loc, fndecl, n, argarray);
-}
-
-/* Like build_call_expr_loc (UNKNOWN_LOCATION, ...). Duplicated because
- varargs macros aren't supported by all bootstrap compilers. */
-
-tree
-build_call_expr (tree fndecl, int n, ...)
-{
- va_list ap;
- tree *argarray = XALLOCAVEC (tree, n);
- int i;
-
- va_start (ap, n);
- for (i = 0; i < n; i++)
- argarray[i] = va_arg (ap, tree);
- va_end (ap);
- return build_call_expr_loc_array (UNKNOWN_LOCATION, fndecl, n, argarray);
-}
-
/* Construct a CALL_EXPR with type TYPE with FN as the function expression.
N arguments are passed in the array ARGARRAY. */
/* Expand a call EXP to __builtin_object_size. */
-rtx
+static rtx
expand_builtin_object_size (tree exp)
{
tree ost;
/* Fold a call to __builtin_object_size with arguments PTR and OST,
if possible. */
-tree
+static tree
fold_builtin_object_size (tree ptr, tree ost)
{
unsigned HOST_WIDE_INT bytes;
#ifndef GCC_BUILTINS_H
#define GCC_BUILTINS_H
+#include <mpc.h>
+
/* Target-dependent globals. */
struct target_builtins {
/* For each register that may be used for calling a function, this
#define this_target_builtins (&default_target_builtins)
#endif
+/* Non-zero if __builtin_constant_p should be folded right away. */
+extern bool force_folding_builtin_constant_p;
+
+extern bool is_builtin_fn (tree);
+extern bool get_object_alignment_1 (tree, unsigned int *,
+ unsigned HOST_WIDE_INT *);
+extern unsigned int get_object_alignment (tree);
+extern bool get_pointer_alignment_1 (tree, unsigned int *,
+ unsigned HOST_WIDE_INT *);
+extern unsigned int get_pointer_alignment (tree);
+extern tree c_strlen (tree, int);
+extern void expand_builtin_setjmp_setup (rtx, rtx);
+extern void expand_builtin_setjmp_receiver (rtx);
+extern tree mathfn_built_in (tree, enum built_in_function fn);
+extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
+extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
+extern rtx expand_builtin_saveregs (void);
+extern tree std_build_builtin_va_list (void);
+extern tree std_fn_abi_va_list (tree);
+extern tree std_canonical_va_list_type (tree);
+extern void std_expand_builtin_va_start (tree, rtx);
+extern void expand_builtin_trap (void);
+extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+extern enum built_in_function builtin_mathfn_code (const_tree);
+extern tree fold_builtin_expect (location_t, tree, tree, tree);
+extern tree fold_builtin_strcpy (location_t, tree, tree, tree, tree);
+extern tree fold_builtin_strncpy (location_t, tree, tree, tree, tree, tree);
+extern tree fold_fma (location_t, tree, tree, tree, tree);
+extern bool avoid_folding_inline_builtin (tree);
+extern tree fold_call_expr (location_t, tree, bool);
+extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
extern bool validate_gimple_arglist (const_gimple, ...);
+extern rtx default_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+extern tree fold_builtin_strcat (location_t, tree, tree, tree);
+extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree);
+extern bool fold_builtin_next_arg (tree, bool);
+extern tree fold_builtin_memory_chk (location_t, tree, tree, tree, tree, tree,
+ tree, bool, enum built_in_function);
+extern tree fold_builtin_stxcpy_chk (location_t, tree, tree, tree, tree, tree,
+ bool, enum built_in_function);
+extern tree fold_builtin_stxncpy_chk (location_t, tree, tree, tree, tree, tree,
+ bool, enum built_in_function);
+extern tree gimple_fold_builtin_snprintf_chk (gimple, tree,
+ enum built_in_function);
+extern tree do_mpc_arg2 (tree, tree, tree, int, int (*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t));
+extern tree fold_call_stmt (gimple, bool);
+extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
+extern bool is_simple_builtin (tree);
+extern bool is_inexpensive_builtin (tree);
#endif
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * c-decl.c: Include builtins.h.
+ * c-parser.c: Likewise.
+
2014-05-27 Marek Polacek <polacek@redhat.com>
PR c/56724
#include "plugin.h"
#include "c-family/c-ada-spec.h"
#include "cilk.h"
+#include "builtins.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
#include "cgraph.h"
#include "plugin.h"
#include "omp-low.h"
+#include "builtins.h"
\f
/* Initialization routine for this file. */
#include "tree-ssa-address.h"
#include "recog.h"
#include "output.h"
+#include "builtins.h"
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
#include "tree-vectorizer.h"
#include "config/arm/aarch-cost-tables.h"
#include "dumpfile.h"
+#include "builtins.h"
/* Defined for convenience. */
#define POINTER_BYTES (POINTER_SIZE / BITS_PER_UNIT)
#include "libfuncs.h"
#include "opts.h"
#include "params.h"
+#include "builtins.h"
/* Specify which cpu to schedule for. */
enum processor_type alpha_tune;
#include "context.h"
#include "pass_manager.h"
#include "wide-int.h"
+#include "builtins.h"
/* Which cpu we're compiling for (A5, ARC600, ARC601, ARC700). */
static const char *arc_cpu_string = "";
#include "opts.h"
#include "dumpfile.h"
#include "gimple-expr.h"
+#include "builtins.h"
/* Forward definitions of types. */
typedef struct minipool_node Mnode;
#include "target-def.h"
#include "params.h"
#include "df.h"
+#include "builtins.h"
/* Maximal allowed offset for an address in the LD command */
#define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
#include "hw-doloop.h"
#include "opts.h"
#include "dumpfile.h"
+#include "builtins.h"
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
#include "regrename.h"
#include "dumpfile.h"
#include "gimple-expr.h"
+#include "builtins.h"
/* Table of supported architecture variants. */
typedef struct
#include "target.h"
#include "target-def.h"
#include "df.h"
+#include "builtins.h"
/* Definitions. */
#include "df.h"
#include "opts.h"
#include "cgraph.h"
+#include "builtins.h"
/* Usable when we have an amount to add or subtract, and want the
optimal size of the insn. */
#include "tree-pass.h" /* for current_pass */
#include "context.h"
#include "pass_manager.h"
+#include "builtins.h"
/* Which cpu we're compiling for. */
int epiphany_cpu_type;
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
+#include "builtins.h"
/*}}}*/
/*{{{ Function Prologues & Epilogues */
#include "langhooks.h"
#include "df.h"
#include "dumpfile.h"
+#include "builtins.h"
#ifndef FRV_INLINE
#define FRV_INLINE inline
#include "target.h"
#include "target-def.h"
#include "df.h"
+#include "builtins.h"
/* Classifies a h8300_src_operand or h8300_dst_operand.
#include "target-globals.h"
#include "tree-vectorizer.h"
#include "shrink-wrap.h"
+#include "builtins.h"
static rtx legitimize_dllimport_symbol (rtx, bool);
static rtx legitimize_pe_coff_extern_decl (rtx, bool);
#include "gimple.h"
#include "lto-streamer.h"
#include "lto-section-names.h"
+#include "builtins.h"
/* i386/PE specific attribute support.
#include "reload.h"
#include "opts.h"
#include "dumpfile.h"
+#include "builtins.h"
/* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */
#include "target-def.h"
#include "langhooks.h"
#include "df.h"
+#include "builtins.h"
/* Enumeration for all of the relational tests, so that we can build
arrays indexed by the test type, and not worry about the order
#include "langhooks.h"
#include "tm-constrs.h"
#include "df.h"
+#include "builtins.h"
struct lm32_frame_info
{
#include "gimple.h"
#include "df.h"
#include "tm-constrs.h"
+#include "builtins.h"
/* Prototypes */
#include "target-def.h"
#include "tm-constrs.h"
#include "opts.h"
+#include "builtins.h"
/* Array of valid operand punctuation characters. */
static char m32r_punct_chars[256];
#include "ggc.h"
#include "opts.h"
#include "optabs.h"
+#include "builtins.h"
enum reg_class regno_reg_class[] =
{
#include "target.h"
#include "target-def.h"
#include "df.h"
+#include "builtins.h"
/* For dumping information about frame sizes. */
char * mcore_current_function_name = 0;
#include "gimplify.h"
#include "opts.h"
#include "dumpfile.h"
+#include "builtins.h"
/* Structure of this file:
#include "optabs.h"
#include "diagnostic-core.h"
#include "cgraph.h"
+#include "builtins.h"
#define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
#include "tree-pass.h"
#include "context.h"
#include "cgraph.h"
+#include "builtins.h"
/* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */
#define UNSPEC_ADDRESS_P(X) \
#include "target-def.h"
#include "df.h"
#include "tm-constrs.h"
+#include "builtins.h"
/* First some local helper definitions. */
#define MMIX_FIRST_GLOBAL_REGNUM 32
#include "opts.h"
#include "cfgloop.h"
#include "dumpfile.h"
+#include "builtins.h"
/* This is used in the am33_2.0-linux-gnu port, in which global symbol
names are not prefixed by underscores, to tell whether to prefix a
#include "tm_p.h"
#include "langhooks.h"
#include "df.h"
+#include "builtins.h"
#define LOSE_AND_RETURN(msgid, x) \
do \
#include "msp430-protos.h"
#include "dumpfile.h"
#include "opts.h"
+#include "builtins.h"
\f
static void msp430_compute_frame_info (void);
#include "target-def.h"
#include "langhooks.h" /* For add_builtin_function(). */
#include "ggc.h"
+#include "builtins.h"
/* ------------------------------------------------------------------------ */
#include "langhooks.h"
#include "df.h"
#include "opts.h"
+#include "builtins.h"
/* Return nonzero if there is a bypass for the output of
OUT_INSN and the fp store IN_INSN. */
#include "df.h"
#include "opts.h"
#include "dbxout.h"
+#include "builtins.h"
/* this is the current value returned by the macro FIRST_PARM_OFFSET
defined in tm.h */
#include "libfuncs.h" /* For memcpy_libfuncs, etc. */
#include "df.h" /* For df_regs_ever_live_df_regs_ever_live_pp, etc. */
#include "dbxout.h"
+#include "builtins.h"
\f
/* Target AE ISA information. */
#include "context.h"
#include "tm-constrs.h" /* for satisfies_constraint_*(). */
#include "insn-flags.h" /* for gen_*(). */
+#include "builtins.h"
\f
static inline bool is_interrupt_func (const_tree decl);
static inline bool is_brk_interrupt_func (const_tree decl);
#include "dumpfile.h"
#include "cgraph.h"
#include "target-globals.h"
+#include "builtins.h"
#if TARGET_XCOFF
#include "xcoffout.h" /* get declarations of xcoff_*_section_name */
#endif
#include "langhooks.h"
#include "opts.h"
#include "cgraph.h"
+#include "builtins.h"
static unsigned int rx_gp_base_regnum_val = INVALID_REGNUM;
static unsigned int rx_pid_base_regnum_val = INVALID_REGNUM;
#include "opts.h"
#include "tree-pass.h"
#include "context.h"
+#include "builtins.h"
/* Define the specific costs for a given cpu. */
#include "langhooks.h"
#include "df.h"
#include "opts.h"
+#include "builtins.h"
#define SCORE_SDATA_MAX score_sdata_max
#define SCORE_STACK_ALIGN(LOC) (((LOC) + 3) & ~3)
#include "tree-pass.h"
#include "pass_manager.h"
#include "context.h"
+#include "builtins.h"
int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
#include "tree-pass.h"
#include "context.h"
#include "wide-int.h"
+#include "builtins.h"
/* Processor costs */
#include "df.h"
#include "dumpfile.h"
#include "cfgloop.h"
+#include "builtins.h"
/* Builtin types, data and prototypes. */
#include "gimplify.h"
#include "df.h"
#include "reload.h"
+#include "builtins.h"
static rtx emit_addhi3_postreload (rtx, rtx, rtx);
static void xstormy16_asm_out_constructor (rtx, int);
#include "tilegx-builtins.h"
#include "tilegx-multiply.h"
#include "diagnostic.h"
+#include "builtins.h"
/* SYMBOL_REF for GOT */
static GTY(()) rtx g_got_symbol = NULL;
#include "tilepro-builtins.h"
#include "tilepro-multiply.h"
#include "diagnostic.h"
+#include "builtins.h"
/* SYMBOL_REF for GOT */
static GTY(()) rtx g_got_symbol = NULL;
#include "target-def.h"
#include "df.h"
#include "opts.h"
+#include "builtins.h"
#ifndef streq
#define streq(a,b) (strcmp (a, b) == 0)
#include "target.h"
#include "target-def.h"
#include "wide-int.h"
+#include "builtins.h"
static void vax_option_override (void);
static bool vax_legitimate_address_p (enum machine_mode, rtx, bool);
#include "gimple.h"
#include "gimplify.h"
#include "df.h"
+#include "builtins.h"
/* Enumeration for all of the relational tests, so that we can build
#include "diagnostic-core.h"
#include "target.h"
#include "langhooks.h"
+#include "builtins.h"
#include "ubsan.h"
/* Convert EXPR to some pointer or reference type TYPE.
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * decl.c: Include builtins.h.
+ * semantics.c: Likewise.
+
2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
DR 1227
#include "cgraph.h"
#include "cilk.h"
#include "wide-int.h"
+#include "builtins.h"
/* Possible cases of bad specifiers type used by bad_specifiers. */
enum bad_spec_place {
#include "gimplify.h"
#include "bitmap.h"
#include "omp-low.h"
+#include "builtins.h"
static bool verify_constant (tree, bool, bool *, bool *);
#define VERIFY_CONSTANT(X) \
#include "df.h"
#include "params.h"
#include "target.h"
+#include "builtins.h"
struct target_rtl default_target_rtl;
#if SWITCHABLE_TARGET
#include "tree-pass.h"
#include "pointer-set.h"
#include "cfgloop.h"
+#include "builtins.h"
/* Provide defaults for stuff that may not be defined when using
sjlj exceptions. */
#include "params.h"
#include "tree-ssa-address.h"
#include "cfgexpand.h"
+#include "builtins.h"
#ifndef STACK_PUSH_CODE
#ifdef STACK_GROWS_DOWNWARD
int, unsigned HOST_WIDE_INT *,
int *, int *);
\f
-/* Functions from builtins.c: */
-extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);
-extern tree std_build_builtin_va_list (void);
-extern tree std_fn_abi_va_list (tree);
-extern tree std_canonical_va_list_type (tree);
-
-extern void std_expand_builtin_va_start (tree, rtx);
-extern rtx default_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
-extern void expand_builtin_setjmp_setup (rtx, rtx);
-extern void expand_builtin_setjmp_receiver (rtx);
-extern rtx expand_builtin_saveregs (void);
-extern void expand_builtin_trap (void);
-extern rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
-\f
/* Functions from expr.c: */
/* This is run during target initialization to set up which modes can be
#include "gimplify.h"
#include "tree-dfa.h"
#include "hash-table.h" /* Required for ENABLE_FOLD_CHECKING. */
+#include "builtins.h"
/* Nonzero if we are folding constants inside an initializer; zero
otherwise. */
extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
extern void fold_undefer_and_ignore_overflow_warnings (void);
extern bool fold_deferring_overflow_warnings_p (void);
-extern tree fold_fma (location_t, tree, tree, tree, tree);
extern int operand_equal_p (const_tree, const_tree, unsigned int);
extern int multiple_of_p (tree, const_tree, const_tree);
#define omit_one_operand(T1,T2,T3)\
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * fortran/trans.c (trans_runtime_error_vararg): Call
+ fold_build_call_array_loc instead of fold_builtin_call_array.
+
2014-06-02 Bernd Schmidt <bernds@codesourcery.com>
* trans-decl.c (gfc_build_builtin_function_decls): Correct number of
fntype = TREE_TYPE (gfor_fndecl_runtime_warning_at);
loc = where ? where->lb->location : input_location;
- tmp = fold_builtin_call_array (loc, TREE_TYPE (fntype),
- fold_build1_loc (loc, ADDR_EXPR,
+ tmp = fold_build_call_array_loc (loc, TREE_TYPE (fntype),
+ fold_build1_loc (loc, ADDR_EXPR,
build_pointer_type (fntype),
error
? gfor_fndecl_runtime_error_at
: gfor_fndecl_runtime_warning_at),
- nargs + 2, argarray);
+ nargs + 2, argarray);
gfc_add_expr_to_block (&block, tmp);
return gfc_finish_block (&block);
#include "langhooks.h"
#include "gimplify-me.h"
#include "dbgcnt.h"
+#include "builtins.h"
/* Return true when DECL can be referenced from current unit.
FROM_DECL (if non-null) specify constructor of variable DECL was taken from.
#include "tree-ssa-address.h"
#include "tree-affine.h"
#include "wide-int-print.h"
+#include "builtins.h"
\f
/* Information about a strength reduction candidate. Each statement
in the candidate table represents an expression of one of the
#include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
#include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
+#include "builtins.h"
enum gimplify_omp_var_data
{
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * go-gcc.cc: Include builtins.h.
+
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* go-lang.c (struct GTY): Don't use variable_size gty attribute.
#include "output.h"
#include "real.h"
#include "realmpfr.h"
+#include "builtins.h"
#include "go-c.h"
#include "ipa-utils.h"
#include "sreal.h"
#include "cilk.h"
+#include "builtins.h"
/* Statistics we collect about inlining algorithm. */
static int overall_size;
#include "tree-ssanames.h"
#include "dbgcnt.h"
#include "domwalk.h"
+#include "builtins.h"
/* Intermediate information that we get from alias analysis about a particular
parameter in a particular basic_block. When a parameter or the memory it
#include "tree-streamer.h"
#include "streamer-hooks.h"
#include "cfgloop.h"
+#include "builtins.h"
static void lto_write_tree (struct output_block*, tree, bool);
+2014-06-02 Andrew MacLeod <amacleod@redhat.com>
+
+ * lto-symtab.c: Include builtins.h.
+
2014-05-26 Richard Biener <rguenther@suse.de>
* lto.c (lto_parse_hex): Use int64_t.
#include "lto-streamer.h"
#include "ipa-utils.h"
#include "ipa-inline.h"
+#include "builtins.h"
/* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
all edges and removing the old node. */
#include <mpc.h>
#include "real.h"
-/* In builtins.c. */
-extern tree do_mpc_arg2 (tree, tree, tree, int, int (*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t));
-
/* Convert between MPFR and REAL_VALUE_TYPE. The caller is
responsible for initializing and clearing the MPFR parameter. */
#include "pretty-print.h"
#include "params.h"
#include "dumpfile.h"
+#include "builtins.h"
\f
/* Functions and data structures for expanding case statements. */
#endif
}
+/* By default we assume that c99 functions are present at the runtime,
+ but sincos is not. */
+bool
+default_libc_has_function (enum function_class fn_class)
+{
+ if (fn_class == function_c94
+ || fn_class == function_c99_misc
+ || fn_class == function_c99_math_complex)
+ return true;
+
+ return false;
+}
+
+bool
+gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
+{
+ return true;
+}
+
+bool
+no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
tree
default_builtin_tm_load_store (tree ARG_UNUSED (type))
{
#include "tree-pass.h"
#include "target.h"
#include "cfgloop.h"
+#include "builtins.h"
#include "rtl.h" /* FIXME: For asm_str_count. */
#include "tree-ssa-propagate.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
+#include "builtins.h"
struct object_size_info
{
#include "gimple-pretty-print.h"
#include "ipa-inline.h"
#include "ipa-utils.h"
+#include "builtins.h"
/* Enumeration of all aggregate reductions we can do. */
enum sra_mode { SRA_MODE_EARLY_IPA, /* early call regularization */
#include "dbgcnt.h"
#include "params.h"
#include "wide-int-print.h"
+#include "builtins.h"
/* Possible lattice values. */
#include "optabs.h"
#include "tree-ssa-propagate.h"
#include "tree-ssa-dom.h"
+#include "builtins.h"
/* This pass propagates the RHS of assignment statements into use
sites of the LHS of the assignment. It's basically a specialized
#include "tree-inline.h"
#include "target.h"
#include "tree-cfgcleanup.h"
+#include "builtins.h"
/* Specifies types of loops that may be unrolled. */
#include "tree-ssa-propagate.h"
#include "expmed.h"
#include "tree-ssa-address.h"
+#include "builtins.h"
/* FIXME: Expressions are expanded to RTL in this pass to determine the
cost of different addressing modes. This should be moved to a TBD
#include "alloc-pool.h"
#include "target.h"
#include "gimple-pretty-print.h"
+#include "builtins.h"
/* FIXME: RTL headers have to be included here for optabs. */
#include "rtl.h" /* Because optabs.h wants enum rtx_code. */
#include "target.h"
#include "params.h"
#include "diagnostic-core.h"
+#include "builtins.h"
/* This is a simple global reassociation pass. It is, in part, based
on the LLVM pass of the same name (They do some things more/less
#include "langhooks.h"
#include "params.h"
#include "tree-ssa-threadedge.h"
+#include "builtins.h"
/* To avoid code explosion due to jump threading, we limit the
number of statements we are going to copy. This variable
#include "data-streamer.h"
#include "streamer-hooks.h"
#include "lto-streamer.h"
+#include "builtins.h"
/* Read a STRING_CST from the string table in DATA_IN using input
block IB. */
/* Need to include rtl.h, expr.h, etc. for optabs. */
#include "expr.h"
#include "optabs.h"
+#include "builtins.h"
/* Return true if load- or store-lanes optab OPTAB is implemented for
COUNT vectors of type VECTYPE. NAME is the name of OPTAB. */
#include "recog.h" /* FIXME: for insn_data */
#include "diagnostic-core.h"
#include "dumpfile.h"
+#include "builtins.h"
/* Pattern recognition functions */
static gimple vect_recog_widen_sum_pattern (vec<gimple> *, tree *,
#include "tree-vectorizer.h"
#include "dumpfile.h"
#include "cgraph.h"
+#include "builtins.h"
/* For lang_hooks.types.type_for_mode. */
#include "langhooks.h"
#include "debug.h"
#include "intl.h"
#include "wide-int.h"
+#include "builtins.h"
/* Tree code classes. */
return ret;
}
+/* Conveniently construct a function call expression. FNDECL names the
+ function to be called and N arguments are passed in the array
+ ARGARRAY. */
+
+tree
+build_call_expr_loc_array (location_t loc, tree fndecl, int n, tree *argarray)
+{
+ tree fntype = TREE_TYPE (fndecl);
+ tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
+
+ return fold_builtin_call_array (loc, TREE_TYPE (fntype), fn, n, argarray);
+}
+
+/* Conveniently construct a function call expression. FNDECL names the
+ function to be called and the arguments are passed in the vector
+ VEC. */
+
+tree
+build_call_expr_loc_vec (location_t loc, tree fndecl, vec<tree, va_gc> *vec)
+{
+ return build_call_expr_loc_array (loc, fndecl, vec_safe_length (vec),
+ vec_safe_address (vec));
+}
+
+
+/* Conveniently construct a function call expression. FNDECL names the
+ function to be called, N is the number of arguments, and the "..."
+ parameters are the argument expressions. */
+
+tree
+build_call_expr_loc (location_t loc, tree fndecl, int n, ...)
+{
+ va_list ap;
+ tree *argarray = XALLOCAVEC (tree, n);
+ int i;
+
+ va_start (ap, n);
+ for (i = 0; i < n; i++)
+ argarray[i] = va_arg (ap, tree);
+ va_end (ap);
+ return build_call_expr_loc_array (loc, fndecl, n, argarray);
+}
+
+/* Like build_call_expr_loc (UNKNOWN_LOCATION, ...). Duplicated because
+ varargs macros aren't supported by all bootstrap compilers. */
+
+tree
+build_call_expr (tree fndecl, int n, ...)
+{
+ va_list ap;
+ tree *argarray = XALLOCAVEC (tree, n);
+ int i;
+
+ va_start (ap, n);
+ for (i = 0; i < n; i++)
+ argarray[i] = va_arg (ap, tree);
+ va_end (ap);
+ return build_call_expr_loc_array (UNKNOWN_LOCATION, fndecl, n, argarray);
+}
+
+/* Create a new constant string literal and return a char* pointer to it.
+ The STRING_CST value is the LEN characters at STR. */
+tree
+build_string_literal (int len, const char *str)
+{
+ tree t, elem, index, type;
+
+ t = build_string (len, str);
+ elem = build_type_variant (char_type_node, 1, 0);
+ index = build_index_type (size_int (len - 1));
+ type = build_array_type (elem, index);
+ TREE_TYPE (t) = type;
+ TREE_CONSTANT (t) = 1;
+ TREE_READONLY (t) = 1;
+ TREE_STATIC (t) = 1;
+
+ type = build_pointer_type (elem);
+ t = build1 (ADDR_EXPR, type,
+ build4 (ARRAY_REF, elem,
+ t, integer_zero_node, NULL_TREE, NULL_TREE));
+ return t;
+}
+
+
+
/* Return true if T (assumed to be a DECL) must be assigned a memory
location. */
build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T3)
extern tree build_call_array_loc (location_t, tree, tree, int, const tree *);
extern tree build_call_vec (tree, tree, vec<tree, va_gc> *);
+extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
+extern tree build_call_expr_loc_vec (location_t, tree, vec<tree, va_gc> *);
+extern tree build_call_expr_loc (location_t, tree, int, ...);
+extern tree build_call_expr (tree, int, ...);
+extern tree build_string_literal (int, const char *);
/* Construct various nodes representing data types. */
EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_low_bound (tree);
-/* In builtins.c. */
-
-/* Non-zero if __builtin_constant_p should be folded right away. */
-extern bool force_folding_builtin_constant_p;
-
-extern bool avoid_folding_inline_builtin (tree);
-extern tree fold_call_expr (location_t, tree, bool);
-extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree);
-extern tree fold_builtin_strcpy (location_t, tree, tree, tree, tree);
-extern tree fold_builtin_strncpy (location_t, tree, tree, tree, tree, tree);
-extern tree fold_builtin_strcat (location_t, tree, tree, tree);
-extern tree fold_builtin_memory_chk (location_t, tree, tree, tree, tree, tree, tree, bool,
- enum built_in_function);
-extern tree fold_builtin_stxcpy_chk (location_t, tree, tree, tree, tree, tree, bool,
- enum built_in_function);
-extern tree fold_builtin_stxncpy_chk (location_t, tree, tree, tree, tree, tree, bool,
- enum built_in_function);
-extern tree fold_builtin_expect (location_t, tree, tree, tree);
-extern bool fold_builtin_next_arg (tree, bool);
-extern enum built_in_function builtin_mathfn_code (const_tree);
-extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
-extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
-extern tree build_call_expr_loc_vec (location_t, tree, vec<tree, va_gc> *);
-extern tree build_call_expr_loc (location_t, tree, int, ...);
-extern tree build_call_expr (tree, int, ...);
-extern tree mathfn_built_in (tree, enum built_in_function fn);
-extern tree c_strlen (tree, int);
-extern tree build_string_literal (int, const char *);
-extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
-extern bool is_builtin_fn (tree);
-extern bool get_object_alignment_1 (tree, unsigned int *,
- unsigned HOST_WIDE_INT *);
-extern unsigned int get_object_alignment (tree);
-extern bool get_pointer_alignment_1 (tree, unsigned int *,
- unsigned HOST_WIDE_INT *);
-extern unsigned int get_pointer_alignment (tree);
-extern tree fold_call_stmt (gimple, bool);
-extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
-extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
-extern bool is_simple_builtin (tree);
-extern bool is_inexpensive_builtin (tree);
-
#endif /* GCC_TREE_H */