aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
AgeCommit message (Collapse)AuthorFilesLines
2017-12-07New VECTOR_CST layoutRichard Sandiford2-3/+14
This patch uses a simple compression scheme to represent the contents of a VECTOR_CST using its leading elements. There are three formats: 1) a repeating sequence of N values. This is encoded using the first N elements. 2) a "foreground" sequence of N values inserted at the beginning of a "background" repeating sequence of N values, such as: { 1, 2, 0, 0, 0, 0, ... }. This is encoded using the first 2*N elements. 2) a "foreground" sequence of N values inserted at the beginning of a "background" repeating sequence of N interleaved linear series, such as: { 0, 0, 8, 10, 9, 11, 10, 12, ... }. This is encoded using the first 3*N elements. In practice the foreground values are often part of the same series as the background values, such as: { 1, 11, 2, 12, 3, 13, ... }. This reduces the amount of work involved in processing simple vector constants and means that the encoding extends naturally to variable-length vectors. 2017-12-07 Richard Sandiford <richard.sandiford@arm.com> gcc/ * doc/generic.texi (VECTOR_CST): Describe new representation of vector constants. * vector-builder.h: New file. * tree-vector-builder.h: Likewise. * tree-vector-builder.c: Likewise. * Makefile.in (OBJS): Add tree-vector-builder.o. * tree.def (VECTOR_CST): Update comment to refer to generic.texi. * tree-core.h (tree_base): Add a vector_cst field to the u union. (tree_vector): Change the number of elements to vector_cst_encoded_nelts. * tree.h (VECTOR_CST_NELTS): Redefine using TYPE_VECTOR_SUBPARTS. (VECTOR_CST_ELTS): Delete. (VECTOR_CST_ELT): Redefine using vector_cst_elt. (VECTOR_CST_LOG2_NPATTERNS, VECTOR_CST_NPATTERNS): New macros. (VECTOR_CST_NELTS_PER_PATTERN, VECTOR_CST_DUPLICATE_P): Likewise. (VECTOR_CST_STEPPED_P, VECTOR_CST_ENCODED_ELTS): Likewise. (VECTOR_CST_ENCODED_ELT): Likewise. (vector_cst_encoded_nelts): New function. (make_vector): Take the values of VECTOR_CST_LOG2_NPATTERNS and VECTOR_CST_NELTS_PER_PATTERN as arguments. (vector_cst_int_elt, vector_cst_elt): Declare. * tree.c: Include tree-vector-builder.h. (tree_code_size): Abort if passed VECTOR_CST. (tree_size): Update for new VECTOR_CST layout. (make_vector): Take the values of VECTOR_CST_LOG2_NPATTERNS and VECTOR_CST_NELTS_PER_PATTERN as arguments. (build_vector): Use tree_vector_builder. (vector_cst_int_elt, vector_cst_elt): New functions. (drop_tree_overflow): For VECTOR_CST, drop the TREE_OVERFLOW from the encoded elements and then create the vector in the canonical form. (check_vector_cst, check_vector_cst_duplicate, check_vector_cst_fill) (check_vector_cst_stepped, test_vector_cst_patterns): New functions. (tree_c_tests): Call test_vector_cst_patterns. * lto-streamer-out.c (DFS::DFS_write_tree_body): Handle the new VECTOR_CST fields. (hash_tree): Likewise. * tree-streamer-out.c (write_ts_vector_tree_pointers): Likewise. (streamer_write_tree_header): Likewise. * tree-streamer-in.c (lto_input_ts_vector_tree_pointers): Likewise. (streamer_alloc_tree): Likewise. Update call to make_vector. * fold-const.c (fold_ternary_loc): Avoid using VECTOR_CST_ELTS. gcc/lto/ * lto.c (compare_tree_sccs_1): Compare the new VECTOR_CST flags. From-SVN: r255474
2017-12-07PR c/81544 - attribute noreturn and warn_unused_result on the same function ↵Martin Sebor2-21/+67
accepted PR c/81544 - attribute noreturn and warn_unused_result on the same function accepted PR c/81566 - invalid attribute aligned accepted on functions gcc/ada/ChangeLog: PR c/81544 * gcc-interface/utils.c (gnat_internal_attribute_table): Initialize new member of struct attribute_spec. gcc/c/ChangeLog: PR c/81544 * c-decl.c (c_decl_attributes): Look up existing declaration and pass it to decl_attributes. gcc/c-family/ChangeLog: PR c/81544 PR c/81566 * c-attribs.c (attr_aligned_exclusions): New array. (attr_alloc_exclusions, attr_cold_hot_exclusions): Same. (attr_common_exclusions, attr_const_pure_exclusions): Same. (attr_gnu_inline_exclusions, attr_inline_exclusions): Same. (attr_noreturn_exclusions, attr_returns_twice_exclusions): Same. (attr_warn_unused_result_exclusions): Same. (handle_hot_attribute, handle_cold_attribute): Simplify. (handle_const_attribute): Warn on function returning void. (handle_pure_attribute): Same. (handle_aligned_attribute): Diagnose conflicting attribute specifications. * c-warn.c (diagnose_mismatched_attributes): Simplify. gcc/cp/ChangeLog: PR c/81544 * cp-tree.h (decls_match): Add default argument. * decl.c (decls_match): Avoid calling into the target back end and triggering an error. * decl2.c (cplus_decl_attributes): Look up existing declaration and pass it to decl_attributes. * tree.c (cxx_attribute_table): Initialize new member of struct attribute_spec. gcc/fortran/ChangeLog: PR c/81544 * f95-lang.c (gfc_attribute_table): Initialize new member of struct attribute_spec. gcc/lto/ChangeLog: PR c/81544 * lto-lang.c (lto_attribute_table): Initialize new member of struct attribute_spec. gcc/ChangeLog: PR c/81544 * attribs.c (empty_attribute_table): Initialize new member of struct attribute_spec. (decl_attributes): Add argument. Handle mutually exclusive combinations of attributes. (selftests::test_attribute_exclusions): New function. (selftests::attribute_c_tests): Ditto. * attribs.h (decl_attributes): Add default argument. * selftest.h (attribute_c_tests): Declare. * selftest-run-tests.c (selftest::run_tests): Call attribute_c_tests. * tree-core.h (attribute_spec::exclusions, exclude): New type and member. * doc/extend.texi (Common Function Attributes): Update const and pure. gcc/testsuite/ChangeLog: PR c/81544 * c-c++-common/Wattributes-2.c: New test. * c-c++-common/Wattributes.c: New test. * c-c++-common/attributes-3.c: Adjust. * gcc.dg/Wattributes-6.c: New test. * gcc.dg/Wattributes-7.c: New test. * gcc.dg/attr-noinline.c * gcc.dg/pr44964.c: Same. * gcc.dg/torture/pr42363.c: Same. * gcc.dg/tree-ssa/ssa-ccp-2.c: Same. From-SVN: r255469
2017-11-30spellcheck-tree.c (test_find_closest_identifier): Use ; instead of ;;.Jakub Jelinek2-1/+5
* spellcheck-tree.c (test_find_closest_identifier): Use ; instead of ;;. * gengtype-state.c (read_state_pair): Likewise. * gimple-fold.c (gimple_fold_builtin_string_compare): Likewise. * sel-sched-dump.c (dump_insn_rtx_1): Likewise. * ipa-cp.c (intersect_aggregates_with_edge): Likewise. * ifcvt.c (noce_try_store_flag_constants): Likewise. * tree-ssa-ccp.c (ccp_finalize): Likewise. * omp-grid.c (grid_process_kernel_body_copy): Likewise. * builtins.c (fold_builtin_3): Likewise. * graphite-scop-detection.c (scop_detection::stmt_has_simple_data_refs_p): Likewise. * hsa-gen.c (hsa_function_representation::hsa_function_representation): Likewise. c/ * c-parser.c (c_parser_postfix_expression): Use ; instead of ;;. jit/ * jit-recording.c (recording::memento_of_new_rvalue_from_const <long>::write_reproducer): Use ; instead of ;;. lto/ * lto.c (create_subid_section_table): Use ; instead of ;;. objc/ * objc-next-runtime-abi-01.c (generate_dispatch_table): Use ; instead of ;;. From-SVN: r255284
2017-11-28Remove Cilk Plus support.Julia Koval1-4/+0
* Makefile.def (target_modules): Remove libcilkrts. * Makefile.in: Ditto. * configure: Ditto. * configure.ac: Ditto. contrib/ * contrib/gcc_update: Ditto. gcc/ * Makefile.in (cilkplus.def, cilk-builtins.def, c-family/cilk.o, c-family/c-cilkplus.o, c-family/array-notation-common.o, cilk-common.o, cilk.h, cilk-common.c): Remove. * builtin-types.def (BT_FN_INT_PTR_PTR_PTR_FTYPE_BT_INT_BT_PTR_BT_PTR_BT_PTR): Remove. * builtins.c (is_builtin_name): Remove cilkplus condition. (BUILT_IN_CILK_DETACH, BUILT_IN_CILK_POP_FRAME): Remove. * builtins.def (DEF_CILK_BUILTIN_STUB, DEF_CILKPLUS_BUILTIN, cilk-builtins.def, cilkplus.def): Remove. * cif-code.def (CILK_SPAWN): Remove. * cilk-builtins.def: Delete. * cilk-common.c: Ditto. * cilk.h: Ditto. * cilkplus.def: Ditto. * config/darwin.h (fcilkplus): Delete. * cppbuiltin.c: Ditto. * doc/extend.texi: Remove cilkplus doc. * doc/generic.texi: Ditto. * doc/invoke.texi: Ditto. * doc/passes.texi: Ditto. * gcc.c (fcilkplus): Remove. * gengtype.c (cilk.h): Remove. * gimple-pretty-print.c (dump_gimple_omp_for): Remove cilkplus support. * gimple.h (GF_OMP_FOR_KIND_CILKFOR, GF_OMP_FOR_KIND_CILKSIMD): Remove. * gimplify.c (gimplify_return_expr, maybe_fold_stmt, gimplify_call_expr, is_gimple_stmt, gimplify_modify_expr, gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses, gimplify_omp_for, gimplify_expr): Remove cilkplus conditions. * ipa-fnsummary.c (ipa_dump_fn_summary, compute_fn_summary, inline_read_section): Ditto. * ipa-inline-analysis.c (cilk.h): Remove. * ira.c (ira_setup_eliminable_regset): Remove cilkplus support. * lto-wrapper.c (merge_and_complain, append_compiler_options, append_linker_options): Remove condition for fcilkplus. * lto/lto-lang.c (cilk.h): Remove. (lto_init): Remove condition for fcilkplus. * omp-expand.c (expand_cilk_for_call): Delete. (expand_omp_taskreg, expand_omp_for_static_chunk, expand_omp_for): Remove cilkplus conditions. (expand_cilk_for): Delete. * omp-general.c (omp_extract_for_data): Remove cilkplus support. * omp-low.c (scan_sharing_clauses, create_omp_child_function, execute_lower_omp, diagnose_sb_0): Ditto. * omp-simd-clone.c (simd_clone_clauses_extract): Ditto. * tree-core.h (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree-nested.c: Ditto. * tree-pretty-print.c (dump_omp_clause): Remove cilkplus support. (dump_generic_node): Ditto. * tree.c (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree.def (cilk_simd, cilk_for, cilk_spawn_stmt, cilk_sync_stmt): Delete. * tree.h (CILK_SPAWN_FN, EXPR_CILK_SPAWN): Delete. gcc/c-family/ * array-notation-common.c: Delete. * c-cilkplus.c: Ditto. * c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove. * c-common.def (ARRAY_NOTATION_REF): Remove. * c-common.h (RID_CILK_SPAWN, build_array_notation_expr, build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop, c_validate_cilk_plus_loop, cilkplus_an_parts, cilk_ignorable_spawn_rhs_op, cilk_recognize_spawn): Remove. * c-gimplify.c (CILK_SPAWN_STMT): Remove. * c-omp.c: Remove CILK_SIMD check. * c-pragma.c: Ditto. * c-pragma.h: Remove CILK related pragmas. * c-pretty-print.c (c_pretty_printer::postfix_expression): Remove ARRAY_NOTATION_REF condition. (c_pretty_printer::expression): Ditto. * c.opt (fcilkplus): Remove. * cilk.c: Delete. gcc/c/ * Make-lang.in (c/c-array-notation.o): Remove. * c-array-notation.c: Delete. * c-decl.c: Remove cilkplus condition. * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for, c_parser_cilk_verify_simd, c_parser_array_notation, c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize, c_parser_cilk_simd_fn_vector_attrs, c_finish_cilk_simd_fn_tokens): Delete. (c_parser_declaration_or_fndef): Remove cilkplus condition. (c_parser_direct_declarator_inner): Ditto. (CILK_SIMD_FN_CLAUSE_MASK): Delete. (c_parser_attributes, c_parser_compound_statement, c_parser_statement_after_labels, c_parser_if_statement, c_parser_switch_statement, c_parser_while_statement, c_parser_do_statement, c_parser_for_statement, c_parser_unary_expression, c_parser_postfix_expression, c_parser_postfix_expression_after_primary, c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses, c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus support. * c-typeck.c (build_array_ref, build_function_call_vec, convert_arguments, lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt, c_finish_loop, build_binary_op): Remove cilkplus support. gcc/cp/ * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete. * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus. * constexpr.c (potential_constant_expression_1): Ditto. * cp-array-notation.c: Delete. * cp-cilkplus.c: Ditto. * cp-cilkplus.h: Ditto. * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove cilkplus condition. * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete. * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete. * decl.c (grokfndecl, finish_function): Remove cilkplus condition. * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition. * lambda.c (cp-cilkplus.h): Remove. * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for, cp_parser_cilk_simd_vectorlength): Delete. (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body, cp_parser_postfix_expression, cp_parser_postfix_open_square_expression, cp_parser_statement, cp_parser_jump_statement, cp_parser_direct_declarator, cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list, cp_parser_omp_clause_name, cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear, cp_parser_omp_all_clauses, cp_parser_omp_flush, cp_parser_omp_for_cond, cp_parser_omp_for_incr, cp_parser_omp_for_loop_init, cp_parser_omp_for_loop, cp_parser_omp_declare_simd): Remove cilkplus support. (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info, cp_parser_cilk_grainsize): Remove. (cp_parser_pragma, c_parse_file): Remove cilkplus support. (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear, cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses, cp_parser_cilk_simd, cp_parser_cilk_for): Remove. * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove. * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove cilkplus support. * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body, finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr, finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove cilkplus support. * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon. * typeck.c (cp_build_array_ref, cp_build_compound_expr, check_return_expr): Remove cilkplus support. gcc/testsuite/ * c-c++-common/attr-simd-3.c: Delete. * c-c++-common/cilk-plus/AN/an-if.c: Delete. * c-c++-common/cilk-plus/AN/array_test1.c: Delete. * c-c++-common/cilk-plus/AN/array_test2.c: Delete. * c-c++-common/cilk-plus/AN/array_test_ND.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Delete. * c-c++-common/cilk-plus/AN/comma_exp.c: Delete. * c-c++-common/cilk-plus/AN/conditional.c: Delete. * c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Delete. * c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Delete. * c-c++-common/cilk-plus/AN/exec-once.c: Delete. * c-c++-common/cilk-plus/AN/exec-once2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr-2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr.c: Delete. * c-c++-common/cilk-plus/AN/fp_triplet_values.c: Delete. * c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Delete. * c-c++-common/cilk-plus/AN/gather_scatter.c: Delete. * c-c++-common/cilk-plus/AN/if_test.c: Delete. * c-c++-common/cilk-plus/AN/if_test_errors.c: Delete. * c-c++-common/cilk-plus/AN/misc.c: Delete. * c-c++-common/cilk-plus/AN/n-ptr-test.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors2.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors3.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors4.c: Delete. * c-c++-common/cilk-plus/AN/pr57457-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57457.c: Delete. * c-c++-common/cilk-plus/AN/pr57490.c: Delete. * c-c++-common/cilk-plus/AN/pr57541-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57541.c: Delete. * c-c++-common/cilk-plus/AN/pr57577.c: Delete. * c-c++-common/cilk-plus/AN/pr58942.c: Delete. * c-c++-common/cilk-plus/AN/pr61191.c: Delete. * c-c++-common/cilk-plus/AN/pr61455-2.c: Delete. * c-c++-common/cilk-plus/AN/pr61455.c: Delete. * c-c++-common/cilk-plus/AN/pr61962.c: Delete. * c-c++-common/cilk-plus/AN/pr61963.c: Delete. * c-c++-common/cilk-plus/AN/pr62008.c: Delete. * c-c++-common/cilk-plus/AN/pr63884.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch2.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch3.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit2.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_return.c: Delete. * c-c++-common/cilk-plus/AN/side-effects-1.c: Delete. * c-c++-common/cilk-plus/AN/test_builtin_return.c: Delete. * c-c++-common/cilk-plus/AN/test_sec_limits.c: Delete. * c-c++-common/cilk-plus/AN/tst_lngth.c: Delete. * c-c++-common/cilk-plus/AN/vla.c: Delete. * c-c++-common/cilk-plus/CK/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-2.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-3.c: Delete. * c-c++-common/cilk-plus/CK/cilk-fors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Delete. * c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/errors.c: Delete. * c-c++-common/cilk-plus/CK/fib.c: Delete. * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_return.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_sync.c: Delete. * c-c++-common/cilk-plus/CK/invalid_spawns.c: Delete. * c-c++-common/cilk-plus/CK/invalid_sync.c: Delete.c * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Delete. * c-c++-common/cilk-plus/CK/no_args_error.c: Delete. * c-c++-common/cilk-plus/CK/pr59631.c: Delete. * c-c++-common/cilk-plus/CK/pr60197-2.c: Delete. * c-c++-common/cilk-plus/CK/pr60197.c: Delete. * c-c++-common/cilk-plus/CK/pr60469.c: Delete. * c-c++-common/cilk-plus/CK/pr60586.c: Delete. * c-c++-common/cilk-plus/CK/pr63307.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-1.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-2.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-4.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-7.c: Delete. * c-c++-common/cilk-plus/CK/spawn_in_return.c: Delete. * c-c++-common/cilk-plus/CK/spawnee_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawner_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawning_arg.c: Delete. * c-c++-common/cilk-plus/CK/steal_check.c: Delete. * c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Delete. * c-c++-common/cilk-plus/CK/test__cilk.c: Delete. * c-c++-common/cilk-plus/CK/varargs_test.c: Delete. * c-c++-common/cilk-plus/PS/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/PS/body.c: Delete. * c-c++-common/cilk-plus/PS/clauses1.c: Delete. * c-c++-common/cilk-plus/PS/clauses2.c: Delete. * c-c++-common/cilk-plus/PS/clauses3.c: Delete. * c-c++-common/cilk-plus/PS/clauses4.c: Delete. * c-c++-common/cilk-plus/PS/for1.c: Delete. * c-c++-common/cilk-plus/PS/for2.c: Delete. * c-c++-common/cilk-plus/PS/for3.c: Delete. * c-c++-common/cilk-plus/PS/pr69363.c: Delete. * c-c++-common/cilk-plus/PS/reduction-1.c: Delete. * c-c++-common/cilk-plus/PS/reduction-2.c: Delete. * c-c++-common/cilk-plus/PS/reduction-3.c: Delete. * c-c++-common/cilk-plus/PS/run-1.c: Delete. * c-c++-common/cilk-plus/PS/safelen.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-2.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-3.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength.c: Delete. * c-c++-common/cilk-plus/SE/ef_error.c: Delete. * c-c++-common/cilk-plus/SE/ef_error2.c: Delete. * c-c++-common/cilk-plus/SE/ef_error3.c: Delete. * c-c++-common/cilk-plus/SE/ef_test.c: Delete. * c-c++-common/cilk-plus/SE/ef_test2.c: Delete. * c-c++-common/cilk-plus/SE/vlength_errors.c: Delete. * g++.dg/cilk-plus/AN/array_function.c: Delete. * g++.dg/cilk-plus/AN/array_test1_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test2_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test_ND_tplt.c: Delete. * g++.dg/cilk-plus/AN/braced_list.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.c: Delete. * g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c: Delete. * g++.dg/cilk-plus/AN/postincr_test.c: Delete. * g++.dg/cilk-plus/AN/preincr_test.c: Delete. * g++.dg/cilk-plus/CK/catch_exc.c: Delete. * g++.dg/cilk-plus/CK/cf3.c: Delete. * g++.dg/cilk-plus/CK/cilk-for-tplt.c: Delete. * g++.dg/cilk-plus/CK/const_spawn.c: Delete. * g++.dg/cilk-plus/CK/fib-opr-overload.c: Delete. * g++.dg/cilk-plus/CK/fib-tplt.c: Delete. * g++.dg/cilk-plus/CK/for1.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns_tplt.c: Delete. * g++.dg/cilk-plus/CK/pr60586.c: Delete. * g++.dg/cilk-plus/CK/pr66326.c: Delete. * g++.dg/cilk-plus/CK/pr68001.c: Delete. * g++.dg/cilk-plus/CK/pr68997.c: Delete. * g++.dg/cilk-plus/CK/pr69024.c: Delete. * g++.dg/cilk-plus/CK/pr69048.c: Delete. * g++.dg/cilk-plus/CK/pr69267.c: Delete. * g++.dg/cilk-plus/CK/pr80038.c: Delete. * g++.dg/cilk-plus/CK/stl_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_rev_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_test.c: Delete. * g++.dg/cilk-plus/cilk-plus.exp * g++.dg/cilk-plus/ef_test.C: Delete. * g++.dg/cilk-plus/for.C: Delete. * g++.dg/cilk-plus/for2.C: Delete. * g++.dg/cilk-plus/for3.C: Delete. * g++.dg/cilk-plus/for4.C: Delete. * g++.dg/cilk-plus/pr60967.C: Delete. * g++.dg/cilk-plus/pr69028.C: Delete. * g++.dg/cilk-plus/pr70565.C: Delete. * g++.dg/pr57662.C: Delete. * gcc.dg/cilk-plus/cilk-plus.exp * gcc.dg/cilk-plus/for1.c: Delete. * gcc.dg/cilk-plus/for2.c: Delete. * gcc.dg/cilk-plus/jump-openmp.c: Delete. * gcc.dg/cilk-plus/jump.c: Delete. * gcc.dg/cilk-plus/pr69798-1.c: Delete. * gcc.dg/cilk-plus/pr69798-2.c: Delete. * gcc.dg/cilk-plus/pr78306.c: Delete. * gcc.dg/cilk-plus/pr79116.c: Delete. * gcc.dg/graphite/id-28.c: Delete. * lib/cilk-plus-dg.exp: Delete. * lib/target-supports.exp (cilkplus_runtime): Delete. Co-Authored-By: Sebastian Peryt <sebastian.peryt@intel.com> From-SVN: r255195
2017-11-22re PR c++/60336 (empty struct value is passed differently in C and C++)Marek Polacek2-0/+9
PR c++/60336 PR middle-end/67239 PR target/68355 * c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields. * class.c (layout_class_type): Set DECL_PADDING_P on padding. * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P. (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields. * lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P. * calls.c (initialize_argument_information): Call warn_parameter_passing_abi target hook. (store_one_arg): Use 0 for empty record size. Don't push 0 size argument onto stack. (must_pass_in_stack_var_size_or_pad): Return false for empty types. * common.opt: Update -fabi-version description. * config/i386/i386.c (init_cumulative_args): Set cum->warn_empty. (ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of int_size_in_bytes. (ix86_is_empty_record): New function. (ix86_warn_parameter_passing_abi): New function. (TARGET_EMPTY_RECORD_P): Redefine. (TARGET_WARN_PARAMETER_PASSING_ABI): Redefine. * config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty. * doc/tm.texi: Regenerated. * doc/tm.texi.in (TARGET_EMPTY_RECORD_P, TARGET_WARN_PARAMETER_PASSING_ABI): Add. * dwarf2out.c (get_ultimate_context): Move to tree.c. * explow.c (hard_function_value): Call arg_int_size_in_bytes instead of int_size_in_bytes. * expr.c (copy_blkmode_to_reg): Likewise. * function.c (aggregate_value_p): Return 0 for empty types. (assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target hook. (locate_and_pad_parm): Call arg size_in_bytes instead size_in_bytes. * lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P. * stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P. * target.def (empty_record_p, warn_parameter_passing_abi): New target hooks. * targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook. (std_gimplify_va_arg_expr): Skip empty records. Call arg_size_in_bytes instead size_in_bytes. * targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare. * tree-core.h (tree_type_common): Add empty_flag. (tree_decl_common): Update comments. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream DECL_PADDING_P. (unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream DECL_PADDING_P. (pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P. * tree.c (default_is_empty_type): New function. (default_is_empty_record): New function. (arg_int_size_in_bytes): New function. (arg_size_in_bytes): New function. (get_ultimate_context): New function. * tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and TRANSLATION_UNIT_WARN_EMPTY_P. (default_is_empty_record, arg_int_size_in_bytes, arg_size_in_bytes, get_ultimate_context): Declare. * g++.dg/abi/empty12.C: New test. * g++.dg/abi/empty12.h: New test. * g++.dg/abi/empty12a.c: New test. * g++.dg/abi/empty13.C: New test. * g++.dg/abi/empty13.h: New test. * g++.dg/abi/empty13a.c: New test. * g++.dg/abi/empty14.C: New test. * g++.dg/abi/empty14.h: New test. * g++.dg/abi/empty14a.c: New test. * g++.dg/abi/empty15.C: New test. * g++.dg/abi/empty15.h: New test. * g++.dg/abi/empty15a.c: New test. * g++.dg/abi/empty16.C: New test. * g++.dg/abi/empty16.h: New test. * g++.dg/abi/empty16a.c: New test. * g++.dg/abi/empty17.C: New test. * g++.dg/abi/empty17.h: New test. * g++.dg/abi/empty17a.c: New test. * g++.dg/abi/empty18.C: New test. * g++.dg/abi/empty18.h: New test. * g++.dg/abi/empty18a.c: New test. * g++.dg/abi/empty19.C: New test. * g++.dg/abi/empty19.h: New test. * g++.dg/abi/empty19a.c: New test. * g++.dg/abi/empty20.C: New test. * g++.dg/abi/empty21.C: New test. * g++.dg/abi/empty22.C: New test. * g++.dg/abi/empty22.h: New test. * g++.dg/abi/empty22a.c: New test. * g++.dg/abi/empty23.C: New test. * g++.dg/abi/empty24.C: New test. * g++.dg/abi/empty25.C: New test. * g++.dg/abi/empty25.h: New test. * g++.dg/abi/empty25a.c: New test. * g++.dg/abi/empty26.C: New test. * g++.dg/abi/empty26.h: New test. * g++.dg/abi/empty26a.c: New test. * g++.dg/abi/empty27.C: New test. * g++.dg/abi/empty28.C: New test. * g++.dg/abi/pr60336-1.C: New test. * g++.dg/abi/pr60336-10.C: New test. * g++.dg/abi/pr60336-11.C: New test. * g++.dg/abi/pr60336-12.C: New test. * g++.dg/abi/pr60336-2.C: New test. * g++.dg/abi/pr60336-3.C: New test. * g++.dg/abi/pr60336-4.C: New test. * g++.dg/abi/pr60336-5.C: New test. * g++.dg/abi/pr60336-6.C: New test. * g++.dg/abi/pr60336-7.C: New test. * g++.dg/abi/pr60336-8.C: New test. * g++.dg/abi/pr60336-9.C: New test. * g++.dg/abi/pr68355.C: New test. * g++.dg/lto/pr60336_0.C: New test. Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r255066
2017-11-10auto-profile.c (afdo_indirect_call): Drop frequency.Jan Hubicka2-2/+6
* auto-profile.c (afdo_indirect_call): Drop frequency. * cgraph.c (symbol_table::create_edge): Drop frequency argument. (cgraph_node::create_edge): Drop frequency argument. (cgraph_node::create_indirect_edge): Drop frequency argument. (cgraph_edge::make_speculative): Drop frequency arguments. (cgraph_edge::resolve_speculation): Do not update frequencies (cgraph_edge::dump_edge_flags): Do not dump frequency. (cgraph_node::dump): Check consistency in IPA mode. (cgraph_edge::maybe_hot_p): Use IPA counter. (cgraph_edge::verify_count_and_frequency): Rename to ... (cgraph_edge::verify_count): ... this one; drop frequency checking. (cgraph_node::verify_node): Update. * cgraph.h (struct cgraph_edge): Drop frequency. (cgraph_edge::frequency): New function. * cgraphbuild.c (pass_build_cgraph_edges::execute): Donot pass frequencies. (cgraph_edge::rebuild_edges): Likewise. * cgraphclones.c (cgraph_edge::clone): Scale only counts. (duplicate_thunk_for_node): Do not pass frequency. (cgraph_node::create_clone): Scale only counts. (cgraph_node::create_virtual_clone): Do not pass frequency. (cgraph_node::create_edge_including_clones): Do not pass frequency. (cgraph_node::create_version_clone): Do not pass frequency. * cgraphunit.c (cgraph_node::analyze): Do not pass frequency. (cgraph_node::expand_thunk): Do not pass frequency. (cgraph_node::create_wrapper): Do not pass frequency. * gimple-iterator.c (update_call_edge_frequencies): Do not pass frequency. * gimple-streamer-in.c (input_bb): Scale only IPA counts. * ipa-chkp.c (chkp_produce_thunks): Do not pass frequency. * ipa-cp.c (ipcp_lattice::print): Use frequency function. (gather_caller_stats): Use frequency function. (ipcp_cloning_candidate_p): Use frequency function. (ipcp_propagate_stage): Use frequency function. (get_info_about_necessary_edges): Use frequency function. (update_profiling_info): Update only IPA profile. (update_specialized_profile): Use frequency functoin. (perhaps_add_new_callers): Update only IPA profile. * ipa-devirt.c (ipa_devirt): Use IPA profile. * ipa-fnsummary.c (redirect_to_unreachable): Do not set frequrency. (dump_ipa_call_summary): Use frequency function. (estimate_edge_size_and_time): Use frequency function. (ipa_merge_fn_summary_after_inlining): Use frequency function. * ipa-inline-analysis.c (do_estimate_edge_time): Use IPA profile. * ipa-inline-transform.c (update_noncloned_frequencies): Rename to .. (update_noncloned_counts): ... ths one; scale counts only. (clone_inlined_nodes): Do not scale frequency. (inline_call): Do not pass frequency. * ipa-inline.c (compute_uninlined_call_time): Use IPA profile. (compute_inlined_call_time): Use IPA profile. (want_inline_small_function_p): Use IPA profile. (want_inline_self_recursive_call_p): Use IPA profile. (edge_badness): Use IPA profile. (lookup_recursive_calls): Use IPA profile. (recursive_inlining): Do not pass frequency. (resolve_noninline_speculation): Do not update frequency. (inline_small_functions): Collect max of IPA profile. (dump_overall_stats): Dump IPA porfile. (dump_inline_stats): Dump IPA porfile. (ipa_inline): Collect IPA stats. * ipa-inline.h (clone_inlined_nodes): Update prototype. * ipa-profile.c (ipa_propagate_frequency_1): Use frequency function. (ipa_propagate_frequency): Use frequency function. (ipa_profile): Cleanup. * ipa-prop.c (ipa_make_edge_direct_to_target): Do not pass frequency * ipa-utils.c (ipa_merge_profiles): Merge all profiles. * lto-cgraph.c (lto_output_edge): Do not stream frequency. (input_node): Do not stream frequency. (input_edge): Do not stream frequency. (merge_profile_summaries): Scale only IPA profiles. * omp-simd-clone.c (simd_clone_adjust): Do not pass frequency. * predict.c (drop_profile): Do not recompute frequency. * trans-mem.c (ipa_tm_insert_irr_call): Do not pass frequency. (ipa_tm_insert_gettmclone_call): Do not pass frequency. * tree-cfg.c (execute_fixup_cfg): Drop profile to global0 if needed. * tree-chkp.c (chkp_copy_bounds_for_assign): Do not pass frequency. * tree-emutls.c (gen_emutls_addr): Do not pass frequency. * tree-inline.c (copy_bb): Do not scale frequency. (expand_call_inline): Do not scale frequency. (tree_function_versioning): Do not scale frequency. * ubsan.c (ubsan_create_edge): Do not pass frequency. lto/ChangeLog: 2017-11-10 Jan Hubicka <hubicka@ucw.cz> * lto-partition.c (lto_balanced_map): Use frequency accessor. From-SVN: r254636
2017-10-13* lto-lang.c (lto_post_options): Clean shlib flag when not doing PIC.Jan Hubicka2-0/+6
From-SVN: r253729
2017-10-11[PATCH] DECL_ASSEMBLER_NAME and friendsNathan Sidwell2-2/+8
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00582.html * tree.h (DECL_ASSEMBLER_NAME_RAW): New. (SET_DECL_ASSEMBLER_NAME): Use it. (DECL_ASSEMBLER_NAME_SET_P): Likewise. (COPY_DECL_ASSEMBLER_NAME): Likewise. * tree.c (decl_assembler_name): Use DECL_ASSEMBLER_NAME_RAW. lto/ * lto.c (mentions_vars_p_decl_with_vis): Use DECL_ASSEMBLER_NAME_RAW. (lto_fixup_prevailing_decls): Likewise. cp * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW. (record_mangling): Likewise. From-SVN: r253647
2017-10-10Require wi::to_wide for treesRichard Sandiford2-1/+6
The wide_int routines allow things like: wi::add (t, 1) to add 1 to an INTEGER_CST T in its native precision. But we also have: wi::to_offset (t) // Treat T as an offset_int wi::to_widest (t) // Treat T as a widest_int Recently we also gained: wi::to_wide (t, prec) // Treat T as a wide_int in preccision PREC This patch therefore requires: wi::to_wide (t) when operating on INTEGER_CSTs in their native precision. This is just as efficient, and makes it clearer that a deliberate choice is being made to treat the tree as a wide_int in its native precision. This also removes the inconsistency that a) INTEGER_CSTs in their native precision can be used without an accessor but must use wi:: functions instead of C++ operators b) the other forms need an explicit accessor but the result can be used with C++ operators. It also helps with SVE, where there's the additional possibility that the tree could be a runtime value. 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * wide-int.h (wide_int_ref_storage): Make host_dependent_precision a template parameter. (WIDE_INT_REF_FOR): Update accordingly. * tree.h (wi::int_traits <const_tree>): Delete. (wi::tree_to_widest_ref, wi::tree_to_offset_ref): New typedefs. (wi::to_widest, wi::to_offset): Use them. Expand commentary. (wi::tree_to_wide_ref): New typedef. (wi::to_wide): New function. * calls.c (get_size_range): Use wi::to_wide when operating on trees as wide_ints. * cgraph.c (cgraph_node::create_thunk): Likewise. * config/i386/i386.c (ix86_data_alignment): Likewise. (ix86_local_alignment): Likewise. * dbxout.c (stabstr_O): Likewise. * dwarf2out.c (add_scalar_info, gen_enumeration_type_die): Likewise. * expr.c (const_vector_from_tree): Likewise. * fold-const-call.c (host_size_t_cst_p, fold_const_call_1): Likewise. * fold-const.c (may_negate_without_overflow_p, negate_expr_p) (fold_negate_expr_1, int_const_binop_1, const_binop) (fold_convert_const_int_from_real, optimize_bit_field_compare) (all_ones_mask_p, sign_bit_p, unextend, extract_muldiv_1) (fold_div_compare, fold_single_bit_test, fold_plusminus_mult_expr) (pointer_may_wrap_p, expr_not_equal_to, fold_binary_loc) (fold_ternary_loc, multiple_of_p, fold_negate_const, fold_abs_const) (fold_not_const, round_up_loc): Likewise. * gimple-fold.c (gimple_fold_indirect_ref): Likewise. * gimple-ssa-warn-alloca.c (alloca_call_type_by_arg): Likewise. (alloca_call_type): Likewise. * gimple.c (preprocess_case_label_vec_for_gimple): Likewise. * godump.c (go_output_typedef): Likewise. * graphite-sese-to-poly.c (tree_int_to_gmp): Likewise. * internal-fn.c (get_min_precision): Likewise. * ipa-cp.c (ipcp_store_vr_results): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::ipa_polymorphic_call_context): Likewise. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise. (ipa_modify_call_arguments): Likewise. * match.pd: Likewise. * omp-low.c (scan_omp_1_op, lower_omp_ordered_clauses): Likewise. * print-tree.c (print_node_brief, print_node): Likewise. * stmt.c (expand_case): Likewise. * stor-layout.c (layout_type): Likewise. * tree-affine.c (tree_to_aff_combination): Likewise. * tree-cfg.c (group_case_labels_stmt): Likewise. * tree-data-ref.c (dr_analyze_indices): Likewise. (prune_runtime_alias_test_list): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-inline.c (remap_gimple_op_r, copy_tree_body_r): Likewise. * tree-predcom.c (is_inv_store_elimination_chain): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-scalar-evolution.c (iv_can_overflow_p): Likewise. (simple_iv_with_niters): Likewise. * tree-ssa-address.c (addr_for_mem_ref): Likewise. * tree-ssa-ccp.c (ccp_finalize, evaluate_stmt): Likewise. * tree-ssa-loop-ivopts.c (constant_multiple_of): Likewise. * tree-ssa-loop-niter.c (split_to_var_and_offset) (refine_value_range_using_guard, number_of_iterations_ne_max) (number_of_iterations_lt_to_ne, number_of_iterations_lt) (get_cst_init_from_scev, record_nonwrapping_iv) (scev_var_range_cant_overflow): Likewise. * tree-ssa-phiopt.c (minmax_replacement): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. * tree-ssa-sccvn.c (vn_reference_fold_indirect): Likewise. (vn_reference_maybe_forwprop_address, valueized_wider_op): Likewise. * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Likewise. * tree-ssa-uninit.c (is_pred_expr_subset_of): Likewise. * tree-ssanames.c (set_nonzero_bits, get_nonzero_bits): Likewise. * tree-switch-conversion.c (collect_switch_conv_info, array_value_type) (dump_case_nodes, try_switch_expansion): Likewise. * tree-vect-loop-manip.c (vect_gen_vector_loop_niters): Likewise. (vect_do_peeling): Likewise. * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise. * tree-vect-stmts.c (vectorizable_load): Likewise. * tree-vrp.c (compare_values_warnv, vrp_int_const_binop): Likewise. (zero_nonzero_bits_from_vr, ranges_from_anti_range): Likewise. (extract_range_from_binary_expr_1, adjust_range_with_scev): Likewise. (overflow_comparison_p_1, register_edge_assert_for_2): Likewise. (is_masked_range_test, find_switch_asserts, maybe_set_nonzero_bits) (vrp_evaluate_conditional_warnv_with_ops, intersect_ranges): Likewise. (range_fits_type_p, two_valued_val_range_p, vrp_finalize): Likewise. (evrp_dom_walker::before_dom_children): Likewise. * tree.c (cache_integer_cst, real_value_from_int_cst, integer_zerop) (integer_all_onesp, integer_pow2p, integer_nonzerop, tree_log2) (tree_floor_log2, tree_ctz, mem_ref_offset, tree_int_cst_sign_bit) (tree_int_cst_sgn, get_unwidened, int_fits_type_p): Likewise. (get_type_static_bounds, num_ending_zeros, drop_tree_overflow) (get_range_pos_neg): Likewise. * ubsan.c (ubsan_expand_ptr_ifn): Likewise. * config/darwin.c (darwin_mergeable_constant_section): Likewise. * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Likewise. * config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise. * config/avr/avr.c (avr_fold_builtin): Likewise. * config/bfin/bfin.c (bfin_local_alignment): Likewise. * config/msp430/msp430.c (msp430_attr): Likewise. * config/nds32/nds32.c (nds32_insert_attributes): Likewise. * config/powerpcspe/powerpcspe-c.c (altivec_resolve_overloaded_builtin): Likewise. * config/powerpcspe/powerpcspe.c (rs6000_aggregate_candidate) (rs6000_expand_ternop_builtin): Likewise. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Likewise. * config/rs6000/rs6000.c (rs6000_aggregate_candidate): Likewise. (rs6000_expand_ternop_builtin): Likewise. * config/s390/s390.c (s390_handle_hotpatch_attribute): Likewise. gcc/ada/ * gcc-interface/decl.c (annotate_value): Use wi::to_wide when operating on trees as wide_ints. gcc/c/ * c-parser.c (c_parser_cilk_clause_vectorlength): Use wi::to_wide when operating on trees as wide_ints. * c-typeck.c (build_c_cast, c_finish_omp_clauses): Likewise. (c_tree_equal): Likewise. gcc/c-family/ * c-ada-spec.c (dump_generic_ada_node): Use wi::to_wide when operating on trees as wide_ints. * c-common.c (pointer_int_sum): Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-warn.c (match_case_to_enum_1): Likewise. (c_do_switch_warnings): Likewise. (maybe_warn_shift_overflow): Likewise. gcc/cp/ * cvt.c (ignore_overflows): Use wi::to_wide when operating on trees as wide_ints. * decl.c (check_array_designated_initializer): Likewise. * mangle.c (write_integer_cst): Likewise. * semantics.c (cp_finish_omp_clause_depend_sink): Likewise. gcc/fortran/ * target-memory.c (gfc_interpret_logical): Use wi::to_wide when operating on trees as wide_ints. * trans-const.c (gfc_conv_tree_to_mpz): Likewise. * trans-expr.c (gfc_conv_cst_int_power): Likewise. * trans-intrinsic.c (trans_this_image): Likewise. (gfc_conv_intrinsic_bound): Likewise. (conv_intrinsic_cobound): Likewise. gcc/lto/ * lto.c (compare_tree_sccs_1): Use wi::to_wide when operating on trees as wide_ints. gcc/objc/ * objc-act.c (objc_decl_method_attributes): Use wi::to_wide when operating on trees as wide_ints. From-SVN: r253595
2017-08-30Add some changelog entries that went astray during the machmode commitsRichard Sandiford1-0/+6
From-SVN: r251529
2017-08-30[35/77] Add uses of as_a <scalar_int_mode>Richard Sandiford1-9/+9
This patch adds asserting as_a <scalar_int_mode> conversions to contexts in which the input is known to be a scalar integer mode. In expand_divmod, op1 is always a scalar_int_mode if op1_is_constant (but might not be otherwise). In expand_binop, the patch reverses a < comparison in order to avoid splitting a long line. gcc/ 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * cfgexpand.c (convert_debug_memory_address): Use as_a <scalar_int_mode>. * combine.c (expand_compound_operation): Likewise. (make_extraction): Likewise. (change_zero_ext): Likewise. (simplify_comparison): Likewise. * cse.c (cse_insn): Likewise. * dwarf2out.c (minmax_loc_descriptor): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. * expmed.c (init_expmed_one_mode): Likewise. (synth_mult): Likewise. (emit_store_flag_1): Likewise. (expand_divmod): Likewise. Use HWI_COMPUTABLE_MODE_P instead of a comparison with size. * expr.c (expand_assignment): Use as_a <scalar_int_mode>. (reduce_to_bit_field_precision): Likewise. * function.c (expand_function_end): Likewise. * internal-fn.c (expand_arith_overflow_result_store): Likewise. * loop-doloop.c (doloop_modify): Likewise. * optabs.c (expand_binop): Likewise. (expand_unop): Likewise. (expand_copysign_absneg): Likewise. (prepare_cmp_insn): Likewise. (maybe_legitimize_operand): Likewise. * recog.c (const_scalar_int_operand): Likewise. * rtlanal.c (get_address_mode): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. (simplify_cond_clz_ctz): Likewise. * tree-nested.c (get_nl_goto_field): Likewise. * tree.c (build_vector_type_for_mode): Likewise. * var-tracking.c (use_narrower_mode): Likewise. gcc/c-family/ 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * c-common.c (c_common_type_for_mode): Use as_a <scalar_int_mode>. gcc/lto/ 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * lto-lang.c (lto_type_for_mode): Use as_a <scalar_int_mode>. From-SVN: r251487
2017-08-21re PR go/78628 (GO fails to build a translation unit decl)Richard Biener2-13/+26
2017-08-21 Richard Biener <rguenther@suse.de> include/ * simple-object.h (simple_object_copy_lto_debug_sections): New function. libiberty/ * simple-object-common.h (struct simple_object_functions): Add copy_lto_debug_sections hook. * simple-object.c: Include fcntl.h. (handle_lto_debug_sections): New helper function. (simple_object_copy_lto_debug_sections): New function copying early LTO debug sections to regular debug sections in a new file. (simple_object_start_write): Handle NULL segment_name. * simple-object-coff.c (simple_object_coff_functions): Adjust for not implemented copy_lto_debug_sections hook. * simple-object-mach-o.c (simple_object_mach_o_functions): Likewise. * simple-object-xcoff.c (simple_object_xcoff_functions): Likewise. * simple-object-elf.c (SHT_NULL, SHT_SYMTAB, SHT_RELA, SHT_REL, SHT_GROUP): Add various sectopn header types. (SHF_EXCLUDE): Add flag. (Elf32_External_Sym, Elf64_External_Sym): Add symbol struct. (ELF_ST_BIND, ELF_ST_TYPE, ELF_ST_INFO): Add accessors. (STT_OBJECT, STT_FUNC, STT_TLS, STT_GNU_IFUNC): Add Symbol types. (STV_DEFAULT): Add symbol visibility. (SHN_COMMON): Add special section index name. (struct simple_object_elf_write): New. (simple_object_elf_start_write): Adjust for new private data. (simple_object_elf_write_shdr): Pass in values for all fields we write. (simple_object_elf_write_to_file): Adjust. Copy from recorded section headers if requested. (simple_object_elf_release_write): Release private data. (simple_object_elf_copy_lto_debug_sections): Copy and rename sections as denoted by PFN and all their dependences, symbols and relocations to the empty destination file. (simple_object_elf_functions): Adjust for copy_lto_debug_sections hook. gcc/ * debug.h (struct gcc_debug_hooks): Add die_ref_for_decl and register_external_die hooks. (debug_false_tree_charstarstar_uhwistar): Declare. (debug_nothing_tree_charstar_uhwi): Likewise. * debug.c (do_nothing_debug_hooks): Adjust. (debug_false_tree_charstarstar_uhwistar): New do nothing. (debug_nothing_tree_charstar_uhwi): Likewise. * dbxout.c (dbx_debug_hooks): Adjust. (xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dwarf2out.c (macinfo_label_base): New global. (dwarf2out_register_external_die): New function for the register_external_die hook. (dwarf2out_die_ref_for_decl): Likewise for die_ref_for_decl. (dwarf2_debug_hooks): Use them. (dwarf2_lineno_debug_hooks): Adjust. (struct die_struct): Add with_offset flag. (DEBUG_LTO_DWO_INFO_SECTION, DEBUG_LTO_INFO_SECTION, DEBUG_LTO_DWO_ABBREV_SECTION, DEBUG_LTO_ABBREV_SECTION, DEBUG_LTO_DWO_MACINFO_SECTION, DEBUG_LTO_MACINFO_SECTION, DEBUG_LTO_DWO_MACRO_SECTION, DEBUG_LTO_MACRO_SECTION, DEBUG_LTO_LINE_SECTION, DEBUG_LTO_DWO_STR_OFFSETS_SECTION, DEBUG_LTO_STR_DWO_SECTION, DEBUG_STR_LTO_SECTION): New macros defining section names for the early LTO debug variants. (reset_indirect_string): New helper. (add_AT_external_die_ref): Helper for dwarf2out_register_external_die. (print_dw_val): Add support for offsetted symbol references. (get_ultimate_context): Split out from is_cxx. (is_cxx): Use get_ultimate_context. (is_fortran): Add decl overload. (compute_comp_unit_symbol): Split out worker from compute_section_prefix. (compute_section_prefix): Call compute_comp_unit_symbol and set comdat_type_p here. (output_die): Skip DIE symbol output for the LTO added one. Handle DIE symbol references with offset. (output_comp_unit): Guard section name mangling properly. For LTO debug sections emit a symbol at the section beginning which we use to refer to its DIEs. (add_abstract_origin_attribute): For DIEs registered via dwarf2out_register_external_die directly refer to the early DIE rather than indirectly through the shadow one we created. Remove obsolete call to dwarf2out_abstract_function for non-function/block origins. (gen_array_type_die): When generating early LTO debug do not emit DW_AT_string_length. (gen_formal_parameter_die): Do not re-create DIEs for PARM_DECLs late when in LTO. As suggested place a gcc_unreachable for the DECL_ABSTRACT_P case. (gen_subprogram_die): Avoid another specification DIE for early built declarations/definitions for the late LTO case. (gen_variable_die): Add type references for late duplicated VLA dies when in late LTO. (gen_inlined_subroutine_die): Do not call dwarf2out_abstract_function, we have the abstract instance already. (process_scope_var): Adjust decl DIE contexts in LTO which first puts them in limbo. (gen_decl_die): Do not generate type DIEs late apart from types for VLAs or for decls we do not yet have a DIE. Do not call dwarf2out_abstract_function late. (dwarf2out_early_global_decl): Make sure to create DIEs for abstract instances of a decl first. (dwarf2out_late_global_decl): Adjust comment. (output_macinfo_op): With multiple macro sections use macinfo_label_base to distinguish labels. (output_macinfo): Likewise. Update macinfo_label_base. Pass in the line info label. (note_variable_value_in_expr): When generating LTO resolve all variable values here by generating DIEs as needed. (init_sections_and_labels): Add early LTO debug flag parameter and generate different sections and names if set. Add generation counter for the labels so we can have multiple of them. (reset_dies): Helper to allow DIEs to be output multiple times. (dwarf2out_finish): When outputting DIEs to the fat part of an LTO object first reset DIEs. (dwarf2out_early_finish): Output early DIEs when generating LTO. (modified_type_die): Check for decl_ultimate_origin being self before recursing. (gen_type_die_with_usage): Likewise. (gen_typedef_die): Allow decl_ultimate_origin being self. (set_decl_abstract_flags): Remove. (set_block_abstract_flags): Likewise. (dwarf2out_abstract_function): Treat the early generated DIEs as the abstract copy and only add DW_AT_inline and DW_AT_artificial here and call set_decl_origin_self. If the DIE has an abstract origin don't do anything. * tree.c (free_lang_data): Build a dummy TRANSLATION_UNIT_DECL if we have none yet (Go fails to build one, PR78628). (variably_modified_type_p): Prevent endless recursion for Ada cyclic pointer types. * lto-streamer-in.c: Include debug.h. (dref_queue): New global. (lto_read_tree_1): Stream in DIE references. (lto_input_tree): Register DIE references. (input_function): Stream DECL_DEBUG_ARGS. * lto-streamer-out.c: Include debug.h. (lto_write_tree_1): Output DIE references. (DFS::DFS_write_tree_body): Follow DECL_ABSTRACT_ORIGIN. Force a TRANSLATION_UNIT_DECL DECL_CONTEXT for file-scope decls. (output_function): Stream DECL_DEBUG_ARGS. * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers): Stream DECL_ABSTRACT_ORIGIN. * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise. (write_ts_decl_minimal_tree_pointers): Force a TRANSLATION_UNIT_DECL DECL_CONTEXT for file-scope decls. * lto-streamer.h (struct dref_entry): Declare. (dref_queue): Likewise. * cfgexpand.c (pass_expand::execute): Do not call the outlining_inline_function hook here. * lto-wrapper.c (debug_obj): New global. (tool_cleanup): Unlink it if required. (debug_objcopy): New function. (run_gcc): Handle early debug sections in the IL files by extracting them to separate files, partially linkin them and feeding the result back as result to the linker. * config/darwin.h (DEBUG_LTO_INFO_SECTION, DEBUG_LTO_ABBREV_SECTION, DEBUG_LTO_MACINFO_SECTION, DEBUG_LTO_LINE_SECTION, DEBUG_STR_LTO_SECTION, DEBUG_LTO_MACRO_SECTION): Put early debug sections into a separate segment. * config/darwin.c (darwin_asm_named_section): Handle __GNU_DWARF_LTO segments. (darwin_asm_dwarf_section): Likewise. (darwin_asm_output_dwarf_offset): Likewise. * config/i386/i386.c (make_resolver_func): Set DECL_IGNORED_P. lto/ * lto.c (unify_scc): Truncate DIE reference queue for dropped SCCs. (lto_read_decls): Process TRANSLATION_UNIT_DECLs. Remove TYPE_DECL debug processing, register DIE references from prevailing SCCs with the debug machinery. (lto_section_with_id): Handle LTO debug sections. libstdc++/ * testsuite/libstdc++-prettyprinters/prettyprinters.exp: Run all tests with -flto as well if supported. testsuite/ * c-c++-common/asan/global-overflow-1.c: Adjust diagnostic location regex to handle the LTO case. * c-c++-common/asan/heap-overflow-1.c: Likewise. * c-c++-common/asan/misalign-1.c: Likewise. * c-c++-common/asan/misalign-2.c: Likewise. * c-c++-common/asan/null-deref-1.c: Likewise. * c-c++-common/asan/stack-overflow-1.c: Likewise. * c-c++-common/asan/strncpy-overflow-1.c: Likewise. * c-c++-common/asan/use-after-free-1.c: Likewise. * c-c++-common/asan/alloca_big_alignment.c: Likewise. * c-c++-common/asan/alloca_detect_custom_size.c: Likewise. * c-c++-common/asan/alloca_overflow_partial.c: Likewise. * c-c++-common/asan/alloca_overflow_right.c: Likewise. * c-c++-common/asan/alloca_underflow_left.c: Likewise. * g++.dg/asan/large-func-test-1.C: Likewise. * gfortran.dg/save_6.f90: Add -flto -g variant of save_5.f90. From-SVN: r251220
2017-08-16tree-core.h (tree_type_non_common): Rename binfo to lang_1.Nathan Sidwell2-3/+8
* tree-core.h (tree_type_non_common): Rename binfo to lang_1. * tree.h (TYPE_BINFO): Use type_non_common.maxval. (TYPE_LANG_SLOT_1): Use type_non_common.lang_1, for any type. * tree.c (free_lang_data_in_type): Use else-if chain. Always clear TYPE_LANG_1. Remove obsolete member-function stripping. (find_decls_types_r): Comment about TYPE_MAX_VALUES_RAW. (verify_type): Adjust for TYPE_BINFO move. * lto-streamer-out.c (DFS::DFS_write_tree_body): No need to process TYPE_BINFO directly. (hash_tree): Likewise. * tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_type_non_common_tree_pointers): Likewise. lto/ * lto.c (mentions_vars_p_type): Use TYPE_LANG_SLOT_1. (compare_tree_sccs_1): No need to compare TYPE_BINFO directly. (lto_fixup_prevailing_decls): Use TYPE_LANG_SLOT_1. From-SVN: r251129
2017-08-08Add missing include of attribs.h in lto.cTom de Vries2-0/+5
2017-08-08 Tom de Vries <tom@codesourcery.com> * lto.c: Include attribs.h. From-SVN: r250949
2017-08-08trans.c: Include header files.Martin Liska3-0/+9
. 2017-08-08 Martin Liska <mliska@suse.cz> * gcc-interface/trans.c: Include header files. 2017-08-08 Martin Liska <mliska@suse.cz> * objc-gnu-runtime-abi-01.c: Include header files. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * asan.c: Include header files. * attribs.c (build_decl_attribute_variant): New function moved from tree.[ch]. (build_type_attribute_qual_variant): Likewise. (cmp_attrib_identifiers): Likewise. (simple_cst_list_equal): Likewise. (omp_declare_simd_clauses_equal): Likewise. (attribute_value_equal): Likewise. (comp_type_attributes): Likewise. (build_type_attribute_variant): Likewise. (lookup_ident_attribute): Likewise. (remove_attribute): Likewise. (merge_attributes): Likewise. (merge_type_attributes): Likewise. (merge_decl_attributes): Likewise. (merge_dllimport_decl_attributes): Likewise. (handle_dll_attribute): Likewise. (attribute_list_equal): Likewise. (attribute_list_contained): Likewise. * attribs.h (lookup_attribute): New function moved from tree.[ch]. (lookup_attribute_by_prefix): Likewise. * bb-reorder.c: Include header files. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * convert.c: Likewise. * dwarf2out.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimplify.c: Likewise. * hsa-common.c: Likewise. * hsa-gen.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * lto-cgraph.c: Likewise. * omp-expand.c: Likewise. * omp-general.c: Likewise. * omp-low.c: Likewise. * omp-offload.c: Likewise. * omp-simd-clone.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * sancov.c: Likewise. * sanopt.c: Likewise. * symtab.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-chkp.c: Likewise. * tree-eh.c: Likewise. * tree-into-ssa.c: Likewise. * tree-object-size.c: Likewise. * tree-parloops.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * tree.c: Remove functions moved to attribs.[ch]. * tree.h: Likewise. * config/aarch64/aarch64.c: Add attrs.h header file. * 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/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.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/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-isr.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/powerpcspe/powerpcspe.c: Likewise. * config/riscv/riscv.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.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/visium/visium.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * call.c: Include header files. * cp-gimplify.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * init.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * lto-lang.c: Include header files. * lto-symtab.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-convert.c: Include header files. * c-typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-ada-spec.c: Include header files. * c-ubsan.c: Likewise. * c-warn.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * trans-types.c: Include header files. From-SVN: r250946
2017-08-03lto-symtab.h (lto_symtab_prevail_decl): Do not use DECL_ABSTRACT_ORIGIN as ↵Richard Biener2-4/+11
flag we can end up using that. 2017-08-03 Richard Biener <rguenther@suse.de> * lto-symtab.h (lto_symtab_prevail_decl): Do not use DECL_ABSTRACT_ORIGIN as flag we can end up using that. Instead use DECL_LANG_FLAG_0. (lto_symtab_prevail_decl): Likewise. From-SVN: r250856
2017-07-25c-attribs.c (c_common_attribute_table): Add entry for ↵Torsten Duwe2-0/+17
"patchable_function_entry". 2017-07-07 Torsten Duwe <duwe@suse.de> c-family/ * c-attribs.c (c_common_attribute_table): Add entry for "patchable_function_entry". lto/ * lto-lang.c (lto_attribute_table): Add entry for "patchable_function_entry". * common.opt: Introduce -fpatchable-function-entry command line option, and its variables function_entry_patch_area_size and function_entry_patch_area_start. * opts.c (common_handle_option): Add -fpatchable_function_entry_ case, including a two-value parser. * target.def (print_patchable_function_entry): New target hook. * targhooks.h (default_print_patchable_function_entry): New function. * targhooks.c (default_print_patchable_function_entry): Likewise. * toplev.c (process_options): Switch off IPA-RA if patchable function entries are being generated. * varasm.c (assemble_start_function): Look at the patchable-function-entry command line switch and current function attributes and maybe generate NOP instructions by calling the print_patchable_function_entry hook. * doc/extend.texi: Document patchable_function_entry attribute. * doc/invoke.texi: Document -fpatchable_function_entry command line option. * doc/tm.texi.in (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): New target hook. * doc/tm.texi: Re-generate. * c-c++-common/patchable_function_entry-default.c: New test. * c-c++-common/patchable_function_entry-decl.c: Likewise. * c-c++-common/patchable_function_entry-definition.c: Likewise. From-SVN: r250521
2017-07-19tree.h (TYPE_MINVAL, [...]): Rename to ...Nathan Sidwell2-6/+12
gcc/ * tree.h (TYPE_MINVAL, TYPE_MAXVAL): Rename to ... (TYPE_MIN_VALUE_RAW, TYPE_MAX_VALUE_RAW): ... these. * tree.c (find_decls_types_r, verify_type): Use TYPE_{MIN,MAX}_VALUE_RAW. * lto-streamer-out.c (DFS::DFS_write_tree_body): Likewise. (hash_tree): Likewise. * tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_type_non_common_tree_pointers): Likewise. gcc/cp/ * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS, PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW. gcc/lto/ * lto.c (mentions_vars_p_type): Use TYPE_{MIN,MAX}_VALUE_RAW. (compare_tree_sccs_1, lto_fixup_prevailing_decls): Likewise. gcc/objc/ * objc-act.h (CLASS_NST_METHODS, CLASS_CLS_METHODS): Use TYPE_{MIN,MAX}_VALUE_RAW. From-SVN: r250337
2017-07-06cgraphunit.c (cgraph_node::finalize_function): When !flag_toplevel_reorde ↵Jan Hubicka2-13/+14
set no_reorder flag. * cgraphunit.c (cgraph_node::finalize_function): When !flag_toplevel_reorde set no_reorder flag. (varpool_node::finalize_decl): Likewise. (symbol_table::compile): Drop no toplevel reorder path. * lto-partition.c (lto_balanced_map): Do not check flag_toplevel_reorder. From-SVN: r250034
2017-06-23Refactor fileptr_type_node handlingMarc Glisse2-7/+15
2017-06-23 Marc Glisse <marc.glisse@inria.fr> gcc/ * tree.h (builtin_structptr_type): New type. (builtin_structptr_types): Declare new array. * tree.c (builtin_structptr_types): New array. (free_lang_data, build_common_tree_nodes): Use it. gcc/c-family/ * c-common.c (c_common_nodes_and_builtins): Use builtin_structptr_types. gcc/cp/ * decl.c (duplicate_decls): Use builtin_structptr_types. gcc/lto/ * lto-lang.c (lto_init): Use builtin_structptr_types. From-SVN: r249585
2017-06-15Revert accidental checkin.Jan Hubicka1-1/+1
From-SVN: r249225
2017-06-15re PR lto/69866 (lto1: internal compiler error: in ↵Jan Hubicka3-1/+44
add_symbol_to_partition_1, at lto/lto-partition.c:158) PR lto/69866 * lto-symtab.c (lto_symtab_merge_symbols): Drop useless definitions that resolved externally. * gcc.dg/lto/pr69866_0.c: New test. * gcc.dg/lto/pr69866_1.c: Likewise. From-SVN: r249224
2017-05-23cgraphunit.c (symbol_table::process_new_functions): Update.Jan Hubicka2-1/+6
* cgraphunit.c (symbol_table::process_new_functions): Update. * ipa-fnsummary.c (pass_data_inline_parameters): Remove. (inline_generate_summary): Rename to ... (ipa_fn_summary_generate): ... this one. (inline_read_summary): Rename to ... (ipa_fn_summary_read): ... this one. (inline_write_summary): Rename to ... (ipa_fn_summary_write): ... this one. (inline_free_summary): Rename to ... (ipa_free_fn_summary): ... this one. (pass_data_local_fn_summary, pass_local_fn_summary, make_pass_local_fn_summary, pass_data_ipa_free_fn_summary, pass_ipa_free_fn_summary, make_pass_ipa_free_fn_summary, pass_data_ipa_fn_summary, pass_ipa_fn_summary, make_pass_ipa_fn_summary): New. * ipa-fnsummary.h (inline_generate_summary, inline_read_summary, inline_write_summary, inline_free_summary): Remove. (ipa_free_fn_summary) : New. * ipa-inline.c (ipa_inline): Update. (pass_ipa_inline): Do not generate summaries. * ipa.c (pass_data_ipa_free_fn_summary, pass_ipa_free_fn_summary): Remove. * passes.def: Replace pass_inline_parameters by pass_local_fn_summary and add pass_ipa_fn_summary. * tree-pass.h (make_pass_ipa_fn_summary, make_pass_local_fn_summary): New. (make_pass_inline_parameters): Remove. * lto.c (do_whole_program_analysis): Replace inline_free_summary by ipa_free_fn_summary. * gcc.dg/ipa/ctor-empty-1.c: Update template. * gcc.dg/ipa/inline-5.c: Likewise. * gfortran.dg/pr48636.f90: Likewise. From-SVN: r248375
2017-05-23Introduce symtab_node::dump_{asm_,}name functions.Martin Liska2-4/+10
2017-05-23 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_node::get_create): Use symtab_node::dump_{asm_,}name functions. (cgraph_edge::make_speculative): Likewise. (cgraph_edge::resolve_speculation): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. (cgraph_node::dump): Likewise. * cgraph.h: Likewise. * cgraphunit.c (analyze_functions): Likewise. (symbol_table::compile): Likewise. * ipa-cp.c (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (ipcp_verify_propagated_values): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. (ipcp_store_bits_results): Likewise. * ipa-devirt.c (dump_targets): Likewise. (ipa_devirt): Likewise. * ipa-icf.c (sem_item::dump): Likewise. (sem_function::equals): Likewise. (sem_variable::equals): Likewise. (sem_item_optimizer::read_section): Likewise. (sem_item_optimizer::execute): Likewise. (congruence_class::dump): Likewise. * ipa-inline-analysis.c (dump_ipa_call_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline-transform.c (inline_call): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_print_node_jump_functions): Likewise. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (ipa_impossible_devirt_target): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Likewise. (ipcp_transform_function): Likewise. * ipa-pure-const.c (pure_const_read_summary): Likewise. (propagate_pure_const): Likewise. * ipa-reference.c (generate_summary): Likewise. (read_write_all_from_decl): Likewise. (propagate): Likewise. (ipa_reference_read_optimization_summary): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * passes.c (execute_todo): Likewise. * predict.c (drop_profile): Likewise. * symtab.c (symtab_node::get_dump_name): New function. (symtab_node::dump_name): Likewise. (symtab_node::dump_asm_name): Likewise. (symtab_node::dump_references): Likewise. (symtab_node::dump_referring): Likewise. (symtab_node::dump_base): Likewise. (symtab_node::debug_symtab): Likewise. * tree-sra.c (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. * value-prof.c (init_node_map): Likewise. 2017-05-23 Martin Liska <mliska@suse.cz> * lto-symtab.c (lto_cgraph_replace_node): Use symtab_node::dump_{asm_,}name functions. * lto.c (read_cgraph_and_symbols): Likewise. (do_whole_program_analysis): Likewise. From-SVN: r248369
2017-05-23Move symtab_node::dump_table to symbol_table::dumpMartin Liska2-3/+8
2017-05-23 Martin Liska <mliska@suse.cz> * cgraph.h: Move symtab_node::dump_table to symbol_table::dump and symtab_node::debug_symtab to symbol_table::debug. * cgraphunit.c (analyze_functions): Use the renamed function. (symbol_table::compile): Likewise. * ipa-cp.c (ipcp_verify_propagated_values): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. * passes.c (execute_todo): Likewise. * symtab.c (symbol_table::dump): New function. * tree-ssa-structalias.c (ipa_pta_execute): Use the renamed function. 2017-05-23 Martin Liska <mliska@suse.cz> * lto.c (read_cgraph_and_symbols): Use the renamed function. (do_whole_program_analysis): Use the renamed function. From-SVN: r248368
2017-05-23ipa-inline-analysis.c (cgraph_2edge_hook_list, [...]): Remove.Jan Hubicka1-5/+5
* ipa-inline-analysis.c (cgraph_2edge_hook_list, cgraph_edge_hook_list, inline_edge_removal_hook, inline_edge_duplication_hook): Remove. (inline_edge_summary_vec): Turn into ... (ipa_call_summaries): ... this one. (redirect_to_unreachable, edge_set_predicate, evaluate_properties_for_edge, inline_summary_alloc, reset_ipa_call_summary, reset_inline_summary, inline_summary_t::duplicate): Update. (inline_edge_duplication_hook): Turn to ... (ipa_call_summary_t::duplicate): ... this one. (inline_edge_removal_hook): Turn to ... (ipa_call_summary_t::remove): ... this one. (dump_inline_edge_summary): Turn to ... (dump_ipa_call_summary): ... this one. (estimate_function_body_sizes): Update. (inline_update_callee_summaries): Update. (remap_edge_change_prob): Update. (remap_edge_summaries): Update. (inline_merge_summary): Update. (do_estimate_edge_time): Update. (inline_generate_summary): Update. (inline_read_section): Update. (inline_read_summary): Update. (inline_free_summary): Update. * ipa-inline.c (can_inline_edge_p): Update. (compute_inlined_call_time): Update. (want_inline_small_function_p): Update. (edge_badness): Update. (early_inliner): Update. * ipa-inline.h (inline_edge_summary): Turn to ... (ipa_call_summary): ... this one. (ipa_call_summary_t): New class. (inline_edge_summary_t, inline_edge_summary_vec): Remove. (ipa_call_summaries): New. (inline_edge_summary): Remove. (estimate_edge_growth): Update. * ipa-profile.c (ipa_propagate_frequency_1): Update. * ipa-prop.c (ipa_make_edge_direct_to_target): Update. * ipa-split.c (execute_split_functions): Update. * ipa.c (symbol_table::remove_unreachable_nodes): Update. From-SVN: r248365
2017-05-22Makefile.in: Add ipa-fnsummary.o and ipa-fnsummary.hJan Hubicka3-2/+7
* Makefile.in: Add ipa-fnsummary.o and ipa-fnsummary.h * auto-profile.c: Replace ipa-inline.h by ipa-fnsummary.h * cgraph.c: Likewise. * cgraphunit.c: Likewise. * gengtype.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-predicate.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * ipa-inline-analysis.c (inline_summaries, ipa_call_summaries, edge_predicate_pool, dump_inline_hints, inline_summary::account_size_time, redirect_to_unreachable, edge_set_predicate, set_hint_predicate, evaluate_conditions_for_known_args, evaluate_properties_for_edge, inline_summary_alloc, ipa_call_summary::reset, inline_summary::reset, inline_summary_t::remove, remap_hint_predicate_after_duplication, inline_summary_t::duplicate, ipa_call_summary_t::duplicate, ipa_call_summary_t::remove, initialize_growth_caches, free_growth_caches, dump_ipa_call_summary, dump_inline_summary, debug_inline_summary, dump_inline_summaries, initialize_inline_failed, mark_modified, unmodified_parm_1, unmodified_parm, unmodified_parm_or_parm_agg_item, eliminated_by_inlining_prob, set_cond_stmt_execution_predicate, set_switch_stmt_execution_predicate, compute_bb_predicates, will_be_nonconstant_expr_predicate, will_be_nonconstant_predicate, record_modified_bb_info, get_minimal_bb, record_modified, param_change_prob, phi_result_unknown_predicate, predicate_for_phi_result, array_index_predicate, clobber_only_eh_bb_p, fp_expression_p, estimate_function_body_sizes, compute_inline_parameters, compute_inline_parameters_for_curren, pass_data_inline_parameters, estimate_node_size_and_time, estimate_ipcp_clone_size_and_time, inline_update_callee_summaries, remap_edge_change_prob, remap_edge_summaries, remap_hint_predicate, inline_merge_summary, inline_update_overall_summary, inline_indirect_intraprocedural_analysis, inline_analyze_function, inline_summary_t::insert, inline_generate_summary, read_ipa_call_summary, inline_read_section, inline_read_summary, write_ipa_call_summary, inline_write_summary, inline_free_summary): Move to ipa-fnsummary.h (predicate_t): Remove. * ipa-fnsummary.c: New file. * ipa-inline.h: Do not include sreal.h and ipa-predicate.h (enum inline_hints_vals, inline_hints, agg_position_info, INLINE_SIZE_SCALE, size_time_entry, inline_summary, inline_summary_t, inline_summaries, ipa_call_summary, ipa_call_summary_t, ipa_call_summaries, debug_inline_summary, dump_inline_summaries, dump_inline_summary, dump_inline_hints, inline_generate_summary, inline_read_summary, inline_write_summary, inline_free_summary, inline_analyze_function, initialize_inline_failed, inline_merge_summary, inline_update_overall_summary, compute_inline_parameters): Move to ipa-fnsummary.h * ipa-fnsummary.h: New file. * ipa-inline-transform.h: Include ipa-inline.h. * ipa-inline.c: LIkewise. * lto.c: Replace ipa-inline.h by ipa-fnsummary.h * lto-partition.c: Replace ipa-inline.h by ipa-fnsummary.h From-SVN: r248336
2017-05-01re PR c++/80038 (Random segfault using local vectors in Cilk function)Xi Ruoyao2-3/+8
2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn> PR c++/80038 * cilk_common.c (expand_builtin_cilk_detach): Move pedigree operations here. * gimplify.c (gimplify_cilk_detach): New function. (gimplify_call_expr, gimplify_modify_expr): Call it as needed. * tree-core.h: Document EXPR_CILK_SPAWN. * tree.h (EXPR_CILK_SPAWN): Define. PR c++/80038 * c-common.h (cilk_gimplify_call_params_in_spawned_fn): Remove prototype. (cilk_install_body_pedigree_operations): Likewise. * cilk.c (cilk_set_spawn_marker): Mark functions that should be detatched. (cilk_gimplify_call_params_in_spawned_fn): Remove. (cilk_install_body_pedigree_operations): Likewise. (gimplify_cilk_spawn): Add EXPR_STMT and CLEANUP_POINT_EXPR unwrapping. PR c++/80038 * c-gimplify.c (c_gimplify_expr): Remove calls to cilk_gimplifY_call_params_in_spawned_fn. PR c++/80038 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't add pedigree operation and detach call here. * cp-gimplify.c (cp_gimplify_expr): Remove the calls to cilk_cp_gimplify_call_params_in_spawned_fn. (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function. * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN. PR c++/80038 * lto-lang.c (lto_init): Set in_lto_p earlier. PR c++/80038 * g++.dg/cilk-plus/CK/pr80038.cc: New test. From-SVN: r247446
2017-04-12re PR target/79671 (mapnik miscompilation on armv7hl since r235622)Richard Biener2-0/+8
2017-04-12 Richard Biener <rguenther@suse.de> Bernd Edlinger <bernd.edlinger@hotmail.de> PR middle-end/79671 * alias.c (component_uses_parent_alias_set_from): Handle TYPE_TYPELESS_STORAGE. (get_alias_set): Likewise. * tree-core.h (tree_type_common): Add typeless_storage flag. * tree.h (TYPE_TYPELESS_STORAGE): New macro. * stor-layout.c (place_union_field): Set TYPE_TYPELESS_STORAGE for types containing members with TYPE_TYPELESS_STORAGE. (place_field): Likewise. (layout_type): Likewise for ARRAY_TYPE. * lto-streamer-out.c (hash_tree): Hash TYPE_TYPELESS_STORAGE. * tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream TYPE_TYPELESS_STORAGE. * tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise. lto/ * lto.c (compare_tree_sccs_1): Compare TYPE_TYPELESS_STORAGE. cp/ * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE for arrays of character or std::byte type. * g++.dg/torture/pr79671.C: New testcase. * g++.dg/lto/pr79671_0.C: Likewise. * g++.dg/lto/pr79671_1.c: Likewise. Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de> From-SVN: r246866
2017-02-14Fix memory leak in LTOMartin Liska2-0/+6
2017-02-14 Martin Liska <mliska@suse.cz> * lto.c (do_stream_out): Free LTO file filename string. From-SVN: r245431
2017-01-23re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: ↵Maxim Ostapenko2-13/+1
initialization-order-fiasco") Revert fix for PR lto/79061 due to this regresses compile-time by 100% on some fortran cases. From-SVN: r244773
2017-01-19Make LTO's implementation of LANG_HOOKS_TYPE_FOR_SIZE the defaultDavid Malcolm2-55/+9
gcc/jit/ChangeLog: * dummy-frontend.c (jit_langhook_type_for_size): Delete. (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine. gcc/ChangeLog: * langhooks-def.h (lhd_type_for_size): New decl. (LANG_HOOKS_TYPE_FOR_SIZE): Define as lhd_type_for_size. * langhooks.c (lhd_type_for_size): New function, taken from lto_type_for_size. gcc/lto/ChangeLog: * lto-lang.c (builtin_type_for_size): Convert call to lto_type_for_size to one through the langhook. (lto_type_for_size): Move to langhooks.c and rename to lhd_type_for_size. (LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine. From-SVN: r244646
2017-01-18re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: ↵Maxim Ostapenko2-1/+13
initialization-order-fiasco") PR lto/79061 gcc/ * asan.c (get_translation_unit_decl): New function. (asan_add_global): Extract modules file name from globals TRANSLATION_UNIT_DECL in lto mode. * tree.c (build_translation_unit_decl): Add source location for newly built TRANSLATION_UNIT_DECL. gcc/lto/ * lto.c (lto_read_decls): accept location cache for TRANSLATION_UNIT_DECL. gcc/testsuite/ * gcc.dg/cpp/mi1.c: Adjust testcase. * gcc.dg/pch/cpp-3.c: Likewise. From-SVN: r244581
2017-01-11re PR middle-end/50199 (wrong code with -flto -fno-merge-constants)Jakub Jelinek2-0/+12
PR middle-end/50199 * lto-lang.c (lto_post_options): Force flag_merge_constants = 1 if it was 0. * gcc.dg/lto/pr50199_0.c: New test. From-SVN: r244304
2017-01-09re PR translation/79019 (translatable string typo in cif-code.def:141)Jakub Jelinek2-1/+7
PR translation/79019 PR translation/79020 * params.def (PARAM_INLINE_MIN_SPEEDUP, PARAM_IPA_CP_SINGLE_CALL_PENALTY, PARAM_USE_AFTER_SCOPE_DIRECT_EMISSION_THRESHOLD): Fix typos in descriptions. * config/avr/avr.opt (maccumulate-args): Likewise. * config/msp430/msp430.opt (mwarn-mcu): Likewise. * common.opt (freport-bug): Likewise. * cif-code.def (CIF_FINAL_ERROR): Likewise. * doc/invoke.texi (ipa-cp-single-call-penalty): Likewise. * config/s390/s390.c (s390_invalid_binary_op): Fix spelling in translatable string. * config/i386/i386.c (function_value_32): Likewise. * config/nios2/nios2.c (nios2_valid_target_attribute_rec): Likewise. * config/msp430/msp430.c (msp430_option_override, msp430_attr): Likewise. * config/msp430/driver-msp430.c (msp430_select_hwmult_lib): Likewise. * common/config/msp430/msp430-common.c (msp430_handle_option): Likewise. * symtab.c (symtab_node::verify_base): Likewise. * opts.c (set_debug_level): Likewise. * tree.c (verify_type_variant): Likewise. Fix typo in comment. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add missing whitespace to translatable strings. * config/avr/avr.md (bswapsi2): Fix typo in comment. * config/sh/superh.h: Likewise. * config/i386/xopintrin.h: Likewise. * config/i386/znver1.md: Likewise. * config/rs6000/rs6000.c (struct rs6000_opt_mask): Likewise. * ipa-inline-analysis.c (compute_inline_parameters): Likewise. * double-int.h (struct double_int): Likewise. * double-int.c (div_and_round_double): Likewise. * wide-int.cc: Likewise. * tree-ssa.c (non_rewritable_mem_ref_base): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. * cfgcleanup.c (crossjumps_occured): Renamed to ... (crossjumps_occurred): ... this. (try_crossjump_bb, try_head_merge_bb, try_optimize_cfg, cleanup_cfg): Adjust all uses. cp/ * semantics.c (finish_omp_clauses): Add missing whitespace to translatable strings. * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo. lto/ * lto-symtab.c (lto_symtab_merge_symbols): Fix comment typo. fortran/ * decl.c (attr_decl1): Fix spelling in translatable string. * intrinsic.texi: Fix spelling - invokation -> invocation. * lang.opt (faggressive-function-elimination, gfc_convert): Fix typos in descriptions. * openmp.c (resolve_omp_clauses): Add missing whitespace to translatable strings. c-family/ * c.opt (Wnormalized=): Fix typo in description. testsuite/ * c-c++-common/goacc/host_data-2.c (f): Adjust expected spelling of diagnostics. * gfortran.dg/initialization_17.f90: Likewise. From-SVN: r244245
2017-01-06lto-partition.c (promote_symbol): Write to dump file sooner, include alias ↵Nathan Sidwell2-6/+13
promoting too. * lto-partition.c (promote_symbol): Write to dump file sooner, include alias promoting too. From-SVN: r244159
2017-01-06ipa-visibility.c (function_and_variable_visibility): Reformat comments and ↵Nathan Sidwell2-10/+20
long lines. gcc/ * ipa-visibility.c (function_and_variable_visibility): Reformat comments and long lines. Remove extrneous if. * symtab.c (symtab_node::make_decl_local): Fix code format. (symtab_node::set_section_for_node): Fix comment typo. gcc/lto/ * lto-partition.c (lto_balanced_map): Reformat/respell comment. (may_need_named_section_p): Likewise. (rename_statics): Likewise. (lto_promote_cross_file_statics): Likewise. From-SVN: r244156
2017-01-01Update copyright years.Jakub Jelinek16-16/+20
From-SVN: r243994
2016-11-30re PR lto/78562 (Wrong warning for built-in functions with -flto)Georg-Johann Lay2-0/+14
gcc/lto/ PR lto/78562 * lto-symtab.c (lto_symtab_merge_decls_2): Don't diagnose type mismatch if the two types are built-in. From-SVN: r243008
2016-11-26tree.c (build_common_tree_nodes): Initialize ptrdiff_type_node.Prathamesh Kulkarni2-2/+4
2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * tree.c (build_common_tree_nodes): Initialize ptrdiff_type_node. (free_lang_data): Remove assignment to ptrdiff_type_node. c-family/ * c-common.c (c_common_nodes_and_builtins): Remove initialization of ptrdiff_type_node. lto/ * lto-lang.c (lto_init): Remove initialization of ptrdiff_type_node. From-SVN: r242888
2016-11-23re PR lto/78472 (warning: type of 's' does not match original declaration ↵Richard Biener2-1/+8
from zero length bitfield in C vs C++) 2016-11-23 Richard Biener <rguenther@suse.de> PR lto/78472 * tree.c (gimple_canonical_types_compatible_p): Ignore zero-sized fields. lto/ * lto.c (hash_canonical_type): Ignore zero-sized fields. * g++.dg/lto/pr78472_0.c: New testcase. * g++.dg/lto/pr78472_1.C: Likewise. From-SVN: r242746
2016-11-21re PR c++/71973 (c++ handles built-in functions inconsistently)Bernd Edlinger2-2/+11
gcc: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * doc/invoke.texi (-Wno-builtin-declaration-mismatch): Document the new default-enabled warning.. * builtin-types.def (BT_CONST_TM_PTR): New primitive type. (BT_PTR_CONST_STRING): Updated. (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR): Removed. (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_TM_PTR): New function type. * builtins.def (DEF_TM_BUILTIN): Disable BOTH_P for TM builtins. (strftime): Update builtin function. * tree-core.h (TI_CONST_TM_PTR_TYPE): New enum value. * tree.h (const_tm_ptr_type_node): New type node. * tree.c (free_lang_data, build_common_tree_nodes): Initialize const_tm_ptr_type_node. c-family: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * c.opt (-Wbuiltin-declaration-mismatch): New warning. * c-common.c (c_common_nodes_and_builtins): Initialize const_tm_ptr_type_node. c: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * c-decl.c (diagnose_mismatched_decls): Use OPT_Wbuiltin_declaration_mismatch here too. cp: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * decl.c (duplicate_decls): Warn when a built-in function is redefined. Don't overload builtin functions with C++ functions. Handle const_tm_ptr_type_node like file_ptr_node. Copy the TREE_NOTHROW flag unmodified to the old decl. lto: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * lto-lang.c (lto_init): Assert const_tm_ptr_type_node is sane. testsuite: 2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/71973 * g++.dg/pr71973-1.C: New test. * g++.dg/pr71973-2.C: New test. * g++.dg/pr71973-3.C: New test. * g++.dg/lto/pr68811_0.C: Add -w to first lto-options. * g++.dg/lookup/extern-c-redecl4.C: Adjust test expectations. * g++.old-deja/g++.mike/p700.C: Add -Wno-builtin-declaration-mismatch to dg-options. * g++.old-deja/g++.other/realloc.C: Likewise. * g++.old-deja/g++.other/builtins10.C: Adjust test expectations. From-SVN: r242662
2016-11-18Add SET_DECL_MODERichard Sandiford2-1/+7
This may no longer be necessary with the current version of the SVE patches, but it does at least make things consistent with the TYPE_MODE/SET_TYPE_MODE split. gcc/ada/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE. gcc/c/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * c-decl.c (merge_decls): Use SET_DECL_MODE. (make_label, finish_struct): Likewise. gcc/cp/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * class.c (finish_struct_bits): Use SET_DECL_MODE. (build_base_field_1, layout_class_type, finish_struct_1): Likewise. * decl.c (make_label_decl): Likewise. * pt.c (tsubst_decl): Likewise. gcc/fortran/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * trans-common.c (build_common_decl): Use SET_DECL_MODE. * trans-decl.c (gfc_build_label_decl): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. gcc/lto/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * lto.c (offload_handle_link_vars): Use SET_DECL_MODE. gcc/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * tree.h (SET_DECL_MODE): New macro. * cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE. (expand_gimple_basic_block): Likewise. * function.c (split_complex_args): Likeise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise. * stor-layout.c (layout_decl, relayout_decl): Likewise. (finish_bitfield_representative): Likewise. * tree.c (make_node_stat): Likewise. * tree-inline.c (remap_ssa_name): Likewise. (tree_function_versioning): Likewise. * tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise. * tree-ssa.c (insert_debug_temp_for_var_def): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * varasm.c (make_debug_expr_from_rtl): Likewise. libcc1/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * plugin.cc (plugin_build_add_field): Use SET_DECL_MODE. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r242585
2016-10-31re PR lto/78129 (-Werror=suggest-final-types leads to -ENOSPC.)Richard Biener2-0/+10
2016-10-31 Richard Biener <rguenther@suse.de> PR lto/78129 * lto.c (do_whole_program_analysis): Bail out after errors from WPA analysis. From-SVN: r241698
2016-09-20Add IPA VRPKugan Vivekanandarajah3-0/+7
gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-20debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook.Richard Biener2-1/+6
2016-09-20 Richard Biener <rguenther@suse.de> * debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook. * debug.c (do_nothing_debug_hooks): Adjust. * dbxout.c (dbx_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise. (dwarf2out_finish): Move producer, filename and path annotation ... (dwarf2out_early_finish): ... here. Remove in_lto_p special-casing. * cgraphunit.c (symbol_table::finalize_compilation_unit): Adjust. lto/ * lto.c (lto_main): Call early_finish with "<artificial>" as filename. From-SVN: r240255
2016-09-19dwarf2out.c (early_dwarf_finished): New global.Richard Biener2-0/+7
2016-09-16 Richard Biener <rguenther@suse.de> * dwarf2out.c (early_dwarf_finished): New global. (set_early_dwarf::set_early_dwarf): Assert early_dwarf_finished is false. (dwarf2out_early_finish): Set early_dwarf_finished at the end, if called from LTO exit early. (dwarf2out_late_global_decl): When being during the early debug phase do not add locations but only const value attributes. Adjust the way we generate early DIEs for LTO. lto/ * lto.c (lto_main): Invoke early_finish debug hook. From-SVN: r240228
2016-09-05ChangeLog formatting fixes.Jakub Jelinek1-38/+37
From-SVN: r239997
2016-07-25cgraph.c (cgraph_node::verify_node): Compare against builtin by using ↵Richard Biener2-10/+8
DECL_BUILT_IN_CLASS and DECL_FUNCTION_CODE. 2016-07-25 Richard Biener <rguenther@suse.de> * cgraph.c (cgraph_node::verify_node): Compare against builtin by using DECL_BUILT_IN_CLASS and DECL_FUNCTION_CODE. * tree-chkp.c (chkp_gimple_call_builtin_p): Likewise. * tree-streamer.h (streamer_handle_as_builtin_p): Remove. (streamer_get_builtin_tree): Likewise. (streamer_write_builtin): Likewise. * lto-streamer.h (LTO_builtin_decl): Remove. * lto-streamer-in.c (lto_read_tree_1): Remove assert. (lto_input_scc): Remove LTO_builtin_decl handling. (lto_input_tree_1): Liekwise. * lto-streamer-out.c (lto_output_tree_1): Remove special handling of builtins. (DFS::DFS): Likewise. * tree-streamer-in.c (streamer_get_builtin_tree): Remove. * tree-streamer-out.c (pack_ts_function_decl_value_fields): Remove assert. (streamer_write_builtin): Remove. lto/ * lto.c (compare_tree_sccs_1): Remove streamer_handle_as_builtin_p uses. (unify_scc): Likewise. (lto_read_decls): Likewise. From-SVN: r238709
2016-06-28Makefile.in: Don't cat ../stage_current if it does not exist.Jakub Jelinek2-1/+6
* Makefile.in: Don't cat ../stage_current if it does not exist. c/ * Make-lang.in: Don't cat ../stage_current if it does not exist. cp/ * Make-lang.in: Don't cat ../stage_current if it does not exist. lto/ * Make-lang.in: Don't cat ../stage_current if it does not exist. From-SVN: r237817