Commit Graph

96 Commits

Author SHA1 Message Date
Joseph Myers 175a85b297 Support decimal floating-point constants in C2x.
ISO C2x adds decimal floating point as an optional standard feature.
This patch accordingly makes GCC accept DFP constants (DF, DD, DL, df,
dd, dl suffixes) in strict C2X mode, with a pedwarn-if-pedantic for
older standards and a warning with -Wc11-c2x-compat even in C2x mode
(which in turn requires -Wc11-c2x-compat to be newly passed through to
libcpp).

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

gcc/c-family:
	* c.opt (Wc11-c2x-compat): Add CPP(cpp_warn_c11_c2x_compat)
	CppReason(CPP_W_C11_C2X_COMPAT).

gcc/testsuite:
	* gcc.dg/dfp/c11-constants-1.c, gcc.dg/dfp/c11-constants-2.c,
	gcc.dg/dfp/c2x-constants-1.c, gcc.dg/dfp/c2x-constants-2.c: New
	tests.
	* gcc.dg/dfp/constants-pedantic.c: Use -std=gnu17 explicitly.
	Update expected diagnostics.

libcpp:
	* include/cpplib.h (struct cpp_options): Add dfp_constants and
	cpp_warn_c11_c2x_compat.
	(enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT.
	* init.c (struct lang_flags): Add dfp_constants.
	(lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and
	0 for other languages.
	(cpp_set_lang): Set dfp_constants from language.
	(cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1.
	* expr.c (interpret_float_suffix): Mention DFP constants as C2X in
	comment.
	(cpp_classify_number): Do not diagnose DFP constants for languages
	setting dfp_constants, unless cpp_warn_c11_c2x_compat.

From-SVN: r276908
2019-10-11 23:22:52 +01:00
Joseph Myers 93313b94fe Handle :: tokens in C for C2x.
As part of adding [[]]-style attributes, C2x adds the token :: for use
in scoped attribute names.

This patch adds corresponding support for that token in C to GCC.  The
token is supported both for C2x and for older gnu* standards (on the
basis that extensions are normally supported in older gnu* versions;
people will expect to be able to use [[]] attributes, before C2x is
the default, without needing to use -std=gnu2x).

There are no cases in older C standards where the token : can be
followed by a token starting with : in syntactically valid sources;
the only cases the :: token could break in older standard C thus are
ones involving concatenation of pp-tokens where the result does not
end up as tokens (e.g., gets stringized).  In GNU C extensions, the
main case where :: might appear in existing sources is in asm
statements, and the C parser is thus made to handle it like two
consecutive : tokens, which the C++ parser already does.  A limited
test of various positionings of :: in asm statements is added to the
testsuite (in particular, to cover the syntax error when :: means too
many colons but a single : would be OK), but existing tests cover a
variety of styles there anyway.

Technically there are cases in Objective-C and OpenMP for which this
also changes how previously valid code is lexed: the objc-selector-arg
syntax allows multiple consecutive : tokens (although I don't think
they are particularly useful there), while OpenMP syntax includes
array section syntax such as [:] which, before :: was a token, could
also be written as [::> (there might be other OpenMP cases potentially
affected, I didn't check all the OpenMP syntax in detail).  I don't
think either of those cases affects the basis for supporting the ::
token in all -std=gnu* modes, or that there is any obvious need to
special-case handling of CPP_SCOPE tokens for those constructs the way
there is for asm statements.

cpp_avoid_paste, which determines when spaces need adding between
tokens in preprocessed output where there wouldn't otherwise be
whitespace between them (e.g. if stringized), already inserts space
between : and : unconditionally, rather than only for C++, so no
change is needed there (but a C2x test is added that such space is
indeed inserted).

Bootstrapped with no regressions on x86-64-pc-linux-gnu.

gcc/c:
	* c-parser.c (c_parser_asm_statement): Handle CPP_SCOPE like two
	CPP_COLON tokens.

gcc/testsuite:
	* gcc.dg/asm-scope-1.c, gcc.dg/cpp/c11-scope-1.c,
	gcc.dg/cpp/c17-scope-1.c, gcc.dg/cpp/c2x-scope-1.c,
	gcc.dg/cpp/c2x-scope-2.c, gcc.dg/cpp/c90-scope-1.c,
	gcc.dg/cpp/c94-scope-1.c, gcc.dg/cpp/c99-scope-1.c,
	gcc.dg/cpp/gnu11-scope-1.c, gcc.dg/cpp/gnu17-scope-1.c,
	gcc.dg/cpp/gnu89-scope-1.c, gcc.dg/cpp/gnu99-scope-1.c: New tests.

libcpp:
	* include/cpplib.h (struct cpp_options): Add member scope.
	* init.c (struct lang_flags, lang_defaults): Likewise.
	(cpp_set_lang): Set scope member of pfile.
	* lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
	CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.

From-SVN: r276434
2019-10-02 01:08:40 +01:00
Nathan Sidwell b0d11f1ed6 [preprocessor] Include stacking
https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01971.html
	* internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
	IT_HEADER_HWM.
	(_cpp_stack_file): Take include_type, not a bool.
	* files.c (_cpp_find_file): Refactor to not hide an if inside a
	for conditional.
	(should_stack_file): Break apart to ...
	(is_known_idempotent_file, has_unique_contents): ... these.
	(_cpp_stack_file): Replace IMPORT boolean with include_type enum.
	Refactor to use new predicates.  Do linemap compensation here ...
	(_cpp_stack_include): ... not here.
	* init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.

From-SVN: r275034
2019-08-29 14:06:32 +00:00
Martin Sebor 99b1c316ec PR c++/61339 - add mismatch between struct and class [-Wmismatched-tags] to non-bugs
gcc/c/ChangeLog:

	PR c++/61339
	* c-decl.c (xref_tag): Change class-key of PODs to struct and others
	to class.
	(field_decl_cmp): Same.
	* c-parser.c (c_parser_struct_or_union_specifier): Same.
	* c-tree.h: Same.
	* gimple-parser.c (c_parser_gimple_compound_statement): Same.

gcc/c-family/ChangeLog:

	PR c++/61339
	* c-opts.c (handle_deferred_opts): : Change class-key of PODs to struct
	and others to class.
	* c-pretty-print.h: Same.

gcc/cp/ChangeLog:

	PR c++/61339
	* cp-tree.h: Change class-key of PODs to struct and others to class.
	* search.c: Same.
	* semantics.c (finalize_nrv_r): Same.

gcc/lto/ChangeLog:

	PR c++/61339
	* lto-common.c (lto_splay_tree_new): : Change class-key of PODs
	to struct and others to class.
	(mentions_vars_p): Same.
	(register_resolution): Same.
	(lto_register_var_decl_in_symtab): Same.
	(lto_register_function_decl_in_symtab): Same.
	(cmp_tree): Same.
	(lto_read_decls): Same.

gcc/ChangeLog:

	PR c++/61339
	* auto-profile.c: Change class-key of PODs to struct and others
	to class.
	* basic-block.h: Same.
	* bitmap.c (bitmap_alloc): Same.
	* bitmap.h: Same.
	* builtins.c (expand_builtin_prefetch): Same.
	(expand_builtin_interclass_mathfn): Same.
	(expand_builtin_strlen): Same.
	(expand_builtin_mempcpy_args): Same.
	(expand_cmpstr): Same.
	(expand_builtin___clear_cache): Same.
	(expand_ifn_atomic_bit_test_and): Same.
	(expand_builtin_thread_pointer): Same.
	(expand_builtin_set_thread_pointer): Same.
	* caller-save.c (setup_save_areas): Same.
	(replace_reg_with_saved_mem): Same.
	(insert_restore): Same.
	(insert_save): Same.
	(add_used_regs): Same.
	* cfg.c (get_bb_copy): Same.
	(set_loop_copy): Same.
	* cfg.h: Same.
	* cfganal.h: Same.
	* cfgexpand.c (alloc_stack_frame_space): Same.
	(add_stack_var): Same.
	(add_stack_var_conflict): Same.
	(add_scope_conflicts_1): Same.
	(update_alias_info_with_stack_vars): Same.
	(expand_used_vars): Same.
	* cfghooks.c (redirect_edge_and_branch_force): Same.
	(delete_basic_block): Same.
	(split_edge): Same.
	(make_forwarder_block): Same.
	(force_nonfallthru): Same.
	(duplicate_block): Same.
	(lv_flush_pending_stmts): Same.
	* cfghooks.h: Same.
	* cfgloop.c (flow_loops_cfg_dump): Same.
	(flow_loop_nested_p): Same.
	(superloop_at_depth): Same.
	(get_loop_latch_edges): Same.
	(flow_loop_dump): Same.
	(flow_loops_dump): Same.
	(flow_loops_free): Same.
	(flow_loop_nodes_find): Same.
	(establish_preds): Same.
	(flow_loop_tree_node_add): Same.
	(flow_loop_tree_node_remove): Same.
	(flow_loops_find): Same.
	(find_subloop_latch_edge_by_profile): Same.
	(find_subloop_latch_edge_by_ivs): Same.
	(mfb_redirect_edges_in_set): Same.
	(form_subloop): Same.
	(merge_latch_edges): Same.
	(disambiguate_multiple_latches): Same.
	(disambiguate_loops_with_multiple_latches): Same.
	(flow_bb_inside_loop_p): Same.
	(glb_enum_p): Same.
	(get_loop_body_with_size): Same.
	(get_loop_body): Same.
	(fill_sons_in_loop): Same.
	(get_loop_body_in_dom_order): Same.
	(get_loop_body_in_custom_order): Same.
	(release_recorded_exits): Same.
	(get_loop_exit_edges): Same.
	(num_loop_branches): Same.
	(remove_bb_from_loops): Same.
	(find_common_loop): Same.
	(delete_loop): Same.
	(cancel_loop): Same.
	(verify_loop_structure): Same.
	(loop_preheader_edge): Same.
	(loop_exit_edge_p): Same.
	(single_exit): Same.
	(loop_exits_to_bb_p): Same.
	(loop_exits_from_bb_p): Same.
	(get_loop_location): Same.
	(record_niter_bound): Same.
	(get_estimated_loop_iterations_int): Same.
	(max_stmt_executions_int): Same.
	(likely_max_stmt_executions_int): Same.
	(get_estimated_loop_iterations): Same.
	(get_max_loop_iterations): Same.
	(get_max_loop_iterations_int): Same.
	(get_likely_max_loop_iterations): Same.
	* cfgloop.h (simple_loop_desc): Same.
	(get_loop): Same.
	(loop_depth): Same.
	(loop_outer): Same.
	(loop_iterator::next): Same.
	(loop_outermost): Same.
	* cfgloopanal.c (mark_irreducible_loops): Same.
	(num_loop_insns): Same.
	(average_num_loop_insns): Same.
	(expected_loop_iterations_unbounded): Same.
	(expected_loop_iterations): Same.
	(mark_loop_exit_edges): Same.
	(single_likely_exit): Same.
	* cfgloopmanip.c (fix_bb_placement): Same.
	(fix_bb_placements): Same.
	(remove_path): Same.
	(place_new_loop): Same.
	(add_loop): Same.
	(scale_loop_frequencies): Same.
	(scale_loop_profile): Same.
	(create_empty_if_region_on_edge): Same.
	(create_empty_loop_on_edge): Same.
	(loopify): Same.
	(unloop): Same.
	(fix_loop_placements): Same.
	(copy_loop_info): Same.
	(duplicate_loop): Same.
	(duplicate_subloops): Same.
	(loop_redirect_edge): Same.
	(can_duplicate_loop_p): Same.
	(duplicate_loop_to_header_edge): Same.
	(mfb_keep_just): Same.
	(has_preds_from_loop): Same.
	(create_preheader): Same.
	(create_preheaders): Same.
	(lv_adjust_loop_entry_edge): Same.
	(loop_version): Same.
	* cfgloopmanip.h: Same.
	* cgraph.h: Same.
	* cgraphbuild.c: Same.
	* combine.c (make_extraction): Same.
	* config/i386/i386-features.c: Same.
	* config/i386/i386-features.h: Same.
	* config/i386/i386.c (ix86_emit_outlined_ms2sysv_save): Same.
	(ix86_emit_outlined_ms2sysv_restore): Same.
	(ix86_noce_conversion_profitable_p): Same.
	(ix86_init_cost): Same.
	(ix86_simd_clone_usable): Same.
	* configure.ac: Same.
	* coretypes.h: Same.
	* data-streamer-in.c (string_for_index): Same.
	(streamer_read_indexed_string): Same.
	(streamer_read_string): Same.
	(bp_unpack_indexed_string): Same.
	(bp_unpack_string): Same.
	(streamer_read_uhwi): Same.
	(streamer_read_hwi): Same.
	(streamer_read_gcov_count): Same.
	(streamer_read_wide_int): Same.
	* data-streamer.h (streamer_write_bitpack): Same.
	(bp_unpack_value): Same.
	(streamer_write_char_stream): Same.
	(streamer_write_hwi_in_range): Same.
	(streamer_write_record_start): Same.
	* ddg.c (create_ddg_dep_from_intra_loop_link): Same.
	(add_cross_iteration_register_deps): Same.
	(build_intra_loop_deps): Same.
	* df-core.c (df_analyze): Same.
	(loop_post_order_compute): Same.
	(loop_inverted_post_order_compute): Same.
	* df-problems.c (df_rd_alloc): Same.
	(df_rd_simulate_one_insn): Same.
	(df_rd_local_compute): Same.
	(df_rd_init_solution): Same.
	(df_rd_confluence_n): Same.
	(df_rd_transfer_function): Same.
	(df_rd_free): Same.
	(df_rd_dump_defs_set): Same.
	(df_rd_top_dump): Same.
	(df_lr_alloc): Same.
	(df_lr_reset): Same.
	(df_lr_local_compute): Same.
	(df_lr_init): Same.
	(df_lr_confluence_n): Same.
	(df_lr_free): Same.
	(df_lr_top_dump): Same.
	(df_lr_verify_transfer_functions): Same.
	(df_live_alloc): Same.
	(df_live_reset): Same.
	(df_live_init): Same.
	(df_live_confluence_n): Same.
	(df_live_finalize): Same.
	(df_live_free): Same.
	(df_live_top_dump): Same.
	(df_live_verify_transfer_functions): Same.
	(df_mir_alloc): Same.
	(df_mir_reset): Same.
	(df_mir_init): Same.
	(df_mir_confluence_n): Same.
	(df_mir_free): Same.
	(df_mir_top_dump): Same.
	(df_word_lr_alloc): Same.
	(df_word_lr_reset): Same.
	(df_word_lr_init): Same.
	(df_word_lr_confluence_n): Same.
	(df_word_lr_free): Same.
	(df_word_lr_top_dump): Same.
	(df_md_alloc): Same.
	(df_md_simulate_one_insn): Same.
	(df_md_reset): Same.
	(df_md_init): Same.
	(df_md_free): Same.
	(df_md_top_dump): Same.
	* df-scan.c (df_insn_delete): Same.
	(df_insn_rescan): Same.
	(df_notes_rescan): Same.
	(df_sort_and_compress_mws): Same.
	(df_install_mws): Same.
	(df_refs_add_to_chains): Same.
	(df_ref_create_structure): Same.
	(df_ref_record): Same.
	(df_def_record_1): Same.
	(df_find_hard_reg_defs): Same.
	(df_uses_record): Same.
	(df_get_conditional_uses): Same.
	(df_get_call_refs): Same.
	(df_recompute_luids): Same.
	(df_get_entry_block_def_set): Same.
	(df_entry_block_defs_collect): Same.
	(df_get_exit_block_use_set): Same.
	(df_exit_block_uses_collect): Same.
	(df_mws_verify): Same.
	(df_bb_verify): Same.
	* df.h (df_scan_get_bb_info): Same.
	* doc/tm.texi: Same.
	* dse.c (record_store): Same.
	* dumpfile.h: Same.
	* emit-rtl.c (const_fixed_hasher::equal): Same.
	(set_mem_attributes_minus_bitpos): Same.
	(change_address): Same.
	(adjust_address_1): Same.
	(offset_address): Same.
	* emit-rtl.h: Same.
	* except.c (dw2_build_landing_pads): Same.
	(sjlj_emit_dispatch_table): Same.
	* explow.c (allocate_dynamic_stack_space): Same.
	(emit_stack_probe): Same.
	(probe_stack_range): Same.
	* expmed.c (store_bit_field_using_insv): Same.
	(store_bit_field_1): Same.
	(store_integral_bit_field): Same.
	(extract_bit_field_using_extv): Same.
	(extract_bit_field_1): Same.
	(emit_cstore): Same.
	* expr.c (emit_block_move_via_cpymem): Same.
	(expand_cmpstrn_or_cmpmem): Same.
	(set_storage_via_setmem): Same.
	(emit_single_push_insn_1): Same.
	(expand_assignment): Same.
	(store_constructor): Same.
	(expand_expr_real_2): Same.
	(expand_expr_real_1): Same.
	(try_casesi): Same.
	* flags.h: Same.
	* function.c (try_fit_stack_local): Same.
	(assign_stack_local_1): Same.
	(assign_stack_local): Same.
	(cut_slot_from_list): Same.
	(insert_slot_to_list): Same.
	(max_slot_level): Same.
	(move_slot_to_level): Same.
	(temp_address_hasher::equal): Same.
	(remove_unused_temp_slot_addresses): Same.
	(assign_temp): Same.
	(combine_temp_slots): Same.
	(update_temp_slot_address): Same.
	(preserve_temp_slots): Same.
	* function.h: Same.
	* fwprop.c: Same.
	* gcc-rich-location.h: Same.
	* gcov.c: Same.
	* genattrtab.c (check_attr_test): Same.
	(check_attr_value): Same.
	(convert_set_attr_alternative): Same.
	(convert_set_attr): Same.
	(check_defs): Same.
	(copy_boolean): Same.
	(get_attr_value): Same.
	(expand_delays): Same.
	(make_length_attrs): Same.
	(min_fn): Same.
	(make_alternative_compare): Same.
	(simplify_test_exp): Same.
	(tests_attr_p): Same.
	(get_attr_order): Same.
	(clear_struct_flag): Same.
	(gen_attr): Same.
	(compares_alternatives_p): Same.
	(gen_insn): Same.
	(gen_delay): Same.
	(find_attrs_to_cache): Same.
	(write_test_expr): Same.
	(walk_attr_value): Same.
	(write_attr_get): Same.
	(eliminate_known_true): Same.
	(write_insn_cases): Same.
	(write_attr_case): Same.
	(write_attr_valueq): Same.
	(write_attr_value): Same.
	(write_dummy_eligible_delay): Same.
	(next_comma_elt): Same.
	(find_attr): Same.
	(make_internal_attr): Same.
	(copy_rtx_unchanging): Same.
	(gen_insn_reserv): Same.
	(check_tune_attr): Same.
	(make_automaton_attrs): Same.
	(handle_arg): Same.
	* genextract.c (gen_insn): Same.
	(VEC_char_to_string): Same.
	* genmatch.c (print_operand): Same.
	(lower): Same.
	(parser::parse_operation): Same.
	(parser::parse_capture): Same.
	(parser::parse_c_expr): Same.
	(parser::parse_simplify): Same.
	(main): Same.
	* genoutput.c (output_operand_data): Same.
	(output_get_insn_name): Same.
	(compare_operands): Same.
	(place_operands): Same.
	(process_template): Same.
	(validate_insn_alternatives): Same.
	(validate_insn_operands): Same.
	(gen_expand): Same.
	(note_constraint): Same.
	* genpreds.c (write_one_predicate_function): Same.
	(add_constraint): Same.
	(process_define_register_constraint): Same.
	(write_lookup_constraint_1): Same.
	(write_lookup_constraint_array): Same.
	(write_insn_constraint_len): Same.
	(write_reg_class_for_constraint_1): Same.
	(write_constraint_satisfied_p_array): Same.
	* genrecog.c (optimize_subroutine_group): Same.
	* gensupport.c (process_define_predicate): Same.
	(queue_pattern): Same.
	(remove_from_queue): Same.
	(process_rtx): Same.
	(is_predicable): Same.
	(change_subst_attribute): Same.
	(subst_pattern_match): Same.
	(alter_constraints): Same.
	(alter_attrs_for_insn): Same.
	(shift_output_template): Same.
	(alter_output_for_subst_insn): Same.
	(process_one_cond_exec): Same.
	(subst_dup): Same.
	(process_define_cond_exec): Same.
	(mnemonic_htab_callback): Same.
	(gen_mnemonic_attr): Same.
	(read_md_rtx): Same.
	* ggc-page.c: Same.
	* gimple-loop-interchange.cc (dump_reduction): Same.
	(dump_induction): Same.
	(loop_cand::~loop_cand): Same.
	(free_data_refs_with_aux): Same.
	(tree_loop_interchange::interchange_loops): Same.
	(tree_loop_interchange::map_inductions_to_loop): Same.
	(tree_loop_interchange::move_code_to_inner_loop): Same.
	(compute_access_stride): Same.
	(compute_access_strides): Same.
	(proper_loop_form_for_interchange): Same.
	(tree_loop_interchange_compute_ddrs): Same.
	(prune_datarefs_not_in_loop): Same.
	(prepare_data_references): Same.
	(pass_linterchange::execute): Same.
	* gimple-loop-jam.c (bb_prevents_fusion_p): Same.
	(unroll_jam_possible_p): Same.
	(fuse_loops): Same.
	(adjust_unroll_factor): Same.
	(tree_loop_unroll_and_jam): Same.
	* gimple-loop-versioning.cc (loop_versioning::~loop_versioning): Same.
	(loop_versioning::expensive_stmt_p): Same.
	(loop_versioning::version_for_unity): Same.
	(loop_versioning::dump_inner_likelihood): Same.
	(loop_versioning::find_per_loop_multiplication): Same.
	(loop_versioning::analyze_term_using_scevs): Same.
	(loop_versioning::record_address_fragment): Same.
	(loop_versioning::analyze_expr): Same.
	(loop_versioning::analyze_blocks): Same.
	(loop_versioning::prune_conditions): Same.
	(loop_versioning::merge_loop_info): Same.
	(loop_versioning::add_loop_to_queue): Same.
	(loop_versioning::decide_whether_loop_is_versionable): Same.
	(loop_versioning::make_versioning_decisions): Same.
	(loop_versioning::implement_versioning_decisions): Same.
	* gimple-ssa-evrp-analyze.c
	(evrp_range_analyzer::record_ranges_from_phis): Same.
	* gimple-ssa-store-merging.c (split_store::split_store): Same.
	(count_multiple_uses): Same.
	(split_group): Same.
	(imm_store_chain_info::output_merged_store): Same.
	(pass_store_merging::process_store): Same.
	* gimple-ssa-strength-reduction.c (slsr_process_phi): Same.
	* gimple-ssa-warn-alloca.c (adjusted_warn_limit): Same.
	(is_max): Same.
	(alloca_call_type): Same.
	(pass_walloca::execute): Same.
	* gimple-streamer-in.c (input_phi): Same.
	(input_gimple_stmt): Same.
	* gimple-streamer.h: Same.
	* godump.c (go_force_record_alignment): Same.
	(go_format_type): Same.
	(go_output_type): Same.
	(go_output_fndecl): Same.
	(go_output_typedef): Same.
	(keyword_hash_init): Same.
	(find_dummy_types): Same.
	* graph.c (draw_cfg_nodes_no_loops): Same.
	(draw_cfg_nodes_for_loop): Same.
	* hard-reg-set.h (hard_reg_set_iter_next): Same.
	* hsa-brig.c: Same.
	* hsa-common.h (hsa_internal_fn_hasher::equal): Same.
	* hsa-dump.c (dump_hsa_cfun): Same.
	* hsa-gen.c (gen_function_def_parameters): Same.
	* hsa-regalloc.c (dump_hsa_cfun_regalloc): Same.
	* input.c (dump_line_table_statistics): Same.
	(test_lexer): Same.
	* input.h: Same.
	* internal-fn.c (get_multi_vector_move): Same.
	(expand_load_lanes_optab_fn): Same.
	(expand_GOMP_SIMT_ENTER_ALLOC): Same.
	(expand_GOMP_SIMT_EXIT): Same.
	(expand_GOMP_SIMT_LAST_LANE): Same.
	(expand_GOMP_SIMT_ORDERED_PRED): Same.
	(expand_GOMP_SIMT_VOTE_ANY): Same.
	(expand_GOMP_SIMT_XCHG_BFLY): Same.
	(expand_GOMP_SIMT_XCHG_IDX): Same.
	(expand_addsub_overflow): Same.
	(expand_neg_overflow): Same.
	(expand_mul_overflow): Same.
	(expand_call_mem_ref): Same.
	(expand_mask_load_optab_fn): Same.
	(expand_scatter_store_optab_fn): Same.
	(expand_gather_load_optab_fn): Same.
	* ipa-cp.c (ipa_get_parm_lattices): Same.
	(print_all_lattices): Same.
	(ignore_edge_p): Same.
	(build_toporder_info): Same.
	(free_toporder_info): Same.
	(push_node_to_stack): Same.
	(ipcp_lattice<valtype>::set_contains_variable): Same.
	(set_agg_lats_to_bottom): Same.
	(ipcp_bits_lattice::meet_with): Same.
	(set_single_call_flag): Same.
	(initialize_node_lattices): Same.
	(ipa_get_jf_ancestor_result): Same.
	(ipcp_verify_propagated_values): Same.
	(propagate_scalar_across_jump_function): Same.
	(propagate_context_across_jump_function): Same.
	(propagate_bits_across_jump_function): Same.
	(ipa_vr_operation_and_type_effects): Same.
	(propagate_vr_across_jump_function): Same.
	(set_check_aggs_by_ref): Same.
	(set_chain_of_aglats_contains_variable): Same.
	(merge_aggregate_lattices): Same.
	(agg_pass_through_permissible_p): Same.
	(propagate_aggs_across_jump_function): Same.
	(call_passes_through_thunk_p): Same.
	(propagate_constants_across_call): Same.
	(devirtualization_time_bonus): Same.
	(good_cloning_opportunity_p): Same.
	(context_independent_aggregate_values): Same.
	(gather_context_independent_values): Same.
	(perform_estimation_of_a_value): Same.
	(estimate_local_effects): Same.
	(value_topo_info<valtype>::add_val): Same.
	(add_all_node_vals_to_toposort): Same.
	(value_topo_info<valtype>::propagate_effects): Same.
	(ipcp_propagate_stage): Same.
	(ipcp_discover_new_direct_edges): Same.
	(same_node_or_its_all_contexts_clone_p): Same.
	(cgraph_edge_brings_value_p): Same.
	(gather_edges_for_value): Same.
	(create_specialized_node): Same.
	(find_more_scalar_values_for_callers_subset): Same.
	(find_more_contexts_for_caller_subset): Same.
	(copy_plats_to_inter): Same.
	(intersect_aggregates_with_edge): Same.
	(find_aggregate_values_for_callers_subset): Same.
	(cgraph_edge_brings_all_agg_vals_for_node): Same.
	(decide_about_value): Same.
	(decide_whether_version_node): Same.
	(spread_undeadness): Same.
	(identify_dead_nodes): Same.
	(ipcp_store_vr_results): Same.
	* ipa-devirt.c (final_warning_record::grow_type_warnings): Same.
	* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Same.
	(redirect_to_unreachable): Same.
	(edge_set_predicate): Same.
	(evaluate_conditions_for_known_args): Same.
	(evaluate_properties_for_edge): Same.
	(ipa_fn_summary_t::duplicate): Same.
	(ipa_call_summary_t::duplicate): Same.
	(dump_ipa_call_summary): Same.
	(ipa_dump_fn_summary): Same.
	(eliminated_by_inlining_prob): Same.
	(set_cond_stmt_execution_predicate): Same.
	(set_switch_stmt_execution_predicate): Same.
	(compute_bb_predicates): Same.
	(will_be_nonconstant_expr_predicate): Same.
	(phi_result_unknown_predicate): Same.
	(analyze_function_body): Same.
	(compute_fn_summary): Same.
	(estimate_edge_devirt_benefit): Same.
	(estimate_edge_size_and_time): Same.
	(estimate_calls_size_and_time): Same.
	(estimate_node_size_and_time): Same.
	(remap_edge_change_prob): Same.
	(remap_edge_summaries): Same.
	(ipa_merge_fn_summary_after_inlining): Same.
	(ipa_fn_summary_generate): Same.
	(inline_read_section): Same.
	(ipa_fn_summary_read): Same.
	(ipa_fn_summary_write): Same.
	* ipa-fnsummary.h: Same.
	* ipa-hsa.c (ipa_hsa_read_section): Same.
	* ipa-icf-gimple.c (func_checker::compare_loops): Same.
	* ipa-icf.c (sem_function::param_used_p): Same.
	* ipa-inline-analysis.c (do_estimate_edge_time): Same.
	* ipa-inline.c (edge_badness): Same.
	(inline_small_functions): Same.
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::stream_out): Same.
	* ipa-predicate.c (predicate::remap_after_duplication): Same.
	(predicate::remap_after_inlining): Same.
	(predicate::stream_out): Same.
	* ipa-predicate.h: Same.
	* ipa-profile.c (ipa_profile_read_summary): Same.
	* ipa-prop.c (ipa_get_param_decl_index_1): Same.
	(count_formal_params): Same.
	(ipa_dump_param): Same.
	(ipa_alloc_node_params): Same.
	(ipa_print_node_jump_functions_for_edge): Same.
	(ipa_print_node_jump_functions): Same.
	(ipa_load_from_parm_agg): Same.
	(get_ancestor_addr_info): Same.
	(ipa_compute_jump_functions_for_edge): Same.
	(ipa_analyze_virtual_call_uses): Same.
	(ipa_analyze_stmt_uses): Same.
	(ipa_analyze_params_uses_in_bb): Same.
	(update_jump_functions_after_inlining): Same.
	(try_decrement_rdesc_refcount): Same.
	(ipa_impossible_devirt_target): Same.
	(update_indirect_edges_after_inlining): Same.
	(combine_controlled_uses_counters): Same.
	(ipa_edge_args_sum_t::duplicate): Same.
	(ipa_write_jump_function): Same.
	(ipa_write_indirect_edge_info): Same.
	(ipa_write_node_info): Same.
	(ipa_read_edge_info): Same.
	(ipa_prop_read_section): Same.
	(read_replacements_section): Same.
	* ipa-prop.h (ipa_get_param_count): Same.
	(ipa_get_param): Same.
	(ipa_get_type): Same.
	(ipa_get_param_move_cost): Same.
	(ipa_set_param_used): Same.
	(ipa_get_controlled_uses): Same.
	(ipa_set_controlled_uses): Same.
	(ipa_get_cs_argument_count): Same.
	* ipa-pure-const.c (analyze_function): Same.
	(pure_const_read_summary): Same.
	* ipa-ref.h: Same.
	* ipa-reference.c (ipa_reference_read_optimization_summary): Same.
	* ipa-split.c (test_nonssa_use): Same.
	(dump_split_point): Same.
	(dominated_by_forbidden): Same.
	(split_part_set_ssa_name_p): Same.
	(find_split_points): Same.
	* ira-build.c (finish_loop_tree_nodes): Same.
	(low_pressure_loop_node_p): Same.
	* ira-color.c (ira_reuse_stack_slot): Same.
	* ira-int.h: Same.
	* ira.c (setup_reg_equiv): Same.
	(print_insn_chain): Same.
	(ira): Same.
	* loop-doloop.c (doloop_condition_get): Same.
	(add_test): Same.
	(record_reg_sets): Same.
	(doloop_optimize): Same.
	* loop-init.c (loop_optimizer_init): Same.
	(fix_loop_structure): Same.
	* loop-invariant.c (merge_identical_invariants): Same.
	(compute_always_reached): Same.
	(find_exits): Same.
	(may_assign_reg_p): Same.
	(find_invariants_bb): Same.
	(find_invariants_body): Same.
	(replace_uses): Same.
	(can_move_invariant_reg): Same.
	(free_inv_motion_data): Same.
	(move_single_loop_invariants): Same.
	(change_pressure): Same.
	(mark_ref_regs): Same.
	(calculate_loop_reg_pressure): Same.
	* loop-iv.c (biv_entry_hasher::equal): Same.
	(iv_extend_to_rtx_code): Same.
	(check_iv_ref_table_size): Same.
	(clear_iv_info): Same.
	(latch_dominating_def): Same.
	(iv_get_reaching_def): Same.
	(iv_constant): Same.
	(iv_subreg): Same.
	(iv_extend): Same.
	(iv_neg): Same.
	(iv_add): Same.
	(iv_mult): Same.
	(get_biv_step): Same.
	(record_iv): Same.
	(analyzed_for_bivness_p): Same.
	(record_biv): Same.
	(iv_analyze_biv): Same.
	(iv_analyze_expr): Same.
	(iv_analyze_def): Same.
	(iv_analyze_op): Same.
	(iv_analyze): Same.
	(iv_analyze_result): Same.
	(biv_p): Same.
	(eliminate_implied_conditions): Same.
	(simplify_using_initial_values): Same.
	(shorten_into_mode): Same.
	(canonicalize_iv_subregs): Same.
	(determine_max_iter): Same.
	(check_simple_exit): Same.
	(find_simple_exit): Same.
	(get_simple_loop_desc): Same.
	* loop-unroll.c (report_unroll): Same.
	(decide_unrolling): Same.
	(unroll_loops): Same.
	(loop_exit_at_end_p): Same.
	(decide_unroll_constant_iterations): Same.
	(unroll_loop_constant_iterations): Same.
	(compare_and_jump_seq): Same.
	(unroll_loop_runtime_iterations): Same.
	(decide_unroll_stupid): Same.
	(unroll_loop_stupid): Same.
	(referenced_in_one_insn_in_loop_p): Same.
	(reset_debug_uses_in_loop): Same.
	(analyze_iv_to_split_insn): Same.
	* lra-eliminations.c (lra_debug_elim_table): Same.
	(setup_can_eliminate): Same.
	(form_sum): Same.
	(lra_get_elimination_hard_regno): Same.
	(lra_eliminate_regs_1): Same.
	(eliminate_regs_in_insn): Same.
	(update_reg_eliminate): Same.
	(init_elimination): Same.
	(lra_eliminate): Same.
	* lra-int.h: Same.
	* lra-lives.c (initiate_live_solver): Same.
	* lra-remat.c (create_remat_bb_data): Same.
	* lra-spills.c (lra_spill): Same.
	* lra.c (lra_set_insn_recog_data): Same.
	(lra_set_used_insn_alternative_by_uid): Same.
	(init_reg_info): Same.
	(expand_reg_info): Same.
	* lto-cgraph.c (output_symtab): Same.
	(read_identifier): Same.
	(get_alias_symbol): Same.
	(input_node): Same.
	(input_varpool_node): Same.
	(input_ref): Same.
	(input_edge): Same.
	(input_cgraph_1): Same.
	(input_refs): Same.
	(input_symtab): Same.
	(input_offload_tables): Same.
	(output_cgraph_opt_summary): Same.
	(input_edge_opt_summary): Same.
	(input_cgraph_opt_section): Same.
	* lto-section-in.c (lto_free_raw_section_data): Same.
	(lto_create_simple_input_block): Same.
	(lto_free_function_in_decl_state_for_node): Same.
	* lto-streamer-in.c (lto_tag_check_set): Same.
	(lto_location_cache::revert_location_cache): Same.
	(lto_location_cache::input_location): Same.
	(lto_input_location): Same.
	(stream_input_location_now): Same.
	(lto_input_tree_ref): Same.
	(lto_input_eh_catch_list): Same.
	(input_eh_region): Same.
	(lto_init_eh): Same.
	(make_new_block): Same.
	(input_cfg): Same.
	(fixup_call_stmt_edges): Same.
	(input_struct_function_base): Same.
	(input_function): Same.
	(lto_read_body_or_constructor): Same.
	(lto_read_tree_1): Same.
	(lto_read_tree): Same.
	(lto_input_scc): Same.
	(lto_input_tree_1): Same.
	(lto_input_toplevel_asms): Same.
	(lto_input_mode_table): Same.
	(lto_reader_init): Same.
	(lto_data_in_create): Same.
	* lto-streamer-out.c (output_cfg): Same.
	* lto-streamer.h: Same.
	* modulo-sched.c (duplicate_insns_of_cycles): Same.
	(generate_prolog_epilog): Same.
	(mark_loop_unsched): Same.
	(dump_insn_location): Same.
	(loop_canon_p): Same.
	(sms_schedule): Same.
	* omp-expand.c (expand_omp_for_ordered_loops): Same.
	(expand_omp_for_generic): Same.
	(expand_omp_for_static_nochunk): Same.
	(expand_omp_for_static_chunk): Same.
	(expand_omp_simd): Same.
	(expand_omp_taskloop_for_inner): Same.
	(expand_oacc_for): Same.
	(expand_omp_atomic_pipeline): Same.
	(mark_loops_in_oacc_kernels_region): Same.
	* omp-offload.c (oacc_xform_loop): Same.
	* omp-simd-clone.c (simd_clone_adjust): Same.
	* optabs-query.c (get_traditional_extraction_insn): Same.
	* optabs.c (expand_vector_broadcast): Same.
	(expand_binop_directly): Same.
	(expand_twoval_unop): Same.
	(expand_twoval_binop): Same.
	(expand_unop_direct): Same.
	(emit_indirect_jump): Same.
	(emit_conditional_move): Same.
	(emit_conditional_neg_or_complement): Same.
	(emit_conditional_add): Same.
	(vector_compare_rtx): Same.
	(expand_vec_perm_1): Same.
	(expand_vec_perm_const): Same.
	(expand_vec_cond_expr): Same.
	(expand_vec_series_expr): Same.
	(maybe_emit_atomic_exchange): Same.
	(maybe_emit_sync_lock_test_and_set): Same.
	(expand_atomic_compare_and_swap): Same.
	(expand_atomic_load): Same.
	(expand_atomic_store): Same.
	(maybe_emit_op): Same.
	(valid_multiword_target_p): Same.
	(create_integer_operand): Same.
	(maybe_legitimize_operand_same_code): Same.
	(maybe_legitimize_operand): Same.
	(create_convert_operand_from_type): Same.
	(can_reuse_operands_p): Same.
	(maybe_legitimize_operands): Same.
	(maybe_gen_insn): Same.
	(maybe_expand_insn): Same.
	(maybe_expand_jump_insn): Same.
	(expand_insn): Same.
	* optabs.h (create_expand_operand): Same.
	(create_fixed_operand): Same.
	(create_output_operand): Same.
	(create_input_operand): Same.
	(create_convert_operand_to): Same.
	(create_convert_operand_from): Same.
	* optinfo.h: Same.
	* poly-int.h: Same.
	* predict.c (optimize_insn_for_speed_p): Same.
	(optimize_loop_for_size_p): Same.
	(optimize_loop_for_speed_p): Same.
	(optimize_loop_nest_for_speed_p): Same.
	(get_base_value): Same.
	(predicted_by_loop_heuristics_p): Same.
	(predict_extra_loop_exits): Same.
	(predict_loops): Same.
	(predict_paths_for_bb): Same.
	(predict_paths_leading_to): Same.
	(propagate_freq): Same.
	(pass_profile::execute): Same.
	* predict.h: Same.
	* profile-count.c (profile_count::differs_from_p): Same.
	(profile_probability::differs_lot_from_p): Same.
	* profile-count.h: Same.
	* profile.c (branch_prob): Same.
	* regrename.c (free_chain_data): Same.
	(mark_conflict): Same.
	(create_new_chain): Same.
	(merge_overlapping_regs): Same.
	(init_rename_info): Same.
	(merge_chains): Same.
	(regrename_analyze): Same.
	(regrename_do_replace): Same.
	(scan_rtx_reg): Same.
	(record_out_operands): Same.
	(build_def_use): Same.
	* regrename.h: Same.
	* reload.h: Same.
	* reload1.c (init_reload): Same.
	(maybe_fix_stack_asms): Same.
	(copy_reloads): Same.
	(count_pseudo): Same.
	(count_spilled_pseudo): Same.
	(find_reg): Same.
	(find_reload_regs): Same.
	(select_reload_regs): Same.
	(spill_hard_reg): Same.
	(fixup_eh_region_note): Same.
	(set_reload_reg): Same.
	(allocate_reload_reg): Same.
	(compute_reload_subreg_offset): Same.
	(reload_adjust_reg_for_icode): Same.
	(emit_input_reload_insns): Same.
	(emit_output_reload_insns): Same.
	(do_input_reload): Same.
	(inherit_piecemeal_p): Same.
	* rtl.h: Same.
	* sanopt.c (maybe_get_dominating_check): Same.
	(maybe_optimize_ubsan_ptr_ifn): Same.
	(can_remove_asan_check): Same.
	(maybe_optimize_asan_check_ifn): Same.
	(sanopt_optimize_walker): Same.
	* sched-deps.c (add_dependence_list): Same.
	(chain_to_prev_insn): Same.
	(add_insn_mem_dependence): Same.
	(create_insn_reg_set): Same.
	(maybe_extend_reg_info_p): Same.
	(sched_analyze_reg): Same.
	(sched_analyze_1): Same.
	(get_implicit_reg_pending_clobbers): Same.
	(chain_to_prev_insn_p): Same.
	(deps_analyze_insn): Same.
	(deps_start_bb): Same.
	(sched_free_deps): Same.
	(init_deps): Same.
	(init_deps_reg_last): Same.
	(free_deps): Same.
	* sched-ebb.c: Same.
	* sched-int.h: Same.
	* sched-rgn.c (add_branch_dependences): Same.
	(concat_insn_mem_list): Same.
	(deps_join): Same.
	(sched_rgn_compute_dependencies): Same.
	* sel-sched-ir.c (reset_target_context): Same.
	(copy_deps_context): Same.
	(init_id_from_df): Same.
	(has_dependence_p): Same.
	(change_loops_latches): Same.
	(bb_top_order_comparator): Same.
	(make_region_from_loop_preheader): Same.
	(sel_init_pipelining): Same.
	(get_loop_nest_for_rgn): Same.
	(make_regions_from_the_rest): Same.
	(sel_is_loop_preheader_p): Same.
	* sel-sched-ir.h (inner_loop_header_p): Same.
	(get_all_loop_exits): Same.
	* selftest.h: Same.
	* sese.c (sese_build_liveouts): Same.
	(sese_insert_phis_for_liveouts): Same.
	* sese.h (defined_in_sese_p): Same.
	* sreal.c (sreal::stream_out): Same.
	* sreal.h: Same.
	* streamer-hooks.h: Same.
	* target-globals.c (save_target_globals): Same.
	* target-globals.h: Same.
	* target.def: Same.
	* target.h: Same.
	* targhooks.c (default_has_ifunc_p): Same.
	(default_empty_mask_is_expensive): Same.
	(default_init_cost): Same.
	* targhooks.h: Same.
	* toplev.c: Same.
	* tree-affine.c (aff_combination_mult): Same.
	(aff_combination_expand): Same.
	(aff_combination_constant_multiple_p): Same.
	* tree-affine.h: Same.
	* tree-cfg.c (build_gimple_cfg): Same.
	(replace_loop_annotate_in_block): Same.
	(replace_uses_by): Same.
	(remove_bb): Same.
	(dump_cfg_stats): Same.
	(gimple_duplicate_sese_region): Same.
	(gimple_duplicate_sese_tail): Same.
	(move_block_to_fn): Same.
	(replace_block_vars_by_duplicates): Same.
	(move_sese_region_to_fn): Same.
	(print_loops_bb): Same.
	(print_loop): Same.
	(print_loops): Same.
	(debug): Same.
	(debug_loops): Same.
	* tree-cfg.h: Same.
	* tree-chrec.c (chrec_fold_plus_poly_poly): Same.
	(chrec_fold_multiply_poly_poly): Same.
	(chrec_evaluate): Same.
	(chrec_component_in_loop_num): Same.
	(reset_evolution_in_loop): Same.
	(is_multivariate_chrec): Same.
	(chrec_contains_symbols): Same.
	(nb_vars_in_chrec): Same.
	(chrec_convert_1): Same.
	(chrec_convert_aggressive): Same.
	* tree-chrec.h: Same.
	* tree-core.h: Same.
	* tree-data-ref.c (dump_data_dependence_relation): Same.
	(canonicalize_base_object_address): Same.
	(data_ref_compare_tree): Same.
	(prune_runtime_alias_test_list): Same.
	(get_segment_min_max): Same.
	(create_intersect_range_checks): Same.
	(conflict_fn_no_dependence): Same.
	(object_address_invariant_in_loop_p): Same.
	(analyze_ziv_subscript): Same.
	(analyze_siv_subscript_cst_affine): Same.
	(analyze_miv_subscript): Same.
	(analyze_overlapping_iterations): Same.
	(build_classic_dist_vector_1): Same.
	(add_other_self_distances): Same.
	(same_access_functions): Same.
	(build_classic_dir_vector): Same.
	(subscript_dependence_tester_1): Same.
	(subscript_dependence_tester): Same.
	(access_functions_are_affine_or_constant_p): Same.
	(get_references_in_stmt): Same.
	(loop_nest_has_data_refs): Same.
	(graphite_find_data_references_in_stmt): Same.
	(find_data_references_in_bb): Same.
	(get_base_for_alignment): Same.
	(find_loop_nest_1): Same.
	(find_loop_nest): Same.
	* tree-data-ref.h (dr_alignment): Same.
	(ddr_dependence_level): Same.
	* tree-if-conv.c (fold_build_cond_expr): Same.
	(add_to_predicate_list): Same.
	(add_to_dst_predicate_list): Same.
	(phi_convertible_by_degenerating_args): Same.
	(idx_within_array_bound): Same.
	(all_preds_critical_p): Same.
	(pred_blocks_visited_p): Same.
	(predicate_bbs): Same.
	(build_region): Same.
	(if_convertible_loop_p_1): Same.
	(is_cond_scalar_reduction): Same.
	(predicate_scalar_phi): Same.
	(remove_conditions_and_labels): Same.
	(combine_blocks): Same.
	(version_loop_for_if_conversion): Same.
	(versionable_outer_loop_p): Same.
	(ifcvt_local_dce): Same.
	(tree_if_conversion): Same.
	(pass_if_conversion::gate): Same.
	* tree-if-conv.h: Same.
	* tree-inline.c (maybe_move_debug_stmts_to_successors): Same.
	* tree-loop-distribution.c (bb_top_order_cmp): Same.
	(free_rdg): Same.
	(stmt_has_scalar_dependences_outside_loop): Same.
	(copy_loop_before): Same.
	(create_bb_after_loop): Same.
	(const_with_all_bytes_same): Same.
	(generate_memset_builtin): Same.
	(generate_memcpy_builtin): Same.
	(destroy_loop): Same.
	(build_rdg_partition_for_vertex): Same.
	(compute_access_range): Same.
	(data_ref_segment_size): Same.
	(latch_dominated_by_data_ref): Same.
	(compute_alias_check_pairs): Same.
	(fuse_memset_builtins): Same.
	(finalize_partitions): Same.
	(find_seed_stmts_for_distribution): Same.
	(prepare_perfect_loop_nest): Same.
	* tree-parloops.c (lambda_transform_legal_p): Same.
	(loop_parallel_p): Same.
	(reduc_stmt_res): Same.
	(add_field_for_name): Same.
	(create_call_for_reduction_1): Same.
	(replace_uses_in_bb_by): Same.
	(transform_to_exit_first_loop_alt): Same.
	(try_transform_to_exit_first_loop_alt): Same.
	(transform_to_exit_first_loop): Same.
	(num_phis): Same.
	(gen_parallel_loop): Same.
	(gather_scalar_reductions): Same.
	(get_omp_data_i_param): Same.
	(try_create_reduction_list): Same.
	(oacc_entry_exit_single_gang): Same.
	(parallelize_loops): Same.
	* tree-pass.h: Same.
	* tree-predcom.c (determine_offset): Same.
	(last_always_executed_block): Same.
	(split_data_refs_to_components): Same.
	(suitable_component_p): Same.
	(valid_initializer_p): Same.
	(find_looparound_phi): Same.
	(insert_looparound_copy): Same.
	(add_looparound_copies): Same.
	(determine_roots_comp): Same.
	(predcom_tmp_var): Same.
	(initialize_root_vars): Same.
	(initialize_root_vars_store_elim_1): Same.
	(initialize_root_vars_store_elim_2): Same.
	(finalize_eliminated_stores): Same.
	(initialize_root_vars_lm): Same.
	(remove_stmt): Same.
	(determine_unroll_factor): Same.
	(execute_pred_commoning_cbck): Same.
	(base_names_in_chain_on): Same.
	(combine_chains): Same.
	(pcom_stmt_dominates_stmt_p): Same.
	(try_combine_chains): Same.
	(prepare_initializers_chain_store_elim): Same.
	(prepare_initializers_chain): Same.
	(prepare_initializers): Same.
	(prepare_finalizers_chain): Same.
	(prepare_finalizers): Same.
	(insert_init_seqs): Same.
	* tree-scalar-evolution.c (loop_phi_node_p): Same.
	(compute_overall_effect_of_inner_loop): Same.
	(add_to_evolution_1): Same.
	(add_to_evolution): Same.
	(follow_ssa_edge_binary): Same.
	(follow_ssa_edge_expr): Same.
	(backedge_phi_arg_p): Same.
	(follow_ssa_edge_in_condition_phi_branch): Same.
	(follow_ssa_edge_in_condition_phi): Same.
	(follow_ssa_edge_inner_loop_phi): Same.
	(follow_ssa_edge): Same.
	(analyze_evolution_in_loop): Same.
	(analyze_initial_condition): Same.
	(interpret_loop_phi): Same.
	(interpret_condition_phi): Same.
	(interpret_rhs_expr): Same.
	(interpret_expr): Same.
	(interpret_gimple_assign): Same.
	(analyze_scalar_evolution_1): Same.
	(analyze_scalar_evolution): Same.
	(analyze_scalar_evolution_for_address_of): Same.
	(get_instantiated_value_entry): Same.
	(loop_closed_phi_def): Same.
	(instantiate_scev_name): Same.
	(instantiate_scev_poly): Same.
	(instantiate_scev_binary): Same.
	(instantiate_scev_convert): Same.
	(instantiate_scev_not): Same.
	(instantiate_scev_r): Same.
	(instantiate_scev): Same.
	(resolve_mixers): Same.
	(initialize_scalar_evolutions_analyzer): Same.
	(scev_reset_htab): Same.
	(scev_reset): Same.
	(derive_simple_iv_with_niters): Same.
	(simple_iv_with_niters): Same.
	(expression_expensive_p): Same.
	(final_value_replacement_loop): Same.
	* tree-scalar-evolution.h (block_before_loop): Same.
	* tree-ssa-address.h: Same.
	* tree-ssa-dce.c (find_obviously_necessary_stmts): Same.
	* tree-ssa-dom.c (edge_info::record_simple_equiv): Same.
	(record_edge_info): Same.
	* tree-ssa-live.c (var_map_base_fini): Same.
	(remove_unused_locals): Same.
	* tree-ssa-live.h: Same.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Same.
	(pass_ch_vect::execute): Same.
	(pass_ch::process_loop_p): Same.
	* tree-ssa-loop-im.c (mem_ref_hasher::hash): Same.
	(movement_possibility): Same.
	(outermost_invariant_loop): Same.
	(stmt_cost): Same.
	(determine_max_movement): Same.
	(invariantness_dom_walker::before_dom_children): Same.
	(move_computations): Same.
	(may_move_till): Same.
	(force_move_till_op): Same.
	(force_move_till): Same.
	(memref_free): Same.
	(record_mem_ref_loc): Same.
	(set_ref_stored_in_loop): Same.
	(mark_ref_stored): Same.
	(sort_bbs_in_loop_postorder_cmp): Same.
	(sort_locs_in_loop_postorder_cmp): Same.
	(analyze_memory_references): Same.
	(mem_refs_may_alias_p): Same.
	(find_ref_loc_in_loop_cmp): Same.
	(rewrite_mem_ref_loc::operator): Same.
	(first_mem_ref_loc_1::operator): Same.
	(sm_set_flag_if_changed::operator): Same.
	(execute_sm_if_changed_flag_set): Same.
	(execute_sm): Same.
	(hoist_memory_references): Same.
	(ref_always_accessed::operator): Same.
	(refs_independent_p): Same.
	(record_dep_loop): Same.
	(ref_indep_loop_p_1): Same.
	(ref_indep_loop_p): Same.
	(can_sm_ref_p): Same.
	(find_refs_for_sm): Same.
	(loop_suitable_for_sm): Same.
	(store_motion_loop): Same.
	(store_motion): Same.
	(fill_always_executed_in): Same.
	* tree-ssa-loop-ivcanon.c (constant_after_peeling): Same.
	(estimated_unrolled_size): Same.
	(loop_edge_to_cancel): Same.
	(remove_exits_and_undefined_stmts): Same.
	(remove_redundant_iv_tests): Same.
	(unloop_loops): Same.
	(estimated_peeled_sequence_size): Same.
	(try_peel_loop): Same.
	(canonicalize_loop_induction_variables): Same.
	(canonicalize_induction_variables): Same.
	* tree-ssa-loop-ivopts.c (iv_inv_expr_hasher::equal): Same.
	(name_info): Same.
	(stmt_after_inc_pos): Same.
	(contains_abnormal_ssa_name_p): Same.
	(niter_for_exit): Same.
	(find_bivs): Same.
	(mark_bivs): Same.
	(find_givs_in_bb): Same.
	(find_induction_variables): Same.
	(find_interesting_uses_cond): Same.
	(outermost_invariant_loop_for_expr): Same.
	(idx_find_step): Same.
	(add_candidate_1): Same.
	(add_iv_candidate_derived_from_uses): Same.
	(alloc_use_cost_map): Same.
	(prepare_decl_rtl): Same.
	(generic_predict_doloop_p): Same.
	(computation_cost): Same.
	(determine_common_wider_type): Same.
	(get_computation_aff_1): Same.
	(get_use_type): Same.
	(determine_group_iv_cost_address): Same.
	(iv_period): Same.
	(difference_cannot_overflow_p): Same.
	(may_eliminate_iv): Same.
	(determine_set_costs): Same.
	(cheaper_cost_pair): Same.
	(compare_cost_pair): Same.
	(iv_ca_cand_for_group): Same.
	(iv_ca_recount_cost): Same.
	(iv_ca_set_remove_invs): Same.
	(iv_ca_set_no_cp): Same.
	(iv_ca_set_add_invs): Same.
	(iv_ca_set_cp): Same.
	(iv_ca_add_group): Same.
	(iv_ca_cost): Same.
	(iv_ca_compare_deps): Same.
	(iv_ca_delta_reverse): Same.
	(iv_ca_delta_commit): Same.
	(iv_ca_cand_used_p): Same.
	(iv_ca_delta_free): Same.
	(iv_ca_new): Same.
	(iv_ca_free): Same.
	(iv_ca_dump): Same.
	(iv_ca_extend): Same.
	(iv_ca_narrow): Same.
	(iv_ca_prune): Same.
	(cheaper_cost_with_cand): Same.
	(iv_ca_replace): Same.
	(try_add_cand_for): Same.
	(get_initial_solution): Same.
	(try_improve_iv_set): Same.
	(find_optimal_iv_set_1): Same.
	(create_new_iv): Same.
	(rewrite_use_compare): Same.
	(remove_unused_ivs): Same.
	(determine_scaling_factor): Same.
	* tree-ssa-loop-ivopts.h: Same.
	* tree-ssa-loop-manip.c (create_iv): Same.
	(compute_live_loop_exits): Same.
	(add_exit_phi): Same.
	(add_exit_phis): Same.
	(find_uses_to_rename_use): Same.
	(find_uses_to_rename_def): Same.
	(find_uses_to_rename_in_loop): Same.
	(rewrite_into_loop_closed_ssa): Same.
	(check_loop_closed_ssa_bb): Same.
	(split_loop_exit_edge): Same.
	(ip_end_pos): Same.
	(ip_normal_pos): Same.
	(copy_phi_node_args): Same.
	(gimple_duplicate_loop_to_header_edge): Same.
	(can_unroll_loop_p): Same.
	(determine_exit_conditions): Same.
	(scale_dominated_blocks_in_loop): Same.
	(niter_for_unrolled_loop): Same.
	(tree_transform_and_unroll_loop): Same.
	(rewrite_all_phi_nodes_with_iv): Same.
	* tree-ssa-loop-manip.h: Same.
	* tree-ssa-loop-niter.c (number_of_iterations_ne_max): Same.
	(number_of_iterations_ne): Same.
	(assert_no_overflow_lt): Same.
	(assert_loop_rolls_lt): Same.
	(number_of_iterations_lt): Same.
	(adjust_cond_for_loop_until_wrap): Same.
	(tree_simplify_using_condition): Same.
	(simplify_using_initial_conditions): Same.
	(simplify_using_outer_evolutions): Same.
	(loop_only_exit_p): Same.
	(ssa_defined_by_minus_one_stmt_p): Same.
	(number_of_iterations_popcount): Same.
	(number_of_iterations_exit): Same.
	(find_loop_niter): Same.
	(finite_loop_p): Same.
	(chain_of_csts_start): Same.
	(get_val_for): Same.
	(loop_niter_by_eval): Same.
	(derive_constant_upper_bound_ops): Same.
	(do_warn_aggressive_loop_optimizations): Same.
	(record_estimate): Same.
	(get_cst_init_from_scev): Same.
	(record_nonwrapping_iv): Same.
	(idx_infer_loop_bounds): Same.
	(infer_loop_bounds_from_ref): Same.
	(infer_loop_bounds_from_array): Same.
	(infer_loop_bounds_from_pointer_arith): Same.
	(infer_loop_bounds_from_signedness): Same.
	(bound_index): Same.
	(discover_iteration_bound_by_body_walk): Same.
	(maybe_lower_iteration_bound): Same.
	(estimate_numbers_of_iterations): Same.
	(estimated_loop_iterations): Same.
	(estimated_loop_iterations_int): Same.
	(max_loop_iterations): Same.
	(max_loop_iterations_int): Same.
	(likely_max_loop_iterations): Same.
	(likely_max_loop_iterations_int): Same.
	(estimated_stmt_executions_int): Same.
	(max_stmt_executions): Same.
	(likely_max_stmt_executions): Same.
	(estimated_stmt_executions): Same.
	(stmt_dominates_stmt_p): Same.
	(nowrap_type_p): Same.
	(loop_exits_before_overflow): Same.
	(scev_var_range_cant_overflow): Same.
	(scev_probably_wraps_p): Same.
	(free_numbers_of_iterations_estimates): Same.
	* tree-ssa-loop-niter.h: Same.
	* tree-ssa-loop-prefetch.c (release_mem_refs): Same.
	(idx_analyze_ref): Same.
	(analyze_ref): Same.
	(gather_memory_references_ref): Same.
	(mark_nontemporal_store): Same.
	(emit_mfence_after_loop): Same.
	(may_use_storent_in_loop_p): Same.
	(mark_nontemporal_stores): Same.
	(should_unroll_loop_p): Same.
	(volume_of_dist_vector): Same.
	(add_subscript_strides): Same.
	(self_reuse_distance): Same.
	(insn_to_prefetch_ratio_too_small_p): Same.
	* tree-ssa-loop-split.c (split_at_bb_p): Same.
	(patch_loop_exit): Same.
	(find_or_create_guard_phi): Same.
	(easy_exit_values): Same.
	(connect_loop_phis): Same.
	(connect_loops): Same.
	(compute_new_first_bound): Same.
	(split_loop): Same.
	(tree_ssa_split_loops): Same.
	* tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Same.
	(is_maybe_undefined): Same.
	(tree_may_unswitch_on): Same.
	(simplify_using_entry_checks): Same.
	(tree_unswitch_single_loop): Same.
	(tree_unswitch_loop): Same.
	(tree_unswitch_outer_loop): Same.
	(empty_bb_without_guard_p): Same.
	(used_outside_loop_p): Same.
	(get_vop_from_header): Same.
	(hoist_guard): Same.
	* tree-ssa-loop.c (gate_oacc_kernels): Same.
	(get_lsm_tmp_name): Same.
	* tree-ssa-loop.h: Same.
	* tree-ssa-reassoc.c (add_repeat_to_ops_vec): Same.
	(build_and_add_sum): Same.
	(no_side_effect_bb): Same.
	(get_ops): Same.
	(linearize_expr): Same.
	(should_break_up_subtract): Same.
	(linearize_expr_tree): Same.
	* tree-ssa-scopedtables.c: Same.
	* tree-ssa-scopedtables.h: Same.
	* tree-ssa-structalias.c (condense_visit): Same.
	(label_visit): Same.
	(dump_pred_graph): Same.
	(perform_var_substitution): Same.
	(move_complex_constraints): Same.
	(remove_preds_and_fake_succs): Same.
	* tree-ssa-threadupdate.c (dbds_continue_enumeration_p): Same.
	(determine_bb_domination_status): Same.
	(duplicate_thread_path): Same.
	(thread_through_all_blocks): Same.
	* tree-ssa-threadupdate.h: Same.
	* tree-streamer-in.c (streamer_read_string_cst): Same.
	(input_identifier): Same.
	(unpack_ts_type_common_value_fields): Same.
	(unpack_ts_block_value_fields): Same.
	(unpack_ts_translation_unit_decl_value_fields): Same.
	(unpack_ts_omp_clause_value_fields): Same.
	(streamer_read_tree_bitfields): Same.
	(streamer_alloc_tree): Same.
	(lto_input_ts_common_tree_pointers): Same.
	(lto_input_ts_vector_tree_pointers): Same.
	(lto_input_ts_poly_tree_pointers): Same.
	(lto_input_ts_complex_tree_pointers): Same.
	(lto_input_ts_decl_minimal_tree_pointers): Same.
	(lto_input_ts_decl_common_tree_pointers): Same.
	(lto_input_ts_decl_non_common_tree_pointers): Same.
	(lto_input_ts_decl_with_vis_tree_pointers): Same.
	(lto_input_ts_field_decl_tree_pointers): Same.
	(lto_input_ts_function_decl_tree_pointers): Same.
	(lto_input_ts_type_common_tree_pointers): Same.
	(lto_input_ts_type_non_common_tree_pointers): Same.
	(lto_input_ts_list_tree_pointers): Same.
	(lto_input_ts_vec_tree_pointers): Same.
	(lto_input_ts_exp_tree_pointers): Same.
	(lto_input_ts_block_tree_pointers): Same.
	(lto_input_ts_binfo_tree_pointers): Same.
	(lto_input_ts_constructor_tree_pointers): Same.
	(lto_input_ts_omp_clause_tree_pointers): Same.
	(streamer_read_tree_body): Same.
	* tree-streamer.h: Same.
	* tree-switch-conversion.c (bit_test_cluster::is_beneficial): Same.
	* tree-vect-data-refs.c (vect_get_smallest_scalar_type): Same.
	(vect_analyze_possibly_independent_ddr): Same.
	(vect_analyze_data_ref_dependence): Same.
	(vect_compute_data_ref_alignment): Same.
	(vect_enhance_data_refs_alignment): Same.
	(vect_analyze_data_ref_access): Same.
	(vect_check_gather_scatter): Same.
	(vect_find_stmt_data_reference): Same.
	(vect_create_addr_base_for_vector_ref): Same.
	(vect_setup_realignment): Same.
	(vect_supportable_dr_alignment): Same.
	* tree-vect-loop-manip.c (rename_variables_in_bb): Same.
	(adjust_phi_and_debug_stmts): Same.
	(vect_set_loop_mask): Same.
	(add_preheader_seq): Same.
	(vect_maybe_permute_loop_masks): Same.
	(vect_set_loop_masks_directly): Same.
	(vect_set_loop_condition_masked): Same.
	(vect_set_loop_condition_unmasked): Same.
	(slpeel_duplicate_current_defs_from_edges): Same.
	(slpeel_add_loop_guard): Same.
	(slpeel_can_duplicate_loop_p): Same.
	(create_lcssa_for_virtual_phi): Same.
	(iv_phi_p): Same.
	(vect_update_ivs_after_vectorizer): Same.
	(vect_gen_vector_loop_niters_mult_vf): Same.
	(slpeel_update_phi_nodes_for_loops): Same.
	(slpeel_update_phi_nodes_for_guard1): Same.
	(find_guard_arg): Same.
	(slpeel_update_phi_nodes_for_guard2): Same.
	(slpeel_update_phi_nodes_for_lcssa): Same.
	(vect_do_peeling): Same.
	(vect_create_cond_for_alias_checks): Same.
	(vect_loop_versioning): Same.
	* tree-vect-loop.c (vect_determine_vf_for_stmt): Same.
	(vect_inner_phi_in_double_reduction_p): Same.
	(vect_analyze_scalar_cycles_1): Same.
	(vect_fixup_scalar_cycles_with_patterns): Same.
	(vect_get_loop_niters): Same.
	(bb_in_loop_p): Same.
	(vect_get_max_nscalars_per_iter): Same.
	(vect_verify_full_masking): Same.
	(vect_compute_single_scalar_iteration_cost): Same.
	(vect_analyze_loop_form_1): Same.
	(vect_analyze_loop_form): Same.
	(vect_active_double_reduction_p): Same.
	(vect_analyze_loop_operations): Same.
	(neutral_op_for_slp_reduction): Same.
	(vect_is_simple_reduction): Same.
	(vect_model_reduction_cost): Same.
	(get_initial_def_for_reduction): Same.
	(get_initial_defs_for_reduction): Same.
	(vect_create_epilog_for_reduction): Same.
	(vectorize_fold_left_reduction): Same.
	(vectorizable_reduction): Same.
	(vectorizable_induction): Same.
	(vectorizable_live_operation): Same.
	(loop_niters_no_overflow): Same.
	(vect_get_loop_mask): Same.
	(vect_transform_loop_stmt): Same.
	(vect_transform_loop): Same.
	* tree-vect-patterns.c (vect_reassociating_reduction_p): Same.
	(vect_determine_precisions): Same.
	(vect_pattern_recog_1): Same.
	* tree-vect-slp.c (vect_analyze_slp_instance): Same.
	* tree-vect-stmts.c (stmt_vectype): Same.
	(process_use): Same.
	(vect_init_vector_1): Same.
	(vect_truncate_gather_scatter_offset): Same.
	(get_group_load_store_type): Same.
	(vect_build_gather_load_calls): Same.
	(vect_get_strided_load_store_ops): Same.
	(vectorizable_simd_clone_call): Same.
	(vectorizable_store): Same.
	(permute_vec_elements): Same.
	(vectorizable_load): Same.
	(vect_transform_stmt): Same.
	(supportable_widening_operation): Same.
	* tree-vectorizer.c (vec_info::replace_stmt): Same.
	(vec_info::free_stmt_vec_info): Same.
	(vect_free_loop_info_assumptions): Same.
	(vect_loop_vectorized_call): Same.
	(set_uid_loop_bbs): Same.
	(vectorize_loops): Same.
	* tree-vectorizer.h (STMT_VINFO_BB_VINFO): Same.
	* tree.c (add_tree_to_fld_list): Same.
	(fld_type_variant_equal_p): Same.
	(fld_decl_context): Same.
	(fld_incomplete_type_of): Same.
	(free_lang_data_in_binfo): Same.
	(need_assembler_name_p): Same.
	(find_decls_types_r): Same.
	(get_eh_types_for_runtime): Same.
	(find_decls_types_in_eh_region): Same.
	(find_decls_types_in_node): Same.
	(assign_assembler_name_if_needed): Same.
	* value-prof.c (stream_out_histogram_value): Same.
	* value-prof.h: Same.
	* var-tracking.c (use_narrower_mode): Same.
	(prepare_call_arguments): Same.
	(vt_expand_loc_callback): Same.
	(resolve_expansions_pending_recursion): Same.
	(vt_expand_loc): Same.
	* varasm.c (const_hash_1): Same.
	(compare_constant): Same.
	(tree_output_constant_def): Same.
	(simplify_subtraction): Same.
	(get_pool_constant): Same.
	(output_constant_pool_2): Same.
	(output_constant_pool_1): Same.
	(mark_constants_in_pattern): Same.
	(mark_constant_pool): Same.
	(get_section_anchor): Same.
	* vr-values.c (compare_range_with_value): Same.
	(vr_values::extract_range_from_phi_node): Same.
	* vr-values.h: Same.
	* web.c (unionfind_union): Same.
	* wide-int.h: Same.

From-SVN: r273311
2019-07-09 12:32:49 -06:00
Qing Zhao 1c6ffbab63 re PR preprocessor/90581 (provide an option to adjust the maximum depth of nested #include)
PR preprocessor/90581
Add a cpp option -fmax-include-depth to set the maximum depth of the nested #include.

From-SVN: r272948
2019-07-02 20:23:30 +00:00
Nathan Sidwell d7b6aee8cd [libcpp] Reimplement mkdeps data structures
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00293.html
	* include/mkdeps.h (deps_write): Add PHONY arg.
	(deps_phony_targets): Delete.
	* init.c (cpp_finish): Just call deps_write.
	* mkdeps.c (struct mkdeps): Add local vector class.  Reimplement
	vector handling.
	(munge): Munge to static buffer.
	(apply_vpath): Adjust vector handling.
	(deps_init, deps_free): Use new, delete.
	(deps_add_target): Do not munge here.  Record quoting low water mark.
	(deps_add_dep): Do not munge here.
	(deps_add_vpath): Adjust vector handling.
	(make_write_name): New.  Munge on demand here.
	(make_write_vec): New.
	(deps_phony_targets): Delete.
	(make_write): New.
	(deps_write): Forward to deps_Write.
	(deps_save, deps_restore): Adjust vector handling.

From-SVN: r270943
2019-05-07 12:39:59 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
David Malcolm 620e594be5 Eliminate source_location in favor of location_t
Historically GCC used location_t, while libcpp used source_location.

This inconsistency has been annoying me for a while, so this patch
removes source_location in favor of location_t throughout
(as the latter is shorter).

gcc/ChangeLog:
	* builtins.c: Replace "source_location" with "location_t".
	* diagnostic-show-locus.c: Likewise.
	* diagnostic.c: Likewise.
	* dumpfile.c: Likewise.
	* gcc-rich-location.h: Likewise.
	* genmatch.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* input.c: Likewise.
	* input.h: Likewise.  Eliminate the typedef.
	* omp-expand.c: Likewise.
	* selftest.h: Likewise.
	* substring-locations.h (get_source_location_for_substring):
	Rename to..
	(get_location_within_string): ...this.
	* tree-cfg.c: Replace "source_location" with "location_t".
	* tree-cfgcleanup.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-phinodes.h: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssa.h: Likewise.
	* tree-vect-loop-manip.c: Likewise.

gcc/c-family/ChangeLog:
	* c-common.c (c_get_substring_location): Update for renaming of
	get_source_location_for_substring to get_location_within_string.
	* c-lex.c: Replace "source_location" with "location_t".
	* c-opts.c: Likewise.
	* c-ppoutput.c: Likewise.

gcc/c/ChangeLog:
	* c-decl.c: Replace "source_location" with "location_t".
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.
	* gimple-parser.c: Likewise.

gcc/cp/ChangeLog:
	* call.c: Replace "source_location" with "location_t".
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* typeck.c: Likewise.

gcc/fortran/ChangeLog:
	* cpp.c: Replace "source_location" with "location_t".
	* gfortran.h: Likewise.

gcc/go/ChangeLog:
	* go-gcc-diagnostics.cc: Replace "source_location" with "location_t".
	* go-gcc.cc: Likewise.
	* go-linemap.cc: Likewise.
	* go-location.h: Likewise.
	* gofrontend/README: Likewise.

gcc/jit/ChangeLog:
	* jit-playback.c: Replace "source_location" with "location_t".

gcc/testsuite/ChangeLog:
	* g++.dg/plugin/comment_plugin.c: Replace "source_location" with
	"location_t".
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Likewise.

libcc1/ChangeLog:
	* libcc1plugin.cc: Replace "source_location" with "location_t".
	(plugin_context::get_source_location): Rename to...
	(plugin_context::get_location_t): ...this.
	* libcp1plugin.cc: Likewise.

libcpp/ChangeLog:
	* charset.c: Replace "source_location" with "location_t".
	* directives-only.c: Likewise.
	* directives.c: Likewise.
	* errors.c: Likewise.
	* expr.c: Likewise.
	* files.c: Likewise.
	* include/cpplib.h: Likewise.  Rename MAX_SOURCE_LOCATION to
	MAX_LOCATION_T.
	* include/line-map.h: Likewise.
	* init.c: Likewise.
	* internal.h: Likewise.
	* lex.c: Likewise.
	* line-map.c: Likewise.
	* location-example.txt: Likewise.
	* macro.c: Likewise.
	* pch.c: Likewise.
	* traditional.c: Likewise.

From-SVN: r266085
2018-11-13 20:05:03 +00:00
Nathan Sidwell f3f6029db2 [6/6] Preprocessor forced macro location
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02044.html
	libcpp/
	* internal.h (struct cpp_reader): Rename forced_token_location_p
	to forced_token_location and drop its pointerness.
	* include/cpplib.h (cpp_force_token_locations): Take location, not
	pointer to one.
	* init.c (cpp_create_reader): Adjust.
	* lex.c (cpp_read_main_file): 

	gcc/c-family/
	* c-opts.c (c_finish_options): Adjust cpp_force_token_locations call.

	gcc/fortran/
	* cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.

From-SVN: r265692
2018-10-31 15:26:28 +00:00
Joseph Myers 9f936c8613 Add -std=c2x, -std=gnu2x, -Wc11-c2x-compat, C2X _Static_assert support.
Now new features are starting to be added to a C2X draft (in the C2x
branch of the C standard git repository, no public WG14 document yet),
it's time to add -std=c2x and associated options to GCC for use in
enabling C2X features.

This patch adds the expected set of options: -std=c2x, -std=gnu2x,
-Wc11-c2x-compat.  A first C2X feature is added (the only one so far
in the repository that's obviously relevant to GCC): support (as in
C++) for the string constant to be omitted in _Static_assert.  This
feature is duly also supported as an extension in earlier standard
modes (diagnosed with -pedantic, unless -Wno-c11-c2x-compat is given,
or with -Wc11-c2x-compat even in C2X mode).

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

gcc/
	* doc/cpp.texi (__STDC_VERSION__): Document C2X handling.
	* doc/invoke.texi (-std=c2x, -std=gnu2x): Document new options.
	* doc/standards.texi (C Language): Document C2X.
	* dwarf2out.c (highest_c_language), config/rl78/rl78.c
	(rl78_option_override): Handle "GNU C2X" language name.

gcc/c/
	* c-errors.c (pedwarn_c11): New function.
	* c-parser.c (disable_extension_diagnostics): Save
	warn_c11_c2x_compat and set it to 0.
	(restore_extension_diagnostics): Restore warn_c11_c2x_compat.
	(c_parser_static_assert_declaration_no_semi): Handle
	_Static_assert without string constant.
	* c-tree.h (pedwarn_c11): New prototype.

gcc/c-family/
	* c-common.c (flag_isoc2x): New variable.
	* c-common.h (clk_c): Update comment to reference C2X.
	(flag_isoc99, flag_isoc11): Update comments to reference future
	standard versions in general.
	(flag_isoc2x): Declare.
	* c-opts.c (set_std_c2x): New function.
	(c_common_handle_option): Handle -std=c2x and -std=gnu2x.
	(set_std_c89, set_std_c99, set_std_c11, set_std_c17): Set
	flag_isoc2x to 0.
	* c.opt (Wc11-c2x-compat, std=c2x, std=gnu2x): New options.

gcc/testsuite/
	* gcc.dg/c11-static-assert-7.c, gcc.dg/c11-static-assert-8.c,
	gcc.dg/c11-static-assert-9.c, gcc.dg/c2x-static-assert-1.c,
	gcc.dg/c2x-static-assert-2.c, gcc.dg/c99-static-assert-2.c,
	gcc.dg/gnu2x-static-assert-1.c: New tests.
	* gcc.dg/missing-symbol-3.c: Update expected fix-it text.

libcpp/
	* include/cpplib.h (enum c_lang): Add CLK_GNUC2X and CLK_STDC2X.
	* init.c (lang_defaults): Add GNUC2X and STDC2X entries.
	(cpp_init_builtins): Define __STDC_VERSION__ to 202000L for C2X.

From-SVN: r265251
2018-10-18 00:58:54 +01:00
Nathan Sidwell a570d97f5b [CPP PATCH] node type
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01164.html
	* include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
	Renumber others.
	(enum node_type): Replace NT_MACRO with NT_USER_MACRO,
	NT_BUILTIN_MACRO, NT_MACRO_ARG.  Delete NT_ASSERTION.
	(NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
	Delete.
	(CPP_HASHNODE_VALUE_IDX): Delete.
	(union _cpp_hashnode_value): GTY tag from enum node_type directly.
	(struct cpp_hashnode): Adjust GTY desc for value field.
	(cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
	* directives.c (undefine_macros): Clear value.anwers, adjust flag
	clearing.
	(_cpp_test_assertion): No need to check NT_ASSERTION.
	(do_assert, do_unassert): Likewise.
	* init.c (cpp_init_special_builtins): Set type not flags.
	* macro.c (struct macro_arg_saved_data): Add type field.
	(cpp_get_token_1): Check type not NT_VOID.
	(_cpp_free_definition): Adjust flag clearing.  Nullify
	value.answers.
	(_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
	type.
	(lex_expansion_token): Check type not flags.
	(_cpp_create_definition): Set type to NT_USER_MACRO.
	(_cpp_notify_macro_use): Adjust type checking.
	* pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
	(save_macros): Adjust node type/flag handling.
	* traditional.c (_cpp_scan_out_logical_line): Check type not flags.

From-SVN: r263667
2018-08-20 16:32:29 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Tom Tromey fb771b9dad Implement __VA_OPT__
This implements __VA_OPT__, a new preprocessor feature added in C++2A.
The paper can be found here:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0306r4.html

gcc/ChangeLog

        * doc/cpp.texi (Variadic Macros): Document __VA_OPT__.

gcc/testsuite/ChangeLog

        * c-c++-common/cpp/va-opt-pedantic.c: New file.
        * c-c++-common/cpp/va-opt.c: New file.
        * c-c++-common/cpp/va-opt-error.c: New file.

libcpp/ChangeLog

        * pch.c (cpp_read_state): Set n__VA_OPT__.
        * macro.c (vaopt_state): New class.
        (_cpp_arguments_ok): Check va_opt flag.
        (replace_args, create_iso_definition): Use vaopt_state.
        * lex.c (lex_identifier_intern): Possibly issue errors for
        __VA_OPT__.
        (lex_identifier): Likewise.
        (maybe_va_opt_error): New function.
        * internal.h (struct lexer_state) <va_args_ok>: Update comment.
        (struct spec_nodes) <n__VA_OPT__>: New field.
        * init.c (struct lang_flags) <va_opt>: New field.
        (lang_defaults): Add entries for C++2A.  Update all entries for
        va_opt.
        (cpp_set_lang): Initialize va_opt.
        * include/cpplib.h (struct cpp_options) <va_opt>: New field.
        * identifiers.c (_cpp_init_hashtable): Initialize n__VA_OPT__.

From-SVN: r254707
2017-11-13 20:17:42 +00:00
Joseph Myers c76dc9c32d Add -std=c17, -std=gnu17.
C17, a bug-fix version of the C11 standard with DR resolutions
integrated, will soon go to ballot.  This patch adds corresponding
options -std=c17, -std=gnu17 (new default version, replacing
-std=gnu11 as the default), -std=iso9899:2017.  As a bug-fix version
of the standard, there is no need for flag_isoc17 or any options for
compatibility warnings; however, there is a new __STDC_VERSION__
value, so new cpplib languages CLK_GNUC17 and CLK_STDC17 are added to
support using that new value with the new options.  (If the standard
ends up being published in 2018 and being known as C18, option aliases
can be added.  Note however that -std=iso9899:199409 corresponds to a
__STDC_VERSION__ value rather than a publication date.)

(There are a couple of DR resolutions needing implementing in GCC, but
that's independent of the new options.)

(I'd propose to add -std=c2x / -std=gnu2x / -Wc11-c2x-compat for the
next major C standard revision once there are actually C2x drafts
being issued with new features included.)

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc:
	* doc/invoke.texi (C Dialect Options): Document -std=c17,
	-std=iso9899:2017 and -std=gnu17.
	* doc/standards.texi (C Language): Document C17 support.
	* doc/cpp.texi (Overview): Mention -std=c17.
	(Standard Predefined Macros): Document C11 and C17 values of
	__STDC_VERSION__.  Do not refer to C99 support as incomplete.
	* doc/extend.texi (Inline): Do not list individual options for
	standards newer than C99.
	* dwarf2out.c (highest_c_language, gen_compile_unit_die): Handle
	"GNU C17".
	* config/rl78/rl78.c (rl78_option_override): Handle "GNU C17"
	language name.

gcc/c-family:
	* c.opt (std=c17, std=gnu17, std=iso9899:2017): New options.
	* c-opts.c (set_std_c17): New function.
	(c_common_init_options): Use gnu17 as default C version.
	(c_common_handle_option): Handle -std=c17 and -std=gnu17.

gcc/testsuite:
	* gcc.dg/c17-version-1.c, gcc.dg/c17-version-2.c: New tests.

libcpp:
	* include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
	* init.c (lang_defaults): Add GNUC17 and STDC17 data.
	(cpp_init_builtins): Handle C17 value of __STDC_VERSION__.

From-SVN: r254216
2017-10-30 12:17:40 +00:00
Andrew Sutton 026a79f70c Add support for -std=c++2a.
* c-common.h (cxx_dialect): Add cxx2a as a dialect.
	* opt.c: Add options for -std=c++2a and -std=gnu++2a.
	* c-opts.c (set_std_cxx2a): New.
	(c_common_handle_option): Set options when -std=c++2a is enabled.
	(c_common_post_options): Adjust comments.
	(set_std_cxx14, set_std_cxx17): Likewise.

	* doc/cpp.texi (__cplusplus): Document value for -std=c++2a
	or -std=gnu+2a.
	* doc/invoke.texi: Document -std=c++2a and -std=gnu++2a.

	* lib/target-supports.exp (check_effective_target_c++17): Return
	1 also if check_effective_target_c++2a.
	(check_effective_target_c++17_down): New.
	(check_effective_target_c++2a_only): New.
	(check_effective_target_c++2a): New.
	* g++.dg/cpp2a/cplusplus.C: New.

	* include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
	* init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
	(cpp_init_builtins): Set __cplusplus to 201709L for C++2a.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r252850
2017-09-15 23:16:37 +02:00
Jakub Jelinek 7b9361409d invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated.
* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
	c++1z and gnu++1z as deprecated.  Change other references to
	-std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17.
	Change -Wc++1z-compat to -Wc++17-compat.
	* doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L.
	* dwarf2out.c (highest_c_language): Handle C++17.
	(gen_compile_unit_die): Likewise.
c-family/
	* c.opt (Wc++1z-compat): Change from option to undocumented alias.
	(Wc++17-compat): Change from undocumented alias to option.
	(Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat,
	change C++1z to C++17 in description.
	(std=c++1z, std=gnu++1z): Change from option to undocumented
	deprecated alias.
	(std=c++17, std=gnu++17): Change from undocumented alias to option.
	Adjust description.
	* c-common.h (enum cxx_dialect): Rename cxx1z to cxx17.
	* c-opts.c (set_std_cxx1z): Rename to ...
	(set_std_cxx17): ... this.
	(c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17
	and OPT_std_gnu__1z to OPT_std_gnu__17.  Adjust set_std_cxx1z
	caller.  
	(c_common_post_options): Use cxx17 instead of cxx1z.  Adjust
	comments.
cp/
	* decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
	adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
	to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
	(cxx_init_decl_processing, next_initializable_field,
	is_direct_enum_init, check_initializer, cp_finish_decl,
	mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
	finish_function): Likewise.
	* cp-tree.h (DECL_INLINE_VAR_P): Likewise.
	* pt.c (mark_template_parm, convert_nontype_argument,
	instantiate_class_template_1, type_unification_real, unify,
	get_partial_spec_bindings, dependent_type_p_r): Likewise.
	* typeck.c (cp_build_unary_op): Likewise.
	* constexpr.c (var_in_maybe_constexpr_fn): Likewise.
	* call.c (build_user_type_conversion_1, build_over_call,
	build_special_member_call): Likewise.
	* lambda.c (begin_lambda_type): Likewise.
	* typeck2.c (process_init_constructor_record): Likewise.
	* class.c (build_base_field, finalize_literal_type_property,
	explain_non_literal_class): Likewise.
	* parser.c (cp_parser_diagnose_invalid_type_name,
	cp_parser_primary_expression, cp_parser_lambda_introducer,
	cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
	cp_convert_range_for, cp_parser_perform_range_for_lookup,
	cp_parser_decomposition_declaration, cp_parser_linkage_specification,
	cp_parser_static_assert, cp_parser_simple_type_specifier,
	cp_parser_namespace_definition, cp_parser_using_declaration,
	cp_parser_init_declarator, cp_parser_type_parameter_key,
	cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
	cp_parser_constructor_declarator_p): Likewise.
	* mangle.c (struct globals): Rename need_cxx1z_warning to
	need_cxx17_warning.
	(write_exception_spec, start_mangling, mangle_decl): Likewise.
	* Make-lang.in (check-c++1z): Rename to check-c++17, depend on
	it.
	(check-c++17): New goal.  Use 17 instead of 1z.
	(check-c++-all): Use 17 instead of 1z.
testsuite/
	* lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z.
	* lib/target-supports.exp (check_effective_target_c++14): Use
	check_effective_target_c++17 instead of check_effective_target_c++1z.
	(check_effective_target_c++14_down): Likewise.
	(check_effective_target_c++1z_only): Rename to ...
	(check_effective_target_c++17_only): ... this.
	(check_effective_target_c++1z): Rename to ...
	(check_effective_target_c++17): ... this.
	* g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17
	instead of -std=c++1z or -std=gnu++1z.  Use c++17 instead of c++1z
	and c++17_only instead of c++1z_only.  Adjust expected diagnostics
	and comments refering to 1z to 17.
	* g++.dg/debug/dwarf2/inline-var-2.C: Likewise.
	* g++.dg/template/partial5.C: Likewise.
	* g++.dg/template/nontype8.C: Likewise.
	* g++.dg/cpp1z/noexcept-type5.C: Likewise.
	* g++.dg/cpp1z/nontype3a.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda4.C: Likewise.
	* g++.dg/cpp1z/noexcept-type16.C: Likewise.
	* g++.dg/cpp1z/class-deduction32.C: Likewise.
	* g++.dg/cpp1z/pr78771.C: Likewise.
	* g++.dg/cpp1z/elide1.C: Likewise.
	* g++.dg/cpp1z/fold3.C: Likewise.
	* g++.dg/cpp1z/class-deduction2.C: Likewise.
	* g++.dg/cpp1z/noexcept-type12.C: Likewise.
	* g++.dg/cpp1z/inline-var2.C: Likewise.
	* g++.dg/cpp1z/eval-order2.C: Likewise.
	* g++.dg/cpp1z/decomp21.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda9.C: Likewise.
	* g++.dg/cpp1z/utf8-neg.C: Likewise.
	* g++.dg/cpp1z/class-deduction41.C: Likewise.
	* g++.dg/cpp1z/class-deduction23.C: Likewise.
	* g++.dg/cpp1z/nodiscard3.C: Likewise.
	* g++.dg/cpp1z/static_assert-nomsg.C: Likewise.
	* g++.dg/cpp1z/noexcept-type9.C: Likewise.
	* g++.dg/cpp1z/class-deduction21.C: Likewise.
	* g++.dg/cpp1z/range-for1.C: Likewise.
	* g++.dg/cpp1z/init-statement4.C: Likewise.
	* g++.dg/cpp1z/udlit-utf8char.C: Likewise.
	* g++.dg/cpp1z/decomp30.C: Likewise.
	* g++.dg/cpp1z/class-deduction39.C: Likewise.
	* g++.dg/cpp1z/register2.C: Likewise.
	* g++.dg/cpp1z/decomp9.C: Likewise.
	* g++.dg/cpp1z/regress1.C: Likewise.
	* g++.dg/cpp1z/direct-enum-init1.C: Likewise.
	* g++.dg/cpp1z/class-deduction30.C: Likewise.
	* g++.dg/cpp1z/abbrev2.C: Likewise.
	* g++.dg/cpp1z/nontype-auto6.C: Likewise.
	* g++.dg/cpp1z/regress2.C: Likewise.
	* g++.dg/cpp1z/decomp16.C: Likewise.
	* g++.dg/cpp1z/bool-increment1.C: Likewise.
	* g++.dg/cpp1z/aligned-new1.C: Likewise.
	* g++.dg/cpp1z/decomp3.C: Likewise.
	* g++.dg/cpp1z/register1.C: Likewise.
	* g++.dg/cpp1z/namespace-attribs.C: Likewise.
	* g++.dg/cpp1z/class-deduction1.C: Likewise.
	* g++.dg/cpp1z/decomp10.C: Likewise.
	* g++.dg/cpp1z/constexpr-if11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda10.C: Likewise.
	* g++.dg/cpp1z/decomp27.C: Likewise.
	* g++.dg/cpp1z/noexcept-type2.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
	* g++.dg/cpp1z/class-deduction9.C: Likewise.
	* g++.dg/cpp1z/attributes-enum-1.C: Likewise.
	* g++.dg/cpp1z/decomp11.C: Likewise.
	* g++.dg/cpp1z/aligned-new3.C: Likewise.
	* g++.dg/cpp1z/utf8-2.C: Likewise.
	* g++.dg/cpp1z/lambda-this3.C: Likewise.
	* g++.dg/cpp1z/decomp-constexpr1.C: Likewise.
	* g++.dg/cpp1z/byte1.C: Likewise.
	* g++.dg/cpp1z/nontype-auto9.C: Likewise.
	* g++.dg/cpp1z/aggr-base4.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda1.C: Likewise.
	* g++.dg/cpp1z/nontype-auto3.C: Likewise.
	* g++.dg/cpp1z/utf8-2a.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda7.C: Likewise.
	* g++.dg/cpp1z/aggr-base6.C: Likewise.
	* g++.dg/cpp1z/cplusplus.C: Likewise.
	* g++.dg/cpp1z/class-deduction20.C: Likewise.
	* g++.dg/cpp1z/aggr-base2.C: Likewise.
	* g++.dg/cpp1z/class-deduction6.C: Likewise.
	* g++.dg/cpp1z/noexcept-type3.C: Likewise.
	* g++.dg/cpp1z/class-deduction31.C: Likewise.
	* g++.dg/cpp1z/class-deduction25.C: Likewise.
	* g++.dg/cpp1z/class-deduction18.C: Likewise.
	* g++.dg/cpp1z/fold9.C: Likewise.
	* g++.dg/cpp1z/noexcept-type8.C: Likewise.
	* g++.dg/cpp1z/abbrev1.C: Likewise.
	* g++.dg/cpp1z/constexpr-if10.C: Likewise.
	* g++.dg/cpp1z/utf8.C: Likewise.
	* g++.dg/cpp1z/noexcept-type7.C: Likewise.
	* g++.dg/cpp1z/aggr-base3.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
	* g++.dg/cpp1z/init-statement2.C: Likewise.
	* g++.dg/cpp1z/nontype-auto4.C: Likewise.
	* g++.dg/cpp1z/constexpr-if12.C: Likewise.
	* g++.dg/cpp1z/class-deduction40.C: Likewise.
	* g++.dg/cpp1z/nontype3.C: Likewise.
	* g++.dg/cpp1z/class-deduction14.C: Likewise.
	* g++.dg/cpp1z/fold7.C: Likewise.
	* g++.dg/cpp1z/nontype2.C: Likewise.
	* g++.dg/cpp1z/class-deduction15.C: Likewise.
	* g++.dg/cpp1z/nested-namespace-def1.C: Likewise.
	* g++.dg/cpp1z/class-deduction13.C: Likewise.
	* g++.dg/cpp1z/aligned-new7.C: Likewise.
	* g++.dg/cpp1z/noexcept-type1.C: Likewise.
	* g++.dg/cpp1z/nontype1.C: Likewise.
	* g++.dg/cpp1z/init-statement5.C: Likewise.
	* g++.dg/cpp1z/nontype-auto2.C: Likewise.
	* g++.dg/cpp1z/decomp17.C: Likewise.
	* g++.dg/cpp1z/fold4.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda2.C: Likewise.
	* g++.dg/cpp1z/fold7a.C: Likewise.
	* g++.dg/cpp1z/nontype-auto5.C: Likewise.
	* g++.dg/cpp1z/init-statement7.C: Likewise.
	* g++.dg/cpp1z/aggr-base5.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda5.C: Likewise.
	* g++.dg/cpp1z/pr79143.C: Likewise.
	* g++.dg/cpp1z/class-deduction38.C: Likewise.
	* g++.dg/cpp1z/nontype-auto8.C: Likewise.
	* g++.dg/cpp1z/class-deduction12.C: Likewise.
	* g++.dg/cpp1z/decomp20.C: Likewise.
	* g++.dg/cpp1z/class-deduction22.C: Likewise.
	* g++.dg/cpp1z/class-deduction29.C: Likewise.
	* g++.dg/cpp1z/class-deduction8.C: Likewise.
	* g++.dg/cpp1z/class-deduction43.C: Likewise.
	* g++.dg/cpp1z/feat-cxx1z.C: Likewise.
	* g++.dg/cpp1z/fold8.C: Likewise.
	* g++.dg/cpp1z/init-statement3.C: Likewise.
	* g++.dg/cpp1z/nontype-auto10.C: Likewise.
	* g++.dg/cpp1z/class-deduction36.C: Likewise.
	* g++.dg/cpp1z/noexcept-type17.C: Likewise.
	* g++.dg/cpp1z/fallthrough1.C: Likewise.
	* g++.dg/cpp1z/fold1.C: Likewise.
	* g++.dg/cpp1z/class-deduction26.C: Likewise.
	* g++.dg/cpp1z/fold-ice1.C: Likewise.
	* g++.dg/cpp1z/fold5.C: Likewise.
	* g++.dg/cpp1z/class-deduction34.C: Likewise.
	* g++.dg/cpp1z/noexcept-type6.C: Likewise.
	* g++.dg/cpp1z/class-deduction7.C: Likewise.
	* g++.dg/cpp1z/class-deduction16.C: Likewise.
	* g++.dg/cpp1z/class-deduction10.C: Likewise.
	* g++.dg/cpp1z/eval-order3.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda13.C: Likewise.
	* g++.dg/cpp1z/aggr-base2a.C: Likewise.
	* g++.dg/cpp1z/nontype-auto1.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda3.C: Likewise.
	* g++.dg/cpp1z/nontype-auto7.C: Likewise.
	* g++.dg/cpp1z/decomp15.C: Likewise.
	* g++.dg/cpp1z/noexcept-type4.C: Likewise.
	* g++.dg/cpp1z/fold-mangle.C: Likewise.
	* g++.dg/cpp1z/class-deduction35.C: Likewise.
	* g++.dg/cpp1z/decomp4.C: Likewise.
	* g++.dg/cpp1z/class-deduction42.C: Likewise.
	* g++.dg/cpp1z/init-statement8.C: Likewise.
	* g++.dg/cpp1z/inline-var1a.C: Likewise.
	* g++.dg/cpp1z/init-statement6.C: Likewise.
	* g++.dg/cpp1z/class-deduction17.C: Likewise.
	* g++.dg/cpp1z/class-deduction28.C: Likewise.
	* g++.dg/cpp1z/class-deduction27.C: Likewise.
	* g++.dg/cpp1z/decomp-bitfield1.C: Likewise.
	* g++.dg/cpp1z/attributes-enum-1a.C: Likewise.
	* g++.dg/cpp1z/class-deduction11.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda12.C: Likewise.
	* g++.dg/cpp1z/init-statement9.C: Likewise.
	* g++.dg/cpp1z/class-deduction19.C: Likewise.
	* g++.dg/cpp1z/class-deduction5.C: Likewise.
	* g++.dg/cpp1z/fold2.C: Likewise.
	* g++.dg/cpp1z/class-deduction33.C: Likewise.
	* g++.dg/cpp1z/class-deduction24.C: Likewise.
	* g++.dg/cpp1z/aggr-base1.C: Likewise.
	* g++.dg/cpp1z/fold6.C: Likewise.
	* g++.dg/cpp1z/decomp12.C: Likewise.
	* g++.dg/cpp1z/class-deduction4.C: Likewise.
	* g++.dg/cpp1z/inline-var1.C: Likewise.
	* g++.dg/cpp1z/aligned-new2.C: Likewise.
	* g++.dg/cpp1z/class-deduction3.C: Likewise.
	* g++.dg/other/error3.C: Likewise.
	* g++.dg/init/new25.C: Likewise.
	* g++.dg/init/new13.C: Likewise.
	* g++.dg/tls/diag-2.C: Likewise.
	* g++.dg/tls/diag-4.C: Likewise.
	* g++.dg/opt/noreturn-1.C: Likewise.
	* g++.dg/eh/async-unwind2.C: Likewise.
	* g++.dg/eh/spec9.C: Likewise.
	* g++.dg/eh/spec7.C: Likewise.
	* g++.dg/eh/template1.C: Likewise.
	* g++.dg/eh/cond4.C: Likewise.
	* g++.dg/eh/pr41819.C: Likewise.
	* g++.dg/eh/delete1.C: Likewise.
	* g++.dg/eh/spec3.C: Likewise.
	* g++.dg/eh/forced4.C: Likewise.
	* g++.dg/eh/spec2.C: Likewise.
	* g++.dg/eh/shadow1.C: Likewise.
	* g++.dg/eh/pr38662.C: Likewise.
	* g++.dg/eh/ehopt1.C: Likewise.
	* g++.dg/eh/spec8.C: Likewise.
	* g++.dg/eh/init-temp2.C: Likewise.
	* g++.dg/rtti/crash3.C: Likewise.
	* g++.dg/warn/Wreturn-type-3.C: Likewise.
	* g++.dg/warn/register-parm-1.C: Likewise.
	* g++.dg/warn/register-var-2.C: Likewise.
	* g++.dg/gcov/gcov-7.C: Likewise.
	* g++.dg/tree-ssa/pr45605.C: Likewise.
	* g++.dg/cpp/pr23827_cxx98_neg.C: Likewise.
	* g++.dg/lookup/exception1.C: Likewise.
	* g++.dg/ubsan/pr79589.C: Likewise.
	* g++.dg/tm/pr47340.C: Likewise.
	* g++.dg/tm/pr46567.C: Likewise.
	* g++.dg/expr/bitfield5.C: Likewise.
	* g++.dg/expr/bool1.C: Likewise.
	* g++.dg/expr/lval3.C: Likewise.
	* g++.dg/expr/lval4.C: Likewise.
	* g++.dg/expr/bitfield4.C: Likewise.
	* g++.dg/expr/bitfield6.C: Likewise.
	* g++.dg/expr/bool3.C: Likewise.
	* g++.dg/ext/has_nothrow_constructor.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-1.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-2.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
	* g++.dg/ext/has_nothrow_assign.C: Likewise.
	* g++.dg/parse/register1.C: Likewise.
	* g++.dg/parse/error15.C: Likewise.
	* g++.dg/parse/linkage2.C: Likewise.
	* g++.dg/concepts/intro2.C: Likewise.
	* g++.dg/concepts/class.C: Likewise.
	* g++.dg/concepts/traits1.C: Likewise.
	* g++.dg/concepts/req5.C: Likewise.
	* g++.dg/concepts/var-concept5.C: Likewise.
	* g++.dg/concepts/fn-concept2.C: Likewise.
	* g++.dg/concepts/traits2.C: Likewise.
	* g++.dg/concepts/placeholder2.C: Likewise.
	* g++.dg/concepts/class6.C: Likewise.
	* g++.dg/concepts/memtmpl1.C: Likewise.
	* g++.dg/concepts/friend2.C: Likewise.
	* g++.dg/concepts/template-parm3.C: Likewise.
	* g++.dg/concepts/template-parm10.C: Likewise.
	* g++.dg/concepts/explicit-spec1.C: Likewise.
	* g++.dg/concepts/explicit-spec3.C: Likewise.
	* g++.dg/concepts/var-templ2.C: Likewise.
	* g++.dg/concepts/intro5.C: Likewise.
	* g++.dg/concepts/deduction-constraint1.C: Likewise.
	* g++.dg/concepts/iconv1.C: Likewise.
	* g++.dg/concepts/constrained-parm.C: Likewise.
	* g++.dg/concepts/template-template-parm1.C: Likewise.
	* g++.dg/concepts/var-concept3.C: Likewise.
	* g++.dg/concepts/class3.C: Likewise.
	* g++.dg/concepts/memfun2.C: Likewise.
	* g++.dg/concepts/req1.C: Likewise.
	* g++.dg/concepts/disjunction1.C: Likewise.
	* g++.dg/concepts/req17.C: Likewise.
	* g++.dg/concepts/pr65848.C: Likewise.
	* g++.dg/concepts/placeholder4.C: Likewise.
	* g++.dg/concepts/decl-diagnose.C: Likewise.
	* g++.dg/concepts/intro7.C: Likewise.
	* g++.dg/concepts/pr68683.C: Likewise.
	* g++.dg/concepts/partial-spec4.C: Likewise.
	* g++.dg/concepts/template-parm5.C: Likewise.
	* g++.dg/concepts/explicit-inst1.C: Likewise.
	* g++.dg/concepts/class-deduction1.C: Likewise.
	* g++.dg/concepts/class1.C: Likewise.
	* g++.dg/concepts/req15.C: Likewise.
	* g++.dg/concepts/memfun.C: Likewise.
	* g++.dg/concepts/pr68434.C: Likewise.
	* g++.dg/concepts/inherit-ctor4.C: Likewise.
	* g++.dg/concepts/partial-spec6.C: Likewise.
	* g++.dg/concepts/var-templ1.C: Likewise.
	* g++.dg/concepts/template-parm8.C: Likewise.
	* g++.dg/concepts/explicit-inst3.C: Likewise.
	* g++.dg/concepts/class4.C: Likewise.
	* g++.dg/concepts/req6.C: Likewise.
	* g++.dg/concepts/fn8.C: Likewise.
	* g++.dg/concepts/class5.C: Likewise.
	* g++.dg/concepts/placeholder5.C: Likewise.
	* g++.dg/concepts/req16.C: Likewise.
	* g++.dg/concepts/req10.C: Likewise.
	* g++.dg/concepts/var-concept2.C: Likewise.
	* g++.dg/concepts/auto3.C: Likewise.
	* g++.dg/concepts/generic-fn-err.C: Likewise.
	* g++.dg/concepts/pr65552.C: Likewise.
	* g++.dg/concepts/partial-concept-id2.C: Likewise.
	* g++.dg/concepts/fn1.C: Likewise.
	* g++.dg/concepts/partial-spec.C: Likewise.
	* g++.dg/concepts/template-parm12.C: Likewise.
	* g++.dg/concepts/diagnostic1.C: Likewise.
	* g++.dg/concepts/intro1.C: Likewise.
	* g++.dg/concepts/explicit-inst4.C: Likewise.
	* g++.dg/concepts/req18.C: Likewise.
	* g++.dg/concepts/explicit-spec5.C: Likewise.
	* g++.dg/concepts/var-concept6.C: Likewise.
	* g++.dg/concepts/fn9.C: Likewise.
	* g++.dg/concepts/req2.C: Likewise.
	* g++.dg/concepts/template-parm7.C: Likewise.
	* g++.dg/concepts/req14.C: Likewise.
	* g++.dg/concepts/template-parm6.C: Likewise.
	* g++.dg/concepts/variadic4.C: Likewise.
	* g++.dg/concepts/fn6.C: Likewise.
	* g++.dg/concepts/req-neg1.C: Likewise.
	* g++.dg/concepts/alias3.C: Likewise.
	* g++.dg/concepts/expression2.C: Likewise.
	* g++.dg/concepts/partial-spec3.C: Likewise.
	* g++.dg/concepts/expression3.C: Likewise.
	* g++.dg/concepts/memfun-err.C: Likewise.
	* g++.dg/concepts/pr66091.C: Likewise.
	* g++.dg/concepts/explicit-spec2.C: Likewise.
	* g++.dg/concepts/equiv.C: Likewise.
	* g++.dg/concepts/friend1.C: Likewise.
	* g++.dg/concepts/fn4.C: Likewise.
	* g++.dg/concepts/var-templ3.C: Likewise.
	* g++.dg/concepts/explicit-inst2.C: Likewise.
	* g++.dg/concepts/alias2.C: Likewise.
	* g++.dg/concepts/regress/alias-decl-42.C: Likewise.
	* g++.dg/concepts/placeholder6.C: Likewise.
	* g++.dg/concepts/fn10.C: Likewise.
	* g++.dg/concepts/req3.C: Likewise.
	* g++.dg/concepts/variadic2.C: Likewise.
	* g++.dg/concepts/pr65636.C: Likewise.
	* g++.dg/concepts/intro6.C: Likewise.
	* g++.dg/concepts/class2.C: Likewise.
	* g++.dg/concepts/fn2.C: Likewise.
	* g++.dg/concepts/req20.C: Likewise.
	* g++.dg/concepts/req8.C: Likewise.
	* g++.dg/concepts/placeholder1.C: Likewise.
	* g++.dg/concepts/pr65854.C: Likewise.
	* g++.dg/concepts/member-concept.C: Likewise.
	* g++.dg/concepts/template-parm2.C: Likewise.
	* g++.dg/concepts/variadic1.C: Likewise.
	* g++.dg/concepts/fn7.C: Likewise.
	* g++.dg/concepts/intro4.C: Likewise.
	* g++.dg/concepts/req13.C: Likewise.
	* g++.dg/concepts/inherit-ctor3.C: Likewise.
	* g++.dg/concepts/explicit-spec6.C: Likewise.
	* g++.dg/concepts/auto1.C: Likewise.
	* g++.dg/concepts/alias1.C: Likewise.
	* g++.dg/concepts/fn-concept1.C: Likewise.
	* g++.dg/concepts/template-parm11.C: Likewise.
	* g++.dg/concepts/explicit-spec4.C: Likewise.
	* g++.dg/concepts/partial-concept-id1.C: Likewise.
	* g++.dg/concepts/req9.C: Likewise.
	* g++.dg/concepts/req4.C: Likewise.
	* g++.dg/concepts/pr65681.C: Likewise.
	* g++.dg/concepts/req7.C: Likewise.
	* g++.dg/concepts/req12.C: Likewise.
	* g++.dg/concepts/fn5.C: Likewise.
	* g++.dg/concepts/alias4.C: Likewise.
	* g++.dg/concepts/generic-fn.C: Likewise.
	* g++.dg/concepts/feature-macro.C: Likewise.
	* g++.dg/concepts/req19.C: Likewise.
	* g++.dg/concepts/placeholder3.C: Likewise.
	* g++.dg/concepts/intro3.C: Likewise.
	* g++.dg/concepts/partial-spec5.C: Likewise.
	* g++.dg/concepts/template-parm4.C: Likewise.
	* g++.dg/concepts/dr1430.C: Likewise.
	* g++.dg/concepts/pr65634.C: Likewise.
	* g++.dg/concepts/var-concept4.C: Likewise.
	* g++.dg/concepts/pr67249.C: Likewise.
	* g++.dg/concepts/expression.C: Likewise.
	* g++.dg/concepts/pr65575.C: Likewise.
	* g++.dg/concepts/partial-spec2.C: Likewise.
	* g++.dg/concepts/template-parm9.C: Likewise.
	* g++.dg/concepts/inherit-ctor1.C: Likewise.
	* g++.dg/concepts/equiv2.C: Likewise.
	* g++.dg/concepts/req11.C: Likewise.
	* g++.dg/concepts/template-parm1.C: Likewise.
	* g++.dg/concepts/inherit-ctor2.C: Likewise.
	* g++.dg/concepts/var-concept1.C: Likewise.
	* g++.dg/concepts/fn3.C: Likewise.
	* g++.dg/torture/pr46364.C: Likewise.
	* g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
	* g++.dg/torture/stackalign/eh-global-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
	* g++.dg/torture/pr52918-1.C: Likewise.
	* g++.dg/torture/pr49394.C: Likewise.
	* g++.dg/torture/pr57190.C: Likewise.
	* g++.dg/cpp0x/static_assert8.C: Likewise.
	* g++.dg/cpp0x/noexcept19.C: Likewise.
	* g++.dg/cpp0x/variadic-throw.C: Likewise.
	* g++.dg/cpp0x/variadic73.C: Likewise.
	* g++.dg/cpp0x/noexcept02.C: Likewise.
	* g++.dg/cpp0x/defaulted23.C: Likewise.
	* g++.dg/cpp0x/noexcept08.C: Likewise.
	* g++.dg/cpp0x/auto9.C: Likewise.
	* g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise.
	* g++.dg/cpp0x/error5.C: Likewise.
	* c-c++-common/gomp/atomic-12.c: Likewise.
	* c-c++-common/gomp/atomic-13.c: Likewise.
	* c-c++-common/gomp/atomic-14.c: Likewise.
	* c-c++-common/Wvarargs-2.c: Likewise.
	* c-c++-common/Wvarargs.c: Likewise.
	* c-c++-common/vector-subscript-2.c: Likewise.
	* g++.old-deja/g++.robertl/eb123.C: Likewise.
	* g++.old-deja/g++.eh/tmpl3.C: Likewise.
	* g++.old-deja/g++.eh/cleanup2.C: Likewise.
	* g++.old-deja/g++.eh/badalloc1.C: Likewise.
	* g++.old-deja/g++.eh/throw2.C: Likewise.
	* g++.old-deja/g++.eh/throw1.C: Likewise.
	* g++.old-deja/g++.eh/tmpl1.C: Likewise.
	* g++.old-deja/g++.other/new7.C: Likewise.
	* g++.old-deja/g++.other/crash30.C: Likewise.
	* g++.old-deja/g++.other/regstack.C: Likewise.
	* g++.old-deja/g++.other/crash28.C: Likewise.
	* g++.old-deja/g++.jason/bool5.C: Likewise.
	* g++.old-deja/g++.mike/p10416.C: Likewise.
	* g++.old-deja/g++.mike/eh25.C: Likewise.
	* g++.old-deja/g++.mike/eh55.C: Likewise.
libcpp/
	* include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
	to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
	* init.c (lang_defaults, cpp_init_builtins): Likewise.
	* expr.c (cpp_classify_number): Use C++17 instead of C++1z
	in diagnostics.
libstdc++-v3/
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or
	-std=gnu++17 instead of -std=c++1z or -std=gnu++1z.  Use c++17 instead
	of c++1z and c++17_only instead of c++1z_only.  Adjust expected
	diagnostics and comments refering to 1z to 17.
	* testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise.
	* testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise.
	* testsuite/30_threads/scoped_lock/cons/1.cc: Likewise.
	* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise.
	* testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise.
	* testsuite/18_support/launder/1.cc (test02): Likewise.
	* testsuite/18_support/launder/requirements_neg.cc: Likewise.
	* testsuite/18_support/launder/requirements.cc: Likewise.
	* testsuite/18_support/byte/requirements.cc: Likewise.
	* testsuite/18_support/byte/ops.cc: Likewise.
	* testsuite/18_support/byte/global_neg.cc: Likewise.
	* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
	Likewise.
	* testsuite/27_io/types/4.cc: Likewise.
	* testsuite/25_algorithms/sample/81221.cc: Likewise.
	* testsuite/25_algorithms/sample/1.cc: Likewise.
	* testsuite/25_algorithms/sample/2.cc: Likewise.
	* testsuite/25_algorithms/search/searcher.cc: Likewise.
	* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.
	* testsuite/experimental/filesystem/path/construct/string_view.cc:
	Likewise.
	* testsuite/24_iterators/range_access_cpp17.cc: Likewise.
	* testsuite/24_iterators/container_access.cc: Likewise.
	* testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise.
	* testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise.
	* testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/array.cc: Likewise.
	* testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise.
	* testsuite/20_util/pair/cons/deduction.cc: Likewise.
	* testsuite/20_util/variant/deduction.cc: Likewise.
	* testsuite/20_util/tuple/78939.cc: Likewise.
	* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
	* testsuite/20_util/void_t/1.cc: Likewise.
	* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise.
	* testsuite/20_util/addressof/requirements/constexpr.cc: Likewise.
	* testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise.
	* testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/20_util/has_unique_object_representations/value.cc:
	Likewise.
	* testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise.
	* testsuite/20_util/function_objects/invoke/59768.cc: Likewise.
	* testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise.
	* testsuite/20_util/function/cons/deduction.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
	Likewise.
	* testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/20_util/is_aggregate/value.cc: Likewise.
	* testsuite/26_numerics/lcm/1.cc: Likewise.
	* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
	* testsuite/26_numerics/gcd/1.cc: Likewise.
	* testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
	* testsuite/26_numerics/valarray/deduction.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/hypot.cc: Likewise.
	* testsuite/23_containers/queue/members/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/array/cons/deduction.cc: Likewise.
	* testsuite/23_containers/array/cons/deduction_neg.cc: Likewise.
	* testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/deque/cons/deduction.cc: Likewise.
	* testsuite/23_containers/stack/members/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/list/cons/deduction.cc: Likewise.
	* testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/forward_list/cons/deduction.cc: Likewise.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise.
	* testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc:
	Likewise.
	* testsuite/23_containers/vector/cons/deduction.cc: Likewise.
	* testsuite/23_containers/vector/bool/emplace_cxx17_return.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/char/9.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc:
	Likewise.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
	Likewise.

From-SVN: r252826
2017-09-15 18:15:46 +02:00
Jason Merrill 85e653c925 * init.c (cpp_init_builtins): Update __cplusplus for C++17.
From-SVN: r246211
2017-03-16 17:16:39 -04:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jakub Jelinek 70f6d5e19b gcc/
* common.opt (Wimplicit-fallthrough) Turn into alias to
	-Wimplicit-fallthrough=3.  Remove EnabledBy.
	(Wimplicit-fallthrough=): New option.
	* gimplify.c (warn_implicit_fallthrough_r): Use
	OPT_Wimplicit_fallthrough_ instead of OPT_Wimplicit_fallthrough.
	* doc/invoke.texi (-Wimplicit-fallthrough): Document as alias
	to -Wimplicit-fallthrough=3.
	(-Wimplicit-fallthrough=): Document.
gcc/c-family/
	* c.opt (Wextra): Add as C/C++/ObjC/ObjC++ option.
	(Wimplicit-fallthrough=): Enable for these languages by -Wextra.
	* c-opts.c (sanitize_cpp_opts): Initialize
	cpp_opts->cpp_warn_implicit_fallthrough.
gcc/testsuite/
	* c-c++-common/Wimplicit-fallthrough-25.c: New test.
	* c-c++-common/Wimplicit-fallthrough-26.c: New test.
	* c-c++-common/Wimplicit-fallthrough-27.c: New test.
	* c-c++-common/Wimplicit-fallthrough-28.c: New test.
	* c-c++-common/Wimplicit-fallthrough-29.c: New test.
	* c-c++-common/Wimplicit-fallthrough-30.c: New test.
	* c-c++-common/Wimplicit-fallthrough-31.c: New test.
	* c-c++-common/Wimplicit-fallthrough-32.c: New test.
	* c-c++-common/Wimplicit-fallthrough-33.c: New test.
libcpp/
	* include/cpplib.h (struct cpp_options): Add
	cpp_warn_implicit_fallthrough.
	* init.c (cpp_create_reader): Initialize it to 0.
	* lex.c (fallthrough_comment_p): Handle different
	cpp_warn_implicit_fallthrough levels.  Whitespace fixes.

From-SVN: r241013
2016-10-12 01:19:06 +02:00
David Malcolm ac81cf0b2b libcpp: Tweak to missing #include source location
This patch tweaks the error message location for missing header files.

Previously these read:

test.c:1:17: fatal error: 404.h: No such file or directory
 #include "404.h"
                 ^
compilation terminated.

With this patch, the pertinent string is underlined:

test.c:1:10: fatal error: 404.h: No such file or directory
 #include "404.h"
          ^~~~~~~
compilation terminated.

gcc/testsuite/ChangeLog:
	* c-c++-common/missing-header-1.c: New test case.
	* c-c++-common/missing-header-2.c: New test case.
	* c-c++-common/missing-header-3.c: New test case.
	* c-c++-common/missing-header-4.c: New test case.

libcpp/ChangeLog:
	* directives.c (do_include_common): Pass on "location" to
	_cpp_stack_include.
	* errors.c (cpp_diagnostic): Reimplement in terms of...
	(cpp_diagnostic_at): New function.
	(cpp_error_at): New function.
	(cpp_errno_filename): Add "loc" param and use it by using
	cpp_error_at rather than cpp_error.
	* files.c (find_file_in_dir): Add "loc" param and pass it to
	open_file_failed.
	(_cpp_find_file): Add "loc" param.  Use it to convert calls to
	cpp_error to cpp_error_at, and pass it to find_file_in_dir and
	open_file_failed.
	(read_file_guts): Add "loc" param.  Use it to convert calls to
	cpp_error to cpp_error_at.  Pass it to cpp_errno_filename.
	(read_file): Add "loc" param.  Pass it to open_file_failed and
	read_file_guts.
	(should_stack_file): Add "loc" param.  Pass it to read_file.
	(_cpp_stack_file): Add "loc" param.  Pass it to should_stack_file.
	(_cpp_stack_include): Add "loc" param.  Pass it to
	_cpp_find_file and _cpp_stack_file.
	(open_file_failed): Add "loc" param.  Pass it to
	cpp_errno_filename.
	(_cpp_fake_include): Add 0 as a source_location in call to
	_cpp_find_file.
	(_cpp_compare_file_date): Likewise.
	(cpp_push_include): Likewise for call to _cpp_stack_include.
	(cpp_push_default_include): Likewise.
	(_cpp_save_file_entries): Likewise for call to open_file_failed.
	(_cpp_has_header): Likewise for call to _cpp_find_file.
	* include/cpplib.h (cpp_errno_filename): Add source_location
	param.
	(cpp_error_at): New declaration.
	* init.c (cpp_read_main_file): Add 0 as a source_location in calls
	to _cpp_find_file and _cpp_stack_file.
	* internal.h (_cpp_find_file): Add source_location param.
	(_cpp_stack_file): Likewise.
	(_cpp_stack_include): Likewise.

From-SVN: r237715
2016-06-22 15:29:21 +00:00
Eduard Sanou 15c98b2e0d c-common.c (get_source_date_epoch): Rename to cb_get_source_date_epoch.
gcc/c-family/ChangeLog:

2016-05-13  Eduard Sanou  <dhole@openmailbox.org>

	* c-common.c (get_source_date_epoch): Rename to
	cb_get_source_date_epoch.
	* c-common.c (cb_get_source_date_epoch): Use a single generic erorr
	message when the parsing fails.  Use error_at instead of fatal_error.
	* c-common.h (get_source_date_epoch): Rename to
	cb_get_source_date_epoch.
	* c-common.h (cb_get_source_date_epoch): Prototype.
	* c-common.h (MAX_SOURCE_DATE_EPOCH): Define.
	* c-common.h (c_omp_region_type): Remove trailing comma.
	* c-lex.c (init_c_lex): Set cb->get_source_date_epoch callback.
	* c-lex.c (c_lex_with_flags): Remove initialization of
	pfile->source_date_epoch.

gcc/ChangeLog:

2016-05-13  Eduard Sanou  <dhole@openmailbox.org>

	* doc/cppenv.texi: Note that the `%s` in `date` is a non-standard
	extension.
	* gcc.c (driver_handle_option): Call set_source_date_epoch_envvar.
	* gcc.c (set_source_date_epoch_envvar): New function, sets
	the SOURCE_DATE_EPOCH environment variable to the current time.

gcc/testsuite/ChangeLog:

2016-05-13  Eduard Sanou  <dhole@openmailbox.org>

	* gcc.dg/cpp/source_date_epoch-1.c: New file, test the proper
	behaviour of the macros __DATE__ and __TIME__ when SOURCE_DATE_EPOCH
	env var is set.
	* gcc.dg/cpp/source_date_epoch-2.c: New file, test the error output
	when parsing the SOURCE_DATE_EPOCH env var, and make sure it is only
	shown once.
	* lib/gcc-dg.exp (dg-set-compiler-env-var): New function, set env vars
	during compilation.
	* lib/gcc-dg.exp (restore-compiler-env-var): New function, restore env
	vars set by dg-set-compiler-env-var.

libcpp/ChangeLog:

2016-05-13  Eduard Sanou  <dhole@openmailbox.org>

	* include/cpplib.h (cpp_callbacks): Add get_source_date_epoch
	callback.
	* include/cpplib.h (cpp_init_source_date_epoch): Remove prototype.
	* init.c (cpp_init_source_date_epoch): Remove function.
	* init.c (cpp_create_reader): Initialize pfile->source_date_epoch.
	* internal.h (cpp_reader): Extend comment about source_date_epoch.
	* macro.c (_cpp_builtin_macro_text): Use get_source_date_epoch
	callback only once, read pfile->source_date_epoch on future passes.
	Check that get_source_date_epoch callback is not NULL.

From-SVN: r237001
2016-06-01 16:42:41 +00:00
Eduard Sanou 174f66220d c-common.c (get_source_date_epoch): New function...
gcc/c-family/ChangeLog:

2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>

	* c-common.c (get_source_date_epoch): New function, gets the environment
	variable SOURCE_DATE_EPOCH and parses it as long long with error 
	handling.
	* c-common.h (get_source_date_epoch): Prototype.
	* c-lex.c (c_lex_with_flags): set parse_in->source_date_epoch.

gcc/ChangeLog:

2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>

	* doc/cppenv.texi: Document SOURCE_DATE_EPOCH environment variable.

libcpp/ChangeLog:

2016-04-28  Eduard Sanou  <dhole@openmailbox.org>
	    Matthias Klose  <doko@debian.org>

	* include/cpplib.h (cpp_init_source_date_epoch): Prototype.
	* init.c (cpp_init_source_date_epoch): New function.
	* internal.h: Added source_date_epoch variable to struct
	cpp_reader to store a reproducible date.
	* macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from 
	pfile->source_date_epoch instead of localtime if source_date_epoch is 
	set, to be used for __DATE__ and __TIME__ macros to help reproducible 
	builds.

Co-Authored-By: Matthias Klose <doko@debian.org>

From-SVN: r235550
2016-04-28 09:12:05 +00:00
Jason Merrill 2aaeea194b expr.c (cpp_classify_number): Hex floats are new in C++1z.
* libcpp/expr.c (cpp_classify_number): Hex floats are new in C++1z.

	* libcpp/init.c (lang_defaults): Likewise.
	* gcc/c-family/c-cppbuiltin.c (c_cpp_builtins): Set __cpp_hex_float.

From-SVN: r234213
2016-03-15 08:08:31 -04:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Mikhail Maltsev 22d663823a [PATCH 2/9] ENABLE_CHECKING refactoring: libcpp
[PATCH 2/9] ENABLE_CHECKING refactoring: libcpp
        * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
        * init.c: Likewise.
        * macro.c (struct macro_arg_token_iter, set_arg_token,
        macro_arg_token_iter_init, macro_arg_token_iter_forward,
        macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
        alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.

From-SVN: r229154
2015-10-21 16:22:03 -06:00
Edward Smith-Rowland fe95b0366a Implement N4197 - Adding u8 character literals
libcpp:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
	(struct cpp_options): Add utf8_char_literals.
	* init.c (struct lang_flags): Add utf8_char_literals;
	(struct lang_flags lang_defaults): Add column for utf8_char_literals.
	* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token; 
	* expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
	Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
	(cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
	(eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
	* lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
	* charset.c (converter_for_type(), cpp_interpret_charconst()):
	Treat CPP_UTF8CHAR token.


gcc/c-family:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* c-family/c-ada-spec.c (print_ada_macros()): Treat CPP_UTF8CHAR
	like CPP_CHAR.
	* c-family/c-common.c (c_parse_error()): print CPP_UTF8CHAR
	and CPP_UTF8CHAR_USERDEF tokens.
	* c-family/c-lex.c (c_lex_with_flags()): Treat CPP_UTF8CHAR_USERDEF
	and CPP_UTF8CHAR tokens; (lex_charconst()): Treat CPP_UTF8CHAR token.


gcc/cp:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
	and CPP_UTF8CHAR_USERDEF tokens;
	(cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.


gcc/testsuite:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* g++.dg/cpp1z/utf8.C: New.
	* g++.dg/cpp1z/utf8-neg.C: New.
	* g++.dg/cpp1z/udlit-utf8char.C: New.

From-SVN: r225185
2015-06-30 12:58:48 +00:00
Jason Merrill fe191308dd lex.c (lex_string): Add -Wc++11-compat warning.
libcpp/
	* lex.c (lex_string): Add -Wc++11-compat warning.
	* include/cpplib.h: Add CPP_W_CXX11_COMPAT.
	(struct cpp_options): Add cpp_warn_cxx11_compat.
	* init.c (cpp_create_reader): Initialize it.
gcc/c-family/
	* c.opt (Wc++0x-compat): Set it.

From-SVN: r222961
2015-05-09 00:50:10 -04:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Jakub Jelinek 1f8d3e84ee re PR preprocessor/63831 (r217292 causes segfaults with -MM)
PR preprocessor/63831
	* c-cppbuiltin.c (c_cpp_builtins): Don't define __has_attribute
	and __has_cpp_attribute here.
	* c-ppoutput.c (init_pp_output): Set cb->has_attribute to
	c_common_has_attribute.
	* c-common.h (c_common_has_attribute): New prototype.
	* c-lex.c (init_c_lex): Set cb->has_attribute to
	c_common_has_attribute instead of cb_has_attribute.
	(get_token_no_padding): New function.
	(cb_has_attribute): Renamed to ...
	(c_common_has_attribute): ... this.  No longer static.  Use
	get_token_no_padding, require ()s, don't build TREE_LIST
	unnecessarily, fix up formatting, adjust diagnostics, call
	init_attributes.

	* directives.c (lex_macro_node): Remove __has_attribute__ handling.
	* internal.h (struct spec_node): Remove n__has_attribute__ field.
	(struct lexer_state): Remove in__has_attribute__ field.
	* macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
	* identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
	handling.
	* init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
	(cpp_init_special_builtins): Don't initialize __has_attribute
	or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
	* traditional.c (enum ls): Remove ls_has_attribute,
	ls_has_attribute_close.
	(_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
	* include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
	* pch.c (cpp_read_state): Remove __has_attribute__ handling.
	* expr.c (eval_token): Likewise.
	(parse_has_attribute): Removed.

	* c-c++-common/cpp/pr63831-1.c: New test.
	* c-c++-common/cpp/pr63831-2.c: New test.

From-SVN: r218948
2014-12-19 13:20:58 +01:00
Joseph Myers 701cade1a2 Enable -fextended-identifiers by default.
As proposed at <https://gcc.gnu.org/ml/gcc/2014-11/msg00014.html>,
this patch enables -fextended-identifiers by default for all standard
versions including this feature (all C++ versions, C99 and above for
C, but not C90 / C94 / gnu89 / preprocessing assembler).  It adds a
couple of tests for areas where I previously noted testsuite coverage
for extended identifiers was lacking, removes -fextended-identifiers
from existing tests, adds -g to various such tests to verify that
extended identifiers don't break debug info generation and removes the
test that was only there to verify that the feature was off by
default.

The current state of the feature may not correspond exactly to any
particular checklist from 2004/5 (see bug 9449) of what was wanted
before enabling the feature by default, but I don't think it's any
worse than plenty of other features supported by default before every
corner case is fully functional, and think problems can readily be
fixed incrementally.

The following aspects of extended identifiers could still do with more
work (and should be straightforward):

* C -aux-info (output should use UCNs).

* ObjC -gen-decls (output should use UCNs; associated diagnostics from
  the ObjC front end should use extended characters or UCNs as
  appropriate to the locale, via using %qE or identifier_to_locale).

* Use DW_AT_use_UTF8 in DWARF-3 debug info for compilation units built
  with extended identifiers enabled (or unconditionally).

* cpplib diagnostics (outputting characters or UCNs as appropriate
  depending on the locale, as done for identifiers in non-cpplib
  diagnostics).

* C++ test for UCN linking with C and extern "C".

* Check GDB support / file issues for support if needed.

* Actual UTF-8 in identifiers (?).  (Be careful about not affecting
  performance for the normal fast path of lexing identifiers, if
  possible.)

The following may be trickier:

* cpplib spelling preservation (required to diagnose macro
  redefinition with different spellings of the same identifier in the
  definition or argument names; different spellings of the name of the
  macro itself are OK, however; also required for correct handling of
  multiple stringizing in C++); correct output for -d (UCNs), DWARF
  debug info for macros (UCNs), PCH and PCH tests.  (Spelling
  preservation is the issue that needs fixing to remove references to
  corner cases in the documentation of -std=c99 and -std=c11 and in
  c99status.html.)  The idea would be to add a second pointer to
  cpp_identifier that stores the original spelling (whether for
  extended identifiers only, or for all identifiers); this does not
  enlarge cpp_token because the resulting larger cpp_identifier
  structure is no bigger than cpp_string.

* C++ translation of extended characters (including $@` and various
  control characters) to UCNs in phase 1 (note diagnostics thus
  needed, but not for C++11, for control characters in strings /
  character constants as those UCNs invalid); a likely implementation
  approach is to do translation when identifiers / strings / character
  constants are lexed, together with errors for stray $@` / control
  characters in program as not being valid UCNs in identifiers ($ only
  if not accepted in identifiers); note that this translation should
  not take place inside raw string literals.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.

libcpp:
	PR preprocessor/9449
	* init.c (lang_defaults): Enable extended identifiers for C++ and
	C99-based standards.

gcc:
	PR preprocessor/9449
	* doc/cpp.texi (Character sets, Tokenization)
	(Implementation-defined behavior): Don't refer to UCNs in
	identifiers requiring -fextended-identifiers.
	* doc/cppopts.texi (-fextended-identifiers): Document as enabled
	by default for C99 and later and C++.
	* doc/invoke.texi (-std=c99, -std=c11): Don't refer to extended
	identifiers needing -fextended-identifiers.

gcc/testsuite:
	PR preprocessor/9449
	* lib/target-supports.exp (check_effective_target_ucn_nocache):
	Don't use -fextended-identifiers.
	* c-c++-common/cpp/normalize-3.c, c-c++-common/cpp/ucnid-2011-1.c,
	g++.dg/cpp/ucn-1.C, g++.dg/cpp/ucnid-1.C, g++.dg/other/ucnid-1.C,
	gcc.dg/cpp/normalize-1.c, gcc.dg/cpp/normalize-2.c,
	gcc.dg/cpp/normalize-4.c: Don't use -fextended-identifiers.
	* gcc.dg/cpp/ucnid-1.c: Don't use -fextended-identifiers.  Use
	-g3.
	* gcc.dg/cpp/ucnid-10.c, gcc.dg/cpp/ucnid-2.c,
	gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c, gcc.dg/cpp/ucnid-5.c,
	gcc.dg/cpp/ucnid-7.c, gcc.dg/cpp/ucnid-9.c,
	gcc.dg/cpp/warn-normalized-1.c, gcc.dg/cpp/warn-normalized-2.c,
	gcc.dg/cpp/warn-normalized-3.c: Don't use -fextended-identifiers.
	* gcc.dg/ucnid-1.c, gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c,
	gcc.dg/ucnid-4.c, gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Don't use
	-fextended-identifiers.  Use -g.
	* gcc.dg/ucnid-7.c, gcc.dg/ucnid-8.c: Don't use
	-fextended-identifiers.
	* gcc.dg/ucnid-9.c: Don't use -fextended-identifiers.  Use -g.
	* gcc.dg/ucnid-10.c: Don't use -fextended-identifiers.
	* gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c: Don't use
	-fextended-identifiers.  Use -g.
	* gcc.dg/ucnid-13.c: Don't use -fextended-identifiers.
	* gcc.dg/cpp/ucnid-8.c: Remove test.
	* gcc.dg/cpp/ucnid-10.c, gcc.dg/ucnid-14.c: New tests.

From-SVN: r217144
2014-11-05 16:19:10 +00:00
Alan Modra 19a9ba64e7 gengtype.h (obstack_chunk_alloc, [...]): Remove cast.
gcc/
	* gengtype.h (obstack_chunk_alloc, obstack_chunk_free): Remove cast.
	* coretypes.h (obstack_chunk_alloc, obstack_chunk_free): Likewise.
	(gcc_obstack_init): Use obstack_specify_allocation in place of
	_obstack_begin.
	* genautomata.c (next_sep_el): Cast result of obstack_base to (char *).
	(regexp_representation): Likewise.
	* godump.c (go_output_type): Likewise.
gcc/java/
	* mangle.c (finish_mangling): Cast result of obstack_base to (char *).
	* typeck.c (build_java_argument_signature): Likewise.
	(build_java_signature): Likewise.
gcc/objc/
	* objc-encoding.c (encode_array): Cast result of obstack_base.
	(encode_type): Likewise.
libcpp/
	* symtab.c (ht_create): Use obstack_specify_allocation in place of
	_obstack_begin.
	* files.c (_cpp_init_files): Likewise.
	* init.c (cpp_create_reader): Likewise.
	* identifiers.c (_cpp_init_hashtable): Likewise.

From-SVN: r216539
2014-10-22 12:11:31 +10:30
Marek Polacek 909eb89ca5 re PR c/61854 (Warning single-line comment for -std=c89?)
PR c/61854
libcpp/
	* init.c (struct lang_flags): Remove cplusplus_comments.
	(cpp_set_lang): Likewise.
	(post_options): Likewise.
	* lex.c (_cpp_lex_direct): Disallow C++ style comments in C90/C94.
testsuite/
	* gcc.dg/cpp/pr61854-1.c: New test.
	* gcc.dg/cpp/pr61854-2.c: New test.
	* gcc.dg/cpp/pr61854-3.c: New test.
	* gcc.dg/cpp/pr61854-3.h: New test.
	* gcc.dg/cpp/pr61854-4.c: New test.
	* gcc.dg/cpp/pr61854-5.c: New test.
	* gcc.dg/cpp/pr61854-6.c: New test.
	* gcc.dg/cpp/pr61854-7.c: New test.
	* gcc.dg/cpp/pr61854-c90.c: New test.
	* gcc.dg/cpp/pr61854-c94.c: New test.

From-SVN: r215339
2014-09-17 21:49:46 +00:00
Manuel López-Ibáñez 2b71f4a4f8 options.texi: Document that Var and Init are required if CPP is given.
gcc/ChangeLog:

2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* doc/options.texi: Document that Var and Init are required if CPP
	is given.
	* optc-gen.awk: Require Var and Init if CPP is given.
	* common.opt (Wpedantic): Use Init.

libcpp/ChangeLog:

2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* macro.c (replace_args): Use cpp_pedwarning, cpp_warning and
	CPP_W flags.
	* include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.
	* init.c (cpp_create_reader): Do not init to -1 here.
	* expr.c (num_binary_op): Use cpp_pedwarning.

gcc/c-family/ChangeLog:

2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* c.opt (Wc90-c99-compat,Wc++-compat,Wcomment,Wendif-labels,
	Winvalid-pch,Wlong-long,Wmissing-include-dirs,Wmultichar,Wpedantic,
	(Wdate-time,Wtraditional,Wundef,Wvariadic-macros): Add CPP, Var
	and Init.
	* c-opts.c (c_common_handle_option): Do not handle here.
	(sanitize_cpp_opts): Likewise.
	* c-common.c (struct reason_option_codes_t): Handle
	CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC.

gcc/testsuite/ChangeLog:

2014-09-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* gcc.dg/cpp/endif-pedantic2.c: More general options do not
	override specific ones, but specific ones do.

From-SVN: r214904
2014-09-04 15:13:40 +00:00
Manuel López-Ibáñez b753b37bd6 macro.c (warn_of_redefinition): Suppress warnings for builtins that lack the NODE_WARN flag...
libcpp/ChangeLog:

2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* macro.c (warn_of_redefinition): Suppress warnings for builtins
	that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
	(_cpp_create_definition): Use Wbuiltin-macro-redefined for
	builtins that lack the NODE_WARN flag.
	* directives.c (do_undef): Likewise.
	* init.c (cpp_init_special_builtins): Do not change flags
	depending on Wbuiltin-macro-redefined.


gcc/c-family/ChangeLog:

2014-08-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* c.opt (Wbuiltin-macro-redefined): Use CPP, Var and Init.
	* c-opts.c (c_common_handle_option): Do not handle here.

From-SVN: r214730
2014-08-29 15:28:45 +00:00
Edward Smith-Rowland 7c05e50c73 PR cpp/23827 - standard C++ should not have hex float preprocessor
libcpp/

2014-08-27  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR cpp/23827 - standard C++ should not have hex float preprocessor
	tokens
	* libcpp/init.c (lang_flags): Change CXX98 flag for extended numbers
	from 1 to 0.
	* libcpp/expr.c (cpp_classify_number): Weite error message for improper
	use of hex floating literal.


gcc/testsuite/

2014-08-27  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR cpp/23827 - standard C++ should not have hex float preprocessor
	tokens
	* g++.dg/cpp/pr23827_cxx11.C: New.
	* g++.dg/cpp/pr23827_cxx98.C: New.
	* g++.dg/cpp/pr23827_cxx98_neg.C: New.
	* gcc.dg/cpp/pr23827_c90.c: New.
	* gcc.dg/cpp/pr23827_c90_neg.c: New.
	* gcc.dg/cpp/pr23827_c99.c: New.

From-SVN: r214616
2014-08-28 02:38:24 +00:00
Edward Smith-Rowland e4276ba523 cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z...
libcpp/

2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
	Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
	* init.c (struct lang_flags lang_defaults): Add column for trigraphs;
	Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
	(cpp_init_builtins): Set __cplusplus to 201402L for C++14;
	Set __cplusplus to 201500L for C++17.
	* expr.c (cpp_classify_number): Change C++1y to C++14 in binary
	constants error message.


gcc/c-family/

2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* c-common.h (enum cxx_dialect): Add cxx14.
	* c-opts.c (set_std_cxx1y): Rename to set_std_cxx14; Use cxx14.
	* c-ubsan.c (ubsan_instrument_shift): Change comment and logic from
	cxx_dialect == cxx11 || cxx_dialect == cxx1y to cxx_dialect >= cxx11.


gcc/cp/

2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* decl.c (compute_array_index_type, grokdeclarator,
	undeduced_auto_decl): Change from cxx1y to cxx14.
	*lambda.c(add_capture()): Change error message from C++1y to C++14.
	* parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
	cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
	cp_parser_decltype, cp_parser_conversion_type_id,
	cp_parser_simple_type_specifier, cp_parser_type_id_1,
	cp_parser_template_type_arg, cp_parser_std_attribute,
	cp_parser_template_declaration_after_export): Ditto.
	* pt.c (tsubst): Ditto.
	* semantics.c (force_paren_expr, finish_decltype_type): Ditto.
	* tree.c: Change comment.
	* typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
	cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.


gcc/

2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* doc/invoke.texi: Change c++1y to c++14 and gnu++1y to gnu++14.
	Deprecate c++1y. Change language to reflect greater confidence in C++14.


gcc/testsuite/

2014-08-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* g++.dg/cpp0x/cplusplus.C: New.
	* g++.dg/cpp0x/cplusplus_0x.C: New.
	* g++.dg/cpp0x/auto3.C: Change c++1y to c++14.
	* g++.dg/cpp0x/auto41.C: Ditto.
	* g++.dg/cpp0x/auto9.C: Ditto.
	* g++.dg/cpp0x/initlist26.C: Ditto.
	* g++.dg/cpp0x/pr59111.C: Ditto.
	* g++.dg/cpp0x/trailing2.C: Ditto.
	* g++.dg/cpp1y/attr-deprecated.C: Ditto.
	* g++.dg/cpp1y/auto-dtor1.C: Ditto.
	* g++.dg/cpp1y/auto-fn1.C: Ditto.
	* g++.dg/cpp1y/auto-fn2.C: Ditto.
	* g++.dg/cpp1y/auto-fn3.C: Ditto.
	* g++.dg/cpp1y/auto-fn4.C: Ditto.
	* g++.dg/cpp1y/auto-fn5.C: Ditto.
	* g++.dg/cpp1y/auto-fn6.C: Ditto.
	* g++.dg/cpp1y/auto-fn7.C: Ditto.
	* g++.dg/cpp1y/auto-fn8.C: Ditto.
	* g++.dg/cpp1y/auto-fn9.C: Ditto.
	* g++.dg/cpp1y/auto-fn10.C: Ditto.
	* g++.dg/cpp1y/auto-fn11.C: Ditto.
	* g++.dg/cpp1y/auto-fn12.C: Ditto.
	* g++.dg/cpp1y/auto-fn13.C: Ditto.
	* g++.dg/cpp1y/auto-fn14.C: Ditto.
	* g++.dg/cpp1y/auto-fn15.C: Ditto.
	* g++.dg/cpp1y/auto-fn16.C: Ditto.
	* g++.dg/cpp1y/auto-fn17.C: Ditto.
	* g++.dg/cpp1y/auto-fn18.C: Ditto.
	* g++.dg/cpp1y/auto-fn19.C: Ditto.
	* g++.dg/cpp1y/auto-fn20.C: Ditto.
	* g++.dg/cpp1y/auto-fn21.C: Ditto.
	* g++.dg/cpp1y/auto-fn22.C: Ditto.
	* g++.dg/cpp1y/auto-fn23.C: Ditto.
	* g++.dg/cpp1y/auto-fn24.C: Ditto.
	* g++.dg/cpp1y/auto-fn25.C: Ditto.
	* g++.dg/cpp1y/auto-mangle1.C: Ditto.
	* g++.dg/cpp1y/auto-neg1.C: Ditto.
	* g++.dg/cpp1y/digit-sep.C: Ditto.
	* g++.dg/cpp1y/digit-sep-neg.C: Ditto.
	* g++.dg/cpp1y/digit-sep-cxx11-neg.C: Ditto.
	* g++.dg/cpp1y/fn-generic-member-ool.C: Ditto.
	* g++.dg/cpp1y/lambda-deduce-mult.C: Ditto.
	* g++.dg/cpp1y/lambda-generic.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-cfun.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-dep.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-mixed.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-udt.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-variadic.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-vla1.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-x.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-xcfun.C: Ditto.
	* g++.dg/cpp1y/lambda-generic-xudt.C: Ditto.
	* g++.dg/cpp1y/lambda-init.C: Ditto.
	* g++.dg/cpp1y/lambda-init1.C: Ditto.
	* g++.dg/cpp1y/lambda-init2.C: Ditto.
	* g++.dg/cpp1y/lambda-init3.C: Ditto.
	* g++.dg/cpp1y/lambda-init4.C: Ditto.
	* g++.dg/cpp1y/lambda-init5.C: Ditto.
	* g++.dg/cpp1y/lambda-init6.C: Ditto.
	* g++.dg/cpp1y/lambda-init7.C: Ditto.
	* g++.dg/cpp1y/lambda-init8.C: Ditto.
	* g++.dg/cpp1y/lambda-init9.C: Ditto.
	* g++.dg/cpp1y/mangle1.C: Ditto.
	* g++.dg/cpp1y/pr57640.C: Ditto.
	* g++.dg/cpp1y/pr57644.C: Ditto.
	* g++.dg/cpp1y/pr58500.C: Ditto.
	* g++.dg/cpp1y/pr58533.C: Ditto.
	* g++.dg/cpp1y/pr58534.C: Ditto.
	* g++.dg/cpp1y/pr58535.C: Ditto.
	* g++.dg/cpp1y/pr58536.C: Ditto.
	* g++.dg/cpp1y/pr58548.C: Ditto.
	* g++.dg/cpp1y/pr58549.C: Ditto.
	* g++.dg/cpp1y/pr58637.C: Ditto.
	* g++.dg/cpp1y/pr58708.C: Ditto.
	* g++.dg/cpp1y/pr59110.C: Ditto.
	* g++.dg/cpp1y/pr59112.C: Ditto.
	* g++.dg/cpp1y/pr59113.C: Ditto.
	* g++.dg/cpp1y/pr59629.C: Ditto.
	* g++.dg/cpp1y/pr59635.C: Ditto.
	* g++.dg/cpp1y/pr59636.C: Ditto.
	* g++.dg/cpp1y/pr59638.C: Ditto.
	* g++.dg/cpp1y/pr59867.C: Ditto.
	* g++.dg/cpp1y/pr60033.C: Ditto.
	* g++.dg/cpp1y/pr60052.C: Ditto.
	* g++.dg/cpp1y/pr60053.C: Ditto.
	* g++.dg/cpp1y/pr60054.C: Ditto.
	* g++.dg/cpp1y/pr60064.C: Ditto.
	* g++.dg/cpp1y/pr60065.C: Ditto.
	* g++.dg/cpp1y/pr60190.C: Ditto.
	* g++.dg/cpp1y/pr60311.C: Ditto.
	* g++.dg/cpp1y/pr60332.C: Ditto.
	* g++.dg/cpp1y/pr60376.C: Ditto.
	* g++.dg/cpp1y/pr60377.C: Ditto.
	* g++.dg/cpp1y/pr60384.C: Ditto.
	* g++.dg/cpp1y/pr60390.C: Ditto.
	* g++.dg/cpp1y/pr60391.C: Ditto.
	* g++.dg/cpp1y/pr60393.C: Ditto.
	* g++.dg/cpp1y/pr60573.C: Ditto.
	* g++.dg/cpp1y/pr60626.C: Ditto.
	* g++.dg/cpp1y/pr60627.C: Ditto.
	* g++.dg/cpp1y/regress1.C: Ditto.
	* g++.dg/cpp1y/system-binary-constants-1.C: Ditto.
	* g++.dg/cpp1y/udlit-char-template.C: Ditto.
	* g++.dg/cpp1y/udlit-char-template-neg.C: Ditto.
	* g++.dg/cpp1y/udlit-empty-string-neg.C: Ditto.
	* g++.dg/cpp1y/udlit-enc-prefix-neg.C: Ditto.
	* g++.dg/cpp1y/udlit-userdef-string.C: Ditto.
	* g++.dg/cpp1y/var-templ1.C: Ditto.
	* g++.dg/cpp1y/var-templ2.C: Ditto.
	* g++.dg/cpp1y/var-templ3.C: Ditto.
	* g++.dg/cpp1y/var-templ4.C: Ditto.
	* g++.dg/cpp1y/var-templ5.C: Ditto.
	* g++.dg/cpp1y/var-templ6.C: Ditto.
	* g++.dg/cpp1y/var-templ7.C: Ditto.
	* g++.dg/cpp1y/vla1.C: Ditto.
	* g++.dg/cpp1y/vla2.C: Ditto.
	* g++.dg/cpp1y/vla3.C: Ditto.
	* g++.dg/cpp1y/vla4.C: Ditto.
	* g++.dg/cpp1y/vla5.C: Ditto.
	* g++.dg/cpp1y/vla8.C: Ditto.
	* g++.dg/cpp1y/vla9.C: Ditto.
	* g++.dg/cpp1y/vla10.C: Ditto.
	* g++.dg/cpp1y/vla11.C: Ditto.
	* g++.dg/cpp1y/vla12.C: Ditto.
	* g++.dg/cpp1y/vla13.C: Ditto.
	* g++.dg/cpp1y/vla-initlist1.C: Ditto.
	* g++.dg/ext/vector23.C: Ditto.
	* g++.dg/ext/vla11.C: Ditto.
	* gcc/testsuite/g++.dg/ubsan/cxx1y-vla.C: Ditto.
	* g++.dg/warn/Wvla-2.C: Ditto.
	* g++.dg/debug/dwarf2/auto1.C: Ditto.
	* g++.dg/cpp1z/typename-tmpl-tmpl-parm-ped-neg.C: Ditto.
	* g++.dg/cpp1y/cplusplus.C: Check for exact date.
	* g++.dg/cpp1y/system-binary-constants-1.C: Check C++14 instead of C++1y
	in error message.
	* g++.dg/system-binary-constants-1.C: Ditto.
	* g++.dg/cpp1y/cplusplus_1y.C: New.
	* g++.dg/cpp1z/cplusplus.C: New.
	* lib/target-supports.exp:
	(check_effective_target_c++1y*): Rename to check_effective_target_c++14*
	(check_effective_target_c++11_only): Call check_effective_target_c++14;
	(check_effective_target_c++11_down): Ditto.

From-SVN: r214400
2014-08-23 16:50:22 +00:00
Joey Ye eac3e07966 files.c (find_file_in_dir): Always try to shorten for DOS non-system headers.
2014-05-09  Joey Ye  <joey.ye@arm.com>

	* files.c (find_file_in_dir): Always try to shorten for DOS
	non-system headers.
	* init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.

From-SVN: r210264
2014-05-09 08:50:22 +00:00
Richard Sandiford 35c3d610e3 Update copyright years in libcpp/
From-SVN: r206293
2014-01-02 22:24:45 +00:00
Joseph Myers d3f4ff8b51 ucnid-2011-1.c: New test.
gcc/testsuite:
	* c-c++-common/cpp/ucnid-2011-1.c: New test.

libcpp:
	* ucnid.tab: Add C11 and C11NOSTART data.
	* makeucnid.c (digit): Rename enum value to N99.
	(C11, N11, all_languages): New enum values.
	(NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
	(flags, decomp, combining_value): Use NUM_CODE_POINTS as array
	size.
	(decomp): Use unsigned int as element type.
	(all_decomp): New array.
	(read_ucnid): Handle C11 and C11NOSTART.  Use MAX_CODE_POINT.
	(read_table): Use MAX_CODE_POINT.  Store all decompositions in
	all_decomp.
	(read_derived): Use MAX_CODE_POINT.
	(write_table): Use NUM_CODE_POINTS.  Print N99, C11 and N11
	flags.  Print whole array variable declaration rather than just
	array contents.
	(char_id_valid, write_context_switch): New functions.
	(main): Call write_context_switch.
	* ucnid.h: Regenerate.
	* include/cpplib.h (struct cpp_options): Add c11_identifiers.
	* init.c (struct lang_flags): Add c11_identifiers.
	(cpp_set_lang): Set c11_identifiers option from selected language.
	* internal.h (struct normalize_state): Document "previous" as
	previous starter character.
	(NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
	* charset.c (DIG): Rename enum value to N99.
	(C11, N11): New enum values.
	(struct ucnrange): Give name to struct.  Use short for flags and
	unsigned int for end of range.  Include ucnid.h for whole variable
	declaration.
	(ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
	Allow for C11 in determining valid characters and valid start
	characters.  Use check_nfc for non-Hangul context-dependent
	checks.  Only store starter characters in nst->previous.
	(_cpp_valid_ucn): Pass new argument to
	NORMALIZE_STATE_UPDATE_IDNUM.
	* lex.c (lex_identifier): Pass new argument to
	NORMALIZE_STATE_UPDATE_IDNUM.  Call NORMALIZE_STATE_UPDATE_IDNUM
	after initial non-UCN part of identifier.
	(lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.

From-SVN: r204886
2013-11-16 00:05:08 +00:00
Tobias Burnus e8ff5196a8 c.opt (-Wdate-time): New option
2013-11-05  Tobias Burnus  <burnus@net-b.de>

gcc/c-family/
        * c.opt (-Wdate-time): New option
        * c-opts.c (sanitize_cpp_opts): Pass on to libcpp.

gcc/
        * doc/invoke.texi (-Wdate-time): Document.

gcc/fortran
        * lang.opt (-Wdate-time): New option
        * cpp.c (gfc_cpp_option_data): Add warn_date_time.
        (gfc_cpp_init_options, gfc_cpp_handle_option,
        gfc_cpp_post_options): Handle it and pass on to libcpp.

gcc/testsuite/
        * g++.dg/warn/wdate-time.C: New.
        * gcc.dg/wdate-time.c: New.
        * gfortran.dg/wdate-time.F90: New.

libcpp/
        * include/cpplib.h (CPP_W_DATE_TIME): Added.
        (cpp_options): Add warn_date_time.
        * init.c (cpp_create_reader): Init it.
        * macro.c (_cpp_builtin_macro_text): Warn when
        __DATE__/__TIME__/__TIMESTAMP__ is used.

From-SVN: r204420
2013-11-05 21:27:22 +01:00
Edward Smith-Rowland 7057e6452b Implement C++14 digit separators.
libcpp:

2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>

        Implement C++14 digit separators.
	* include/cpplib.h (cpp_options): Add digit_separators flag.
	* internal.h (DIGIT_SEP(c)): New macro.
	* expr.c (cpp_classify_number): Check improper placement of digit sep;
	(cpp_interpret_integer): Skip over digit separators.
	* init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
	digit separator flags per language; (cpp_set_lang): Set
	digit_separators
	* lex.c (lex_number): Add digits separator to allowable characters for
	C++14.


gcc/c-family:

2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>

        Implement C++14 digit separators.
	* c-lex.c (interpret_float): Remove digit separators from scratch string
	before building real literal.


gcc/testsuite:

2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>

        Implement C++14 digit separators.
	* g++.dg/cpp1y/digit-sep.C: New.
	* g++.dg/cpp1y/digit-sep-neg.C: New.
	* g++.dg/cpp1y/digit-sep-cxx11-neg.C: New.


libstdc++-v3:

2013-10-31  Edward Smith-Rowland  <3dw4rd@verizon.net>

        Implement C++14 digit separators.
	* include/include/bits/parse_numbers.h: Change struct _Digit<_Base, '`'>
	to struct _Digit<_Base, '\''>.

From-SVN: r204260
2013-10-31 14:01:23 +00:00
Jakub Jelinek 01187df097 N3472 binary constants
N3472 binary constants
	* include/cpplib.h (struct cpp_options): Fix a typo in user_literals
	field comment.  Add binary_constants field.
	* init.c (struct lang_flags): Add binary_constants field.
	(lang_defaults): Add bin_cst column to the table.
	(cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
	* expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
	in diagnostics.  Accept binary constants if
	CPP_OPTION (pfile, binary_constants) even when pedantic.  Adjust
	pedwarn message.

	* g++.dg/cpp/limits.C: Adjust warning wording.
	* g++.dg/system-binary-constants-1.C: Likewise.
	* g++.dg/cpp1y/system-binary-constants-1.C: New test.

From-SVN: r198380
2013-04-28 23:36:57 +02:00
Paolo Carlini 61949153f4 cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
/libcpp
2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
	* init.c (lang_defaults): Add defaults for the latter.
	(cpp_init_builtins): Define __cplusplus as 201300L for the latter.
	* lex.c (_cpp_lex_direct): Update.

/gcc/c-family
2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* c-opts.c (set_std_cxx11): Use CLK_CXX1Y and CLK_GNUCXX1Y.

/gcc/testsuite
2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp1y/cplusplus.C: New.

From-SVN: r198261
2013-04-24 19:33:54 +00:00
Richard Sandiford 500f3ed906 Update copyright years in libcpp.
From-SVN: r195162
2013-01-14 18:13:59 +00:00
Simon Baldwin 5dc99c4678 cpplib.h (struct cpp_options): Add canonical_system_headers.
* include/cpplib.h (struct cpp_options): Add canonical_system_headers.
    * files.c (find_file_in_dir): Call maybe_shorter_path() only if
    canonical_system_headers is set.
    * init.c (cpp_create_reader): Initialize canonical_system_headers.
    * configure.ac: Add new --enable-canonical-system-headers.
    * configure: Regenerate.
    * config.in: Regenerate.

    * doc/cppopts.texi: Document -f[no-]canonical-system-headers.
    * doc/install.texi: Document --enable-canonical-system-headers.

    * c.opt: Add f[no-]canonical-system-headers.
    * c-opts.c (c_common_handle_option): Handle
    OPT_fcanonical_system_headers.

From-SVN: r193569
2012-11-16 17:14:05 +00:00
Ed Smith-Rowland a4a0016d60 Implement a flag -fext-numeric-literals that allows control of whether GNU...
Implement a flag -fext-numeric-literals that allows control of whether GNU
numeric suffix extensions are parsed or passed to C++ as user-defined literals.

From-SVN: r193382
2012-11-10 00:08:49 +00:00
Joseph Myers 1efcb8c6f6 gcc:
* config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu |
	*-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu): Use
	glibc-c.o in c_target_objs and cxx_target_objs.  Use t-glibc in
	tmake_file.  Set target_has_targetcm.
	(tilegx-*-linux*, tilepro-*-linux*): Append to c_target_objs and
	cxx_target_objs rather than overriding previous value.
	* config/glibc-c.c, config/t-glibc: New.
	* doc/tm.texi.in (TARGET_C_PREINCLUDE): New @hook.
	* doc/tm.texi: Regenerate.
	* hooks.c (hook_constcharptr_void_null): New.
	* hooks.h (hook_constcharptr_void_null): Declare.

gcc/c-family:
	* c-common.h (pch_cpp_save_state): Declare.
	* c-target.def (c_preinclude): New hook.
	* c-opts.c (done_preinclude): New.
	(push_command_line_include): Handle default preincluded header.
	(cb_file_change): Call pch_cpp_save_state when calling
	push_command_line_include.
	* c-pch.c (pch_ready_to_save_cpp_state, pch_cpp_state_saved)
	(pch_cpp_save_state): New.
	(pch_init): Call pch_cpp_save_state conditionally, instead of
	calling cpp_save_state.

gcc/testsuite:
	* gcc.dg/c99-predef-1.c: New test.
	* gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c,
	gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c,
	gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c,
	gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c,
	gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c,
	gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c,
	gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c,
	gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c,
	gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c,
	gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c,
	gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c,
	gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to
	dg-options.

libcpp:
	* files.c (struct _cpp_file): Add implicit_preinclude.
	(pch_open_file): Allow a previously opened implicitly included
	file.
	(_cpp_find_file): Add implicit_preinclude argument.  Free file and
	do not call open_file_failed if implicit_preinclude.  Store
	implicit_preinclude value.
	(_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
	Update calls to _cpp_find_file.
	(_cpp_stack_include): Handle IT_DEFAULT.
	(cpp_push_default_include): New.
	* include/cpplib.h (cpp_push_default_include): Declare.
	* init.c (cpp_read_main_file): Update call to _cpp_find_file.
	* internal.h (enum include_type): Add IT_DEFAULT.
	(_cpp_find_file): Update prototype.

From-SVN: r192715
2012-10-23 15:55:55 +01:00
Diego Novillo 0823efedd0 backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).

As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.

Other than the bootstrap change, the patch makes no functional changes to the
compiler.  Everything should build as it does now in trunk.  The main
changes in this patch are:

1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
   user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
   called from gdb.

As discussed before, several of these changes do not fully change
the call sites to use the new APIs.

The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus).  Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.

ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.

	* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
	POSTSTAGE1_CONFIGURE_FLAGS.
	* Makefile.in: Regenerate.
	* configure.ac (ENABLE_BUILD_WITH_CXX): Remove.  Update all users.
	Force C++ when bootstrapping.
	* configure: Regenerate.


libcpp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure.ac: Likewise.
	* configure: Regenerate.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  New C++ hash table.

	* include/symtab.h (typedef struct ht hash_table): Change the typedef
	name to cpp_hash_table.  Update all users of the typedef.

gcc/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* configure.ac (CXX_FOR_BUILD): Define and substitute.
	(BUILD_CXXFLAGS): Define.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	Force all build to be with C++.
	* Makefile.in (BUILD_CXXFLAGS): Use it.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure: Regenerate.
	* config.in: Regenerate.
	* doc/install.texi: Remove documentation for --enable-build-with-cxx
	and --enable-build-poststage1-with-cxx.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-implement VEC in C++.

	* vec.c (vec_heap_free): Convert into a template function.
	(vec_gc_o_reserve_1): Make extern.
	(vec_gc_p_reserve): Remove.
	(vec_gc_p_reserve_exact): Remove.
	(vec_gc_o_reserve): Remove.
	(vec_gc_o_reserve_exact): Remove.
	(vec_heap_o_reserve_1): Make extern.
	(vec_heap_p_reserve): Remove.
	(vec_heap_p_reserve_exact): Remove.
	(vec_heap_o_reserve): Remove.
	(vec_heap_o_reserve_exact): Remove.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
	VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
	in the file.
	(VEC): Define to vec_t<T>.
	(vec_allocation_t): Define.
	(struct vec_prefix): Move earlier in the file.
	(vec_t<T>): New template.
	(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
	DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
	DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
	DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
	(DEF_VEC_A): Provide template instantiations for
	GC/PCH markers that do not traverse the vector.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(vec_stack_free): Re-write as a template function.
	(vec_reserve): New template function.
	(vec_reserve_exact): New template function.
	(vec_heap_free): New template function if GATHER_STATISTICS is
	defined.  Otherwise, macro that expands to free().
	(VEC_length_1): New template function.
	(VEC_length): Call it.
	(VEC_empty_1): New template function.
	(VEC_empty): Call it.
	(VEC_address_1): New template function.
	(VEC_address): Call it.
	(VEC_last_1): New template function.
	(VEC_last): Call it.  Change return type to T&.
	Change all users that used VEC_Os.
	(VEC_index_1): New template function.
	(VEC_index): Call it.  Return a T& instead of a T*.
	Update all callers that were using VEC_O before.
	(VEC_iterate_1): New template function.
	(VEC_iterate): Call it.
	(VEC_embedded_size_1): New template function.
	(VEC_embedded_size): Call it.
	(VEC_embedded_init_1): New template function.
	(VEC_embedded_init): Call it.
	(VEC_alloc_1): New template function.
	(VEC_alloc): Call it.  If A is 'stack', call XALLOCAVAR to
	do the allocation.
	(VEC_free_1): New template function.
	(VEC_free): Call it.
	(VEC_copy_1): New template function.
	(VEC_copy): Call it.
	(VEC_space_1): New template function
	(VEC_space): Call it.
	(VEC_reserve_1): New template function.
	(VEC_reserve): Call it.
	(VEC_reserve_exact_1): New template function.
	(VEC_reserve_exact): Call it.
	(VEC_splice_1): New template function.
	(VEC_splice): Call it.
	(VEC_safe_splice_1): New template function.
	(VEC_safe_splice): Call it.
	(VEC_quick_push_1): New template function.  Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_quick_push): Call it.
	(VEC_safe_push_1): New template function. Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_safe_push): Call it.
	(VEC_pop_1): New template function.
	(VEC_pop): Call it.
	(VEC_truncate_1): New template function.
	(VEC_truncate): Call it.
	(VEC_safe_grow_1): New template function.
	(VEC_safe_grow): Call it.
	(VEC_safe_grow_cleared_1): New template function.
	(VEC_safe_grow_cleared): Call it.
	(VEC_replace_1): New template function.
	(VEC_replace): Call it.  Always accept T instead of T*.
	Update all callers that used VEC_Os.
	(VEC_quick_insert_1): New template function.
	(VEC_quick_insert): Call it.
	(VEC_safe_insert_1): New template function.
	(VEC_safe_insert): Call it.
	(VEC_ordered_remove_1): New template function.
	(VEC_ordered_remove): Call it.
	(VEC_unordered_remove_1): New template function.
	(VEC_unordered_remove): Call it.
	(VEC_block_remove_1): New template function.
	(VEC_block_remove): Call it.
	(VEC_lower_bound_1): New template function.
	(VEC_lower_bound): Call it.
	(VEC_OP): Remove.
	(DEF_VEC_FUNC_P): Remove.
	(DEF_VEC_ALLOC_FUNC_P): Remove.
	(DEF_VEC_NONALLOC_FUNCS_P): Remove.
	(DEF_VEC_FUNC_O): Remove.
	(DEF_VEC_ALLOC_FUNC_O): Remove.
	(DEF_VEC_NONALLOC_FUNCS_O): Remove.
	(DEF_VEC_ALLOC_FUNC_I): Remove.
	(DEF_VEC_NONALLOC_FUNCS_I): Remove.
	(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
	(vec_reserve_exact): New template function.

	* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
	* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
	(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
	(def_vec_alloc): Remove.  Update all callers.
	* gengtype.c (filter_type_name): New.
	(output_mangled_typename): Call it.
	(write_func_for_structure): Likewise.
	(write_types): Likewise.
	(write_root): Likewise.
	(write_typed_alloc_def): Likewise.
	(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
	(note_def_vec_alloc): Remove.
	* gengtype.h (note_def_vec_alloc): Remove.
	(DEFVEC_ALLOC): Remove token code.

	* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
	inside the insn traversal loop.
	* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
	* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
	* reg-stack.c (stack): Rename to STACK_PTR.  Update all users.
	* tree-vrp.c (stack): Rename to EQUIV_STACK.  Update all users.

	* config/bfin/bfin.c (hwloop_optimize): Update some calls to
	VEC_* for vectors of non-pointers.
	* config/c6x/c6x.c (try_rename_operands): Likewise.
	(reshuffle_units): Likewise.
	* config/mips/mips.c (mips_multi_start): Likewise.
	(mips_multi_add): Likewise.
	(mips_multi_copy_insn): Likewise.
	(mips_multi_set_operand): Likewise.
	* hw-doloop.c (discover_loop): Likewise.
	(discover_loops): Likewise.
	(reorg_loops): Likewise.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  C++ support in gengtype.

	* coretypes.h (gt_pointer_operator): Move from ...
	* ggc.h: ... here.
	* doc/gty.texi: Document support for C++ templates and
	user-provided markers.
	* gcc/gengtype-lex.l: Update copyright year.
	Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
	DEFVEC_I.
	* gengtype-parse.c: Update copyright year.
	(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
	(require_template_declaration): New.
	(typedef_name): Call it.
	(type): Replace IS_UNION with KIND. Replace all users.
	(def_vec): Remove.  Update all users.
	* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
	(write_state_user_struct_type): New.
	(write_state_type): Call it.
	(read_state_user_struct_type): New.
	(read_state_type): Call it.
	* gengtype.c: Update copyright year.
	(dump_pair): Move declaration to the top.
	(dump_type): Likewise.
	(dump_type_list): Likewise.
	(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
	(create_user_defined_type): New.
	(resolve_typedef): Call it.
	(new_structure): Replace argument ISUNION with KIND.
	Change users to refer to KIND directly.
	Update all callers.
	(find_structure): Likewise.
	(set_gc_used_type): Handle TYPE_USER_STRUCT.
	(create_file): Update HDR to include new copyright year.
	(struct walk_type_data): Add field IN_PTR_FIELD.
	(output_mangled_typename): Handle TYPE_USER_STRUCT.
	(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
	Clear it afterwards.
	Handle TYPE_USER_STRUCT.
	(write_types_process_field): Handle TYPE_USER_STRUCT.
	(get_type_specifier): Move earlier in the file.
	(write_type_decl): New.
	(write_marker_function_name): New.
	(write_user_func_for_structure_ptr): New.
	(write_user_func_for_structure_body): New.
	(write_user_marking_functions): New.
	(write_func_for_structure): Call write_marker_function_name
	and write_type_decl.
	Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
	function directly.
	Call write_user_marking_functions on TYPE_USER_STRUCTs.
	(write_types_local_user_process_field): New.
	(write_pch_user_walking_for_structure_body): New.
	(write_pch_user_walking_functions): New.
	(write_types_local_process_field): Handle TYPE_USER_STRUCT.
	(write_local_func_for_structure): Do not call walk_type for
	TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
	Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
	(write_root): Handle TYPE_USER_STRUCT.
	(vec_prefix_type): Remove.  Update all users.
	(note_def_vec): Remove.  Update all users.
	(dump_typekind): Handle TYPE_USER_STRUCT.
	(dump_type): Initialize SEEN_TYPES, if needed.
	Handle TYPE_USER_STRUCT.
	(dump_everything): Do not initialize SEEN_TYPES.
	* gengtype.h: Update copyright year.
	(enum typekind): Add TYPE_USER_STRUCT.
	(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
	Convert into function.
	Add an overload taking const_type_p.
	Update all callers.
	(new_structure): Change second field to type enum typekind.
	Update all users.
	(find_structure): Likewise.
	(note_def_vec): Remove.
	(DEFVEC_OP): Remove.
	(DEFVEC_I): Remove.
	* ggc-page.c (gt_ggc_mx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	* ggc-zone.c (gt_ggc_mx): Add entry points for marking
	'const char *&' and 'unsigned char *&'.
	* stringpool.c (gt_pch_nx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	Add an entry point for the overload taking arguments 'unsigned char
	*', 'gt_pointer_operator' and 'void *'.
	* vec.h (struct vec_prefix): Remove GTY marker.
	(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
	(gt_ggc_mx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
	function.
	(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
	function.

	* basic-block.h (struct edge_def): Mark GTY((user)).
	Remove all GTY markers from fields.
	(gt_ggc_mx): Declare.
	(gt_pch_nx): Declare.
	* tree-cfg.c (gt_ggc_mx): New.
	(gt_pch_nx): New.

	* gengtype-lex.l (USER_GTY): Add pattern for "user".
	* gengtype-parse.c (option): Handle USER_GTY.
	(opts_have): New.
	(type): Call it.
	If the keyword 'user' is used, do not walk the fields
	of the structure.
	* gengtype.h (USER_GTY): Add.
	* doc/gty.texi: Update.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Implement C++ hash table.

	* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
	* hash-table.c: Likewise.
	* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
	(static htab_t same_succ_htab): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(same_succ_print_traverse): Make extern ssa_.... Change callers.
	Remove void* casting.
	(same_succ_hash): Likewise.
	(same_succ_equal): Likewise.
	(same_succ_delete): Likewise.
	* tree-ssa-threadupdate.c: Include hash-table.h.
	(struct local_info): Rename to ssa_local_info_t to avoid overloading
	the type name local_info with the variable name local_info.
	(static htab_t redirection_data): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(redirection_data_hash): Make extern ssa_.... Change callers.
	Remove void* casting.
	(redirection_data_eq): Likewise.
	(fix_duplicate_block_edges): Likewise.
	(create_duplicates): Likewise.
	(fixup_template_block): Likewise.
	(redirect_edges): Likewise.
	(lookup_redirection_data): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	* tree-ssa-ccp.c: Include hash-table.h.
	(typedef gimple_htab): New.  Uses hash_table.  Replace specific uses
	of htab_t with gimple_htab.  Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
	(hash_ssa_name_by_var): Make extern. Remove void* casting.
	(eq_ssa_name_by_var): Likewise.
	(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
	to hash_table. Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* coverage.c: Include hash-table.h instead of hashtab.h.
	(static htab_t counts_hash): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
	of htab_... Remove void* casting.
	(htab_counts_entry_eq): Likewise.
	(htab_counts_entry_del): Likewise.
	* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
	(static htab_t expression_to_id): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(static htab_t phi_translate_table): Likewise.
	(pre_expr_eq): Make extern ssa_.... Change callers.
	Remove void* casting.
	(pre_expr_hash): Likewise.
	(expr_pred_trans_hash): Likewise.
	(expr_pred_trans_eq): Likewise.
	(alloc_expression_id): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	(lookup_expression_id): Likewise.
	(phi_trans_lookup): Likewise.
	(phi_trans_add): Likewise.
	* stringpool.c: Rename uses of libcpp typedef hash_table to
	cpp_hash_table.
	* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
	Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  Re-write double_int in C++.

	* hash-table.h
	(typedef double_int): Change to struct (POD).
	(double_int::make): New overloads for int to double-int conversion.
	(double_int::mask): New.
	(double_int::max_value): New.
	(double_int::min_value): New.
	(double_int::operator ++): New.
	(double_int::operator --): New.
	(double_int::operator *=): New.
	(double_int::operator +=): New.
	(double_int::operator -=): New.
	(double_int::to_signed): New.
	(double_int::to_unsigned): New.
	(double_int::fits_unsigned): New.
	(double_int::fits_signed): New.
	(double_int::fits): New.
	(double_int::trailing_zeros): New.
	(double_int::popcount): New.
	(double_int::multiple_of): New.
	(double_int::set_bit): New.
	(double_int::mul_with_sign): New.
	(double_int::operator * (binary)): New.
	(double_int::operator + (binary)): New.
	(double_int::operator - (binary)): New.
	(double_int::operator - (unary)): New.
	(double_int::operator ~ (unary)): New.
	(double_int::operator & (binary)): New.
	(double_int::operator | (binary)): New.
	(double_int::operator ^ (binary)): New.
	(double_int::and_not): New.
	(double_int::lshift): New.
	(double_int::rshift): New.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::lrotate): New.
	(double_int::rrotate): New.
	(double_int::div): New.
	(double_int::sdiv): New.
	(double_int::udiv): New.
	(double_int::mod): New.
	(double_int::smod): New.
	(double_int::umod): New.
	(double_int::divmod): New.
	(double_int::sdivmod): New.
	(double_int::udivmod): New.
	(double_int::ext): New.
	(double_int::zext): New.
	(double_int::sext): New.
	(double_int::is_zero): New.
	(double_int::is_one): New.
	(double_int::is_minus_one): New.
	(double_int::is_negative): New.
	(double_int::cmp): New.
	(double_int::ucmp): New.
	(double_int::scmp): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int::max): New.
	(double_int::smax): New.
	(double_int::umax): New.
	(double_int::min): New.
	(double_int::smin): New.
	(double_int::umin): New.
	(double_int::operator ==): New.
	(double_int::operator !=): New.
	(shwi_to_double_int): Change implementation to use member function.
	(double_int_minus_one): Likewise.
	(double_int_zero): Likewise.
	(double_int_one): Likewise.
	(double_int_two): Likewise.
	(double_int_ten): Likewise.
	(uhwi_to_double_int): Likewise.
	(double_int_to_shwi): Likewise.
	(double_int_to_uhwi): Likewise.
	(double_int_fits_in_uhwi_p): Likewise.
	(double_int_fits_in_shwi_p): Likewise.
	(double_int_fits_in_hwi_p): Likewise.
	(double_int_mul): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_setbit): Likewise.
	(double_int_ctz): Likewise.
	(double_int_not): Likewise.
	(double_int_ior): Likewise.
	(double_int_and): Likewise.
	(double_int_and_not): Likewise.
	(double_int_xor): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_ext): Likewise.
	(double_int_sext): Likewise.
	(double_int_zext): Likewise.
	(double_int_mask): Likewise.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_zero_p): Likewise.
	(double_int_one_p): Likewise.
	(double_int_minus_one_p): Likewise.
	(double_int_equal_p): Likewise.
	(double_int_popcount): Likewise.
	* hash-table.c
	(double_int_mask): Reuse implementation for double_int::mask.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_ext): Likewise.
	(double_int_zext): Likewise.
	(double_int_sext): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int_setbit): Reuse implementation for double_int::set_bit,
	which avoids a name conflict with a macro.
	(double_int_double_int_ctz): Reuse implementation for
	double_int::trailing_zeros.
	(double_int_fits_in_shwi_p): Reuse implementation for
	double_int::fits_signed.
	(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
	(double_int_mul): Reuse implementation for binary
	double_int::operator *.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Reuse implementation for unary
	double_int::operator -.
	(double_int_max_value): Likewise.
	* fixed-value.c: Change to use member functions introduced above.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Support tree macro calling
	from gdb.

	* tree.h (tree_check): New.
	(TREE_CHECK): Use inline function above instead of __extension__.
	(tree_not_check): New.
	(TREE_NOT_CHECK): Use inline function above instead of __extension__.
	(tree_check2): New.
	(TREE_CHECK2): Use inline function above instead of __extension__.
	(tree_not_check2): New.
	(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
	(tree_check3): New.
	(TREE_CHECK3): Use inline function above instead of __extension__.
	(tree_not_check3): New.
	(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
	(tree_check4): New.
	(TREE_CHECK4): Use inline function above instead of __extension__.
	(tree_not_check4): New.
	(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
	(tree_check5): New.
	(TREE_CHECK5): Use inline function above instead of __extension__.
	(tree_not_check5): New.
	(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
	(contains_struct_check): New.
	(CONTAINS_STRUCT_CHECK): Use inline function above instead of
	__extension__.
	(tree_class_check): New.
	(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
	(tree_range_check): New.
	(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
	(omp_clause_subcode_check): New.
	(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_range_check): New.
	(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
	__extension__.
	(expr_check): New.
	(EXPR_CHECK): Use inline function above instead of __extension__.
	(non_type_check): New.
	(NON_TYPE_CHECK): Use inline function above instead of __extension__.
	(tree_vec_elt_check): New.
	(TREE_VEC_ELT_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_elt_check): New.
	(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check): New.
	(TREE_OPERAND_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check_code): New.
	(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
	__extension__.
	(TREE_CHAIN): Simplify implementation.
	(TREE_TYPE): Simplify implementation.
	(tree_operand_length): Move for compilation dependences.
	* gdbinit.in: (macro define __FILE__): New.
	(macro define __LINE__): New.
	(skip "tree.h"): New.

gcc/cp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-write VEC in C++.

	* call.c (add_function_candidate): Remove const qualifier
	from call to VEC_index.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* go-gcc.cc: Likewise.
	* go-system.h: Likewise.

From-SVN: r190402
2012-08-14 21:56:07 -04:00
Dodji Seketeli 51fce2d396 Switch -ftrack-macro-expansion=2 on by default.
This switches the compiler to -ftrack-macro-expansion=2 by default.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

libcpp/

	* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
	by default.  Add comments.

gcc/docs/

	* cppopts.texi: Adjust for enabling -ftrack-macro-expansion=2 by
	default.

From-SVN: r186977
2012-04-30 13:43:43 +02:00
Ollie Wild 7f5f5f98c5 Add new option, -Wliteral-suffix.
This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore.  According to [lex.ext]p10, this is
ill-formed.

Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens.  This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
<inttypes.h>, as in the following code block:

  int main() {
    int64_t i64 = 123;
    printf("My int64: %"PRId64"\n", i64);
  }

Google ref b/6377711.

2012-04-27   Ollie Wild  <aaw@google.com>

	PR c++/52538
	* gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping.
	* gcc/c-family/c-opts.c (c_common_handle_option): Handle
	OPT_Wliteral_suffix.
	* gcc/c-family/c.opt: Add Wliteral-suffix.
	* gcc/doc/invoke.texi (Wliteral-suffix): Document new option.
	* gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test.
	* libcpp/include/cpplib.h (struct cpp_options): Add new field,
	warn_literal_suffix.
	(CPP_W_LITERAL_SUFFIX): New enum.
	* libcpp/init.c (cpp_create_reader): Default initialization of
	warn_literal_suffix.
	* libcpp/lex.c (lex_raw_string): Treat user-defined literals which
	don't begin with '_' as separate tokens and produce a warning.
	(lex_string): Ditto.

From-SVN: r186909
2012-04-27 14:29:32 +00:00