diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-27 14:34:52 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-27 12:34:52 +0000 |
commit | 3d78e00879b42574c9b0084c30f1361f0cfb9101 (patch) | |
tree | bc8f9a510c36fa862ab02298af03a506c99fdda5 /gcc/lto | |
parent | bb79aba479cf228832b8d2c6bfb8bf420a1f6f4a (diff) | |
download | gcc-3d78e00879b42574c9b0084c30f1361f0cfb9101.zip gcc-3d78e00879b42574c9b0084c30f1361f0cfb9101.tar.gz gcc-3d78e00879b42574c9b0084c30f1361f0cfb9101.tar.bz2 |
Come up with fndecl_built_in_p.
2018-08-27 Martin Liska <mliska@suse.cz>
* builtins.h (is_builtin_fn): Remove and fndecl_built_in_p.
* builtins.c (is_builtin_fn): Likewise.
* attribs.c (diag_attr_exclusions): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
(builtin_mathfn_code): Likewise.
(fold_builtin_expect): Likewise.
(fold_call_expr): Likewise.
(fold_builtin_call_array): Likewise.
(fold_call_stmt): Likewise.
(set_builtin_user_assembler_name): Likewise.
(is_simple_builtin): Likewise.
* calls.c (gimple_alloca_call_p): Likewise.
(maybe_warn_nonstring_arg): Likewise.
* cfgexpand.c (expand_call_stmt): Likewise.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Likewise.
(cgraph_edge::verify_corresponds_to_fndecl): Likewise.
(cgraph_node::verify_node): Likewise.
* cgraphclones.c (build_function_decl_skip_args): Likewise.
(cgraph_node::create_clone): Likewise.
* config/arm/arm.c (arm_insert_attributes): Likewise.
* config/i386/i386.c (ix86_gimple_fold_builtin): Likewise.
* dse.c (scan_insn): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* fold-const.c (operand_equal_p): Likewise.
(fold_binary_loc): Likewise.
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise.
* gimple-low.c (lower_stmt): Likewise.
* gimple-pretty-print.c (dump_gimple_call): Likewise.
* gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Likewise.
* gimple.c (gimple_build_call_from_tree): Likewise.
(gimple_call_builtin_p): Likewise.
(gimple_call_combined_fn): Likewise.
* gimplify.c (gimplify_call_expr): Likewise.
(gimple_boolify): Likewise.
(gimplify_modify_expr): Likewise.
(gimplify_addr_expr): Likewise.
* hsa-gen.c (gen_hsa_insns_for_call): Likewise.
* ipa-cp.c (determine_versionability): Likewise.
* ipa-fnsummary.c (compute_fn_summary): Likewise.
* ipa-param-manipulation.c (ipa_modify_formal_parameters): Likewise.
* ipa-split.c (visit_bb): Likewise.
(split_function): Likewise.
* ipa-visibility.c (cgraph_externally_visible_p): Likewise.
* lto-cgraph.c (input_node): Likewise.
* lto-streamer-out.c (write_symbol): Likewise.
* omp-low.c (setjmp_or_longjmp_p): Likewise.
(lower_omp_1): Likewise.
* predict.c (strip_predict_hints): Likewise.
* print-tree.c (print_node): Likewise.
* symtab.c (symtab_node::output_to_lto_symbol_table_p): Likewise.
* trans-mem.c (is_tm_irrevocable): Likewise.
(is_tm_load): Likewise.
(is_tm_simple_load): Likewise.
(is_tm_store): Likewise.
(is_tm_simple_store): Likewise.
(is_tm_abort): Likewise.
(tm_region_init_1): Likewise.
* tree-call-cdce.c (gen_shrink_wrap_conditions): Likewise.
* tree-cfg.c (verify_gimple_call): Likewise.
(move_stmt_r): Likewise.
(stmt_can_terminate_bb_p): Likewise.
* tree-eh.c (lower_eh_constructs_2): Likewise.
* tree-if-conv.c (if_convertible_stmt_p): Likewise.
* tree-inline.c (remap_gimple_stmt): Likewise.
(copy_bb): Likewise.
(estimate_num_insns): Likewise.
(fold_marked_statements): Likewise.
* tree-sra.c (scan_function): Likewise.
* tree-ssa-ccp.c (surely_varying_stmt_p): Likewise.
(optimize_stack_restore): Likewise.
(pass_fold_builtins::execute): Likewise.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
(mark_all_reaching_defs_necessary_1): Likewise.
* tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Likewise.
* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
(pass_forwprop::execute): Likewise.
* tree-ssa-loop-im.c (stmt_cost): Likewise.
* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise.
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Likewise.
* tree-ssa-strlen.c (get_string_length): Likewise.
* tree-ssa-structalias.c (handle_lhs_call): Likewise.
(find_func_aliases_for_call): Likewise.
* tree-ssa-ter.c (find_replaceable_in_bb): Likewise.
* tree-stdarg.c (optimize_va_list_gpr_fpr_size): Likewise.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree.c (need_assembler_name_p): Likewise.
(free_lang_data_in_decl): Likewise.
(get_call_combined_fn): Likewise.
* ubsan.c (is_ubsan_builtin_p): Likewise.
* varasm.c (incorporeal_function_p): Likewise.
* tree.h (DECL_BUILT_IN): Remove and replace with
fndecl_built_in_p.
(DECL_BUILT_IN_P): Transfort to fndecl_built_in_p.
(fndecl_built_in_p): New.
2018-08-27 Martin Liska <mliska@suse.cz>
* gcc-interface/decl.c (update_profile): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
* gcc-interface/gigi.h (call_is_atomic_load): Likewise.
* gcc-interface/utils.c (gnat_pushdecl): Likewise.
2018-08-27 Martin Liska <mliska@suse.cz>
* c-common.c (check_function_restrict): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
(check_builtin_function_arguments): Likewise.
(reject_gcc_builtin): Likewise.
* c-warn.c (sizeof_pointer_memaccess_warning): Likewise.
2018-08-27 Martin Liska <mliska@suse.cz>
* c-decl.c (locate_old_decl): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
(diagnose_mismatched_decls): Likewise.
(merge_decls): Likewise.
(warn_if_shadowing): Likewise.
(pushdecl): Likewise.
(implicitly_declare): Likewise.
* c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
* c-tree.h (C_DECL_ISNT_PROTOTYPE): Likewise.
* c-typeck.c (build_function_call_vec): Likewise.
(convert_arguments): Likewise.
2018-08-27 Martin Liska <mliska@suse.cz>
* call.c (build_call_a): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
(build_cxx_call): Likewise.
* constexpr.c (constexpr_fn_retval): Likewise.
(cxx_eval_builtin_function_call): Likewise.
(cxx_eval_call_expression): Likewise.
(potential_constant_expression_1): Likewise.
* cp-gimplify.c (cp_gimplify_expr): Likewise.
(cp_fold): Likewise.
* decl.c (decls_match): Likewise.
(validate_constexpr_redeclaration): Likewise.
(duplicate_decls): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
* name-lookup.c (consider_binding_level): Likewise.
(cp_emit_debug_info_for_using): Likewise.
* semantics.c (finish_call_expr): Likewise.
* tree.c (builtin_valid_in_constant_expr_p): Likewise.
2018-08-27 Martin Liska <mliska@suse.cz>
* go-gcc.cc (Gcc_backend::call_expression): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
2018-08-27 Martin Liska <mliska@suse.cz>
* lto-lang.c (handle_const_attribute): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
possible.
* lto-symtab.c (lto_symtab_merge_p): Likewise.
(lto_symtab_merge_decls_1): Likewise.
(lto_symtab_merge_symbols): Likewise.
* lto.c (lto_maybe_register_decl): Likewise.
(read_cgraph_and_symbols): Likewise.
From-SVN: r263880
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/lto/lto-lang.c | 3 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.c | 8 | ||||
-rw-r--r-- | gcc/lto/lto.c | 5 |
4 files changed, 19 insertions, 8 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index a92317c..c05f6fb 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,14 @@ +2018-08-27 Martin Liska <mliska@suse.cz> + + * lto-lang.c (handle_const_attribute): Use new function + fndecl_built_in_p and remove check for FUNCTION_DECL if + possible. + * lto-symtab.c (lto_symtab_merge_p): Likewise. + (lto_symtab_merge_decls_1): Likewise. + (lto_symtab_merge_symbols): Likewise. + * lto.c (lto_maybe_register_decl): Likewise. + (read_cgraph_and_symbols): Likewise. + 2018-08-21 Tom de Vries <tdevries@suse.de> * lto.c (lto_main): Call debuginfo_early_start and diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index de6ec1c..8eb4a25 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -303,8 +303,7 @@ handle_const_attribute (tree *node, tree ARG_UNUSED (name), tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - if (TREE_CODE (*node) != FUNCTION_DECL - || !DECL_BUILT_IN (*node)) + if (!fndecl_built_in_p (*node)) inform (UNKNOWN_LOCATION, "%s:%s: %E: %E", __FILE__, __func__, *node, name); tree type = TREE_TYPE (*node); diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 0d603c0..cf08d45 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -546,14 +546,14 @@ lto_symtab_merge_p (tree prevailing, tree decl) if (TREE_CODE (prevailing) == FUNCTION_DECL) { - if (DECL_BUILT_IN (prevailing) != DECL_BUILT_IN (decl)) + if (fndecl_built_in_p (prevailing) != fndecl_built_in_p (decl)) { if (dump_file) fprintf (dump_file, "Not merging decls; " "DECL_BUILT_IN mismatch\n"); return false; } - if (DECL_BUILT_IN (prevailing) + if (fndecl_built_in_p (prevailing) && (DECL_BUILT_IN_CLASS (prevailing) != DECL_BUILT_IN_CLASS (decl) || DECL_FUNCTION_CODE (prevailing) != DECL_FUNCTION_CODE (decl))) { @@ -797,7 +797,7 @@ lto_symtab_merge_decls_1 (symtab_node *first) { for (e = first; e; e = e->next_sharing_asm_name) if (TREE_CODE (e->decl) == FUNCTION_DECL - && !DECL_BUILT_IN (e->decl) + && !fndecl_built_in_p (e->decl) && lto_symtab_symbol_p (e)) { prevailing = e; @@ -1030,7 +1030,7 @@ lto_symtab_merge_symbols (void) /* Builtins are not merged via decl merging. It is however possible that tree merging unified the declaration. We do not want duplicate entries in symbol table. */ - if (cnode && DECL_BUILT_IN (node->decl) + if (cnode && fndecl_built_in_p (node->decl) && (cnode2 = cgraph_node::get (node->decl)) && cnode2 != cnode) lto_cgraph_replace_node (cnode2, cnode); diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 1061889..5b92bee 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -894,7 +894,7 @@ lto_maybe_register_decl (struct data_in *data_in, tree t, unsigned ix) if (TREE_CODE (t) == VAR_DECL) lto_register_var_decl_in_symtab (data_in, t, ix); else if (TREE_CODE (t) == FUNCTION_DECL - && !DECL_BUILT_IN (t)) + && !fndecl_built_in_p (t)) lto_register_function_decl_in_symtab (data_in, t, ix); } @@ -2923,7 +2923,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) FOR_EACH_SYMBOL (snode) if (snode->externally_visible && snode->real_symbol_p () && snode->lto_file_data && snode->lto_file_data->resolution_map - && !is_builtin_fn (snode->decl) + && !(TREE_CODE (snode->decl) != FUNCTION_DECL + || fndecl_built_in_p (snode->decl)) && !(VAR_P (snode->decl) && DECL_HARD_REGISTER (snode->decl))) { ld_plugin_symbol_resolution_t *res; |