diff options
author | Martin Sebor <msebor@redhat.com> | 2019-05-17 17:55:43 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2019-05-17 11:55:43 -0600 |
commit | a9c697b88395a0f2b175ac30c59bd8c0c22d0db1 (patch) | |
tree | 824792abb43c3e017801b6e124f310ffffc36c17 /gcc/tree-cfg.c | |
parent | 6df6f67a283c62f0590d88b39d309b2c37cd7de1 (diff) | |
download | gcc-a9c697b88395a0f2b175ac30c59bd8c0c22d0db1.zip gcc-a9c697b88395a0f2b175ac30c59bd8c0c22d0db1.tar.gz gcc-a9c697b88395a0f2b175ac30c59bd8c0c22d0db1.tar.bz2 |
trans.c (check_inlining_for_nested_subprog): Quote reserved names.
gcc/ada/ChangeLog:
* gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote
reserved names.
gcc/brig/ChangeLog:
* brigfrontend/brig-control-handler.cc
(brig_directive_control_handler::operator): Remove trailing newline
from a diagnostic.
* brigfrontend/brig-module-handler.cc
(brig_directive_module_handler::operator): Remove a duplicated space
from a diagnostic.
gcc/c/ChangeLog:
* c-decl.c (start_decl): Quote keywords, operators, and
types in diagnostics.
(finish_decl): Same.
* c-parser.c (c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_transaction_cancel): Same.
* c-typeck.c (c_common_type): Same.
(build_conditional_expr): Same.
(digest_init): Same.
(process_init_element): Same.
(build_binary_op): Same.
gcc/c-family/ChangeLog:
* c-attribs.c (handle_no_sanitize_attribute): Quote identifiers,
keywords, operators, and types in diagnostics.
(handle_scalar_storage_order_attribute): Same.
(handle_mode_attribute): Same.
(handle_visibility_attribute): Same.
(handle_assume_aligned_attribute): Same.
(handle_no_split_stack_attribute): Same.
* c-common.c (shorten_compare): Same.
(c_common_truthvalue_conversion): Same.
(cb_get_source_date_epoch): Same.
* c-lex.c (cb_def_pragma): Quote keywords, operators, and types
in diagnostics.
(interpret_float): Same.
* c-omp.c (c_finish_omp_for): Same.
* c-opts.c (c_common_post_options): Same.
* c-pch.c (c_common_pch_pragma): Same.
* c-pragma.c (pop_alignment): Same.
(handle_pragma_pack): Same.
(apply_pragma_weak): Same.
(handle_pragma_weak): Same.
(handle_pragma_scalar_storage_order): Same.
(handle_pragma_redefine_extname): Same.
(add_to_renaming_pragma_list): Same.
(maybe_apply_renaming_pragma): Same.
(push_visibility): Same.
(handle_pragma_visibility): Same.
(handle_pragma_optimize): Same.
(handle_pragma_message): Same.
* c-warn.c (warn_for_omitted_condop): Same.
(lvalue_error): Same.
gcc/cp/ChangeLog:
* call.c (print_z_candidate): Wrap diagnostic text in a gettext
macro. Adjust.
(print_z_candidates): Same.
(build_conditional_expr_1): Quote keywords, operators, and types
in diagnostics.
(build_op_delete_call): Same.
(maybe_print_user_conv_context): Wrap diagnostic text in a gettext
macro.
(convert_like_real): Same.
(convert_arg_to_ellipsis): Quote keywords, operators, and types
in diagnostics.
(build_over_call): Same.
(joust): Break up an overlong line. Wrap diagnostic text in a gettext
macro.
* constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
(cxx_eval_constant_expression): Quote keywords, operators, and types
in diagnostics.
(potential_constant_expression_1): Same.
* cp-gimplify.c (cp_genericize_r): Same.
* cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
in diagnostics.
(type_promotes_to): Same.
* decl.c (check_previous_goto_1): Same.
(check_goto): Same.
(start_decl): Same.
(cp_finish_decl): Avoid parenthesizing a sentence for consistency.
(grok_op_properties): Quote keywords, operators, and types
in diagnostics.
* decl2.c (grokfield): Same.
(coerce_delete_type): Same.
* except.c (is_admissible_throw_operand_or_catch_parameter): Same.
* friend.c (do_friend): Quote C++ tokens.
* init.c (build_new_1): Quote keywords, operators, and types
in diagnostics.
(build_vec_delete_1): Same.
(build_delete): Same.
* lex.c (parse_strconst_pragma): Same.
(handle_pragma_implementation): Same.
(unqualified_fn_lookup_error): Same.
* mangle.c (write_type): Same.
* method.c (defaulted_late_check): Avoid two consecutive punctuators.
* name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
(pop_everything): Same.
* parser.c (cp_lexer_start_debugging): Quote a macro name.
in a diagnostic
(cp_lexer_stop_debugging): Same.
(cp_parser_userdef_numeric_literal): Quote a C++ header name
in a diagnostic.
(cp_parser_nested_name_specifier_opt): Quote keywords, operators,
and types in diagnostics.
(cp_parser_question_colon_clause): Same.
(cp_parser_asm_definition): Same.
(cp_parser_init_declarator): Same.
(cp_parser_template_declaration_after_parameters): Avoid capitalizing
a sentence in a diagnostic.
(cp_parser_omp_declare_reduction): Quote keywords, operators, and types
in diagnostics.
(cp_parser_transaction): Same.
* pt.c (maybe_process_partial_specialization): Replace second call
to permerror with inform for consistency with other uses.
(expand_integer_pack): Quote keywords, operators, and types
in diagnostics.
* rtti.c (get_typeid): Quote keywords, operators, and types
in diagnostics.
(build_dynamic_cast_1): Same.
* semantics.c (finish_asm_stmt): Same.
(finish_label_decl): Same.
(finish_bases): Same.
(finish_offsetof): Same.
(cp_check_omp_declare_reduction): Same.
(finish_decltype_type): Same.
* tree.c (handle_init_priority_attribute): Same. Add detail
to diagnostics.
(maybe_warn_zero_as_null_pointer_constant): Same.
* typeck.c (cp_build_binary_op): Quote keywords, operators, and types
in diagnostics.
(cp_build_unary_op): Same.
(check_for_casting_away_constness): Same.
(build_static_cast): Same.
(build_const_cast_1): Same.
(maybe_warn_about_returning_address_of_local): Same.
(check_return_expr): Same.
* typeck2.c (abstract_virtuals_error_sfinae): Same.
(digest_init_r): Replace a tab with spaces in a diagnostic.
(build_functional_cast): Quote keywords, operators, and types
in diagnostics.
gcc/d/ChangeLog:
* d-builtins.cc (d_init_builtins): Quote keywords, operators,
and types in diagnostics.
* d-codegen.cc (get_array_length): Same. Replace can't with cannot.
* d-convert.cc (convert_expr): Same.
* d-frontend.cc (getTypeInfoType): Quote an option name in
a diagnostic.
* d-lang.cc (d_handle_option): Same.
(d_parse_file): Same.
* decl.cc: Remove a trailing period from a diagnostic.
* expr.cc: Use a directive for an apostrophe.
* toir.cc: Quote keywords, operators, and types in diagnostics.
* typeinfo.cc (build_typeinfo): Quote an option name in a diagnostic.
gcc/fortran/ChangeLog:
* gfortranspec.c (append_arg): Spell out the word "argument."
gcc/ChangeLog:
* config/i386/i386-expand.c (get_element_number): Quote keywords
and other internal names in diagnostics. Adjust other diagnostic
formatting issues noted by -Wformat-diag.
* config/i386/i386-features.c
(ix86_mangle_function_version_assembler_name): Same.
* config/i386/i386-options.c (ix86_handle_abi_attribute): Same.
* config/i386/i386.c (ix86_function_type_abi): Same.
(ix86_function_ms_hook_prologue): Same.
(classify_argument): Same.
(ix86_expand_prologue): Same.
(ix86_md_asm_adjust): Same.
(ix86_memmodel_check): Same.
gcc/ChangeLog:
* builtins.c (expand_builtin_atomic_always_lock_free): Quote
identifiers, keywords, operators, and types in diagnostics. Correct
quoting, spelling, and sentence capitalization issues.
(expand_builtin_atomic_is_lock_free): Same.
(fold_builtin_next_arg): Same.
* cfgexpand.c (expand_one_var): Same.
(tree_conflicts_with_clobbers_p): Same.
(expand_asm_stmt): Same.
(verify_loop_structure): Same.
* cgraphunit.c (process_function_and_variable_attributes): Same.
* collect-utils.c (collect_execute): Same.
* collect2.c (maybe_run_lto_and_relink): Same.
(is_lto_object_file): Same.
(scan_prog_file): Same.
* convert.c (convert_to_real_1): Same.
* dwarf2out.c (dwarf2out_begin_prologue): Same.
* except.c (verify_eh_tree): Same.
* gcc.c (execute): Same.
(eval_spec_function): Same.
(run_attempt): Same.
(driver::set_up_specs): Same.
(compare_debug_auxbase_opt_spec_function): Same.
* gcov-tool.c (unlink_gcda_file): Same.
(do_merge): Same.
(do_rewrite): Same.
* gcse.c (gcse_or_cprop_is_too_expensive): Same.
* gimplify.c (gimplify_asm_expr): Same.
(gimplify_adjust_omp_clauses): Same.
* hsa-gen.c (gen_hsa_addr_insns): Same.
(gen_hsa_insns_for_load): Same.
(gen_hsa_cmp_insn_from_gimple): Same.
(gen_hsa_insns_for_operation_assignment): Same.
(gen_get_level): Same.
(gen_hsa_alloca): Same.
(omp_simple_builtin::generate): Same.
(gen_hsa_atomic_for_builtin): Same.
(gen_hsa_insns_for_call): Same.
* input.c (dump_location_info): Same.
* ipa-devirt.c (compare_virtual_tables): Same.
* ira.c (ira_setup_eliminable_regset): Same.
* lra-assigns.c (lra_assign): Same.
* lra-constraints.c (lra_constraints): Same.
* lto-streamer-in.c (lto_input_mode_table): Same.
* lto-wrapper.c (get_options_from_collect_gcc_options): Same.
(merge_and_complain): Same.
(compile_offload_image): Same.
(compile_images_for_offload_targets): Same.
(debug_objcopy): Same.
(run_gcc): Same.
(main): Same.
* opts.c (print_specific_help): Same.
(parse_no_sanitize_attribute): Same.
(print_help): Same.
(handle_param): Same.
* plugin.c (add_new_plugin): Same.
(parse_plugin_arg_opt): Same.
(try_init_one_plugin): Same.
* print-rtl.c (debug_bb_n_slim): Quote identifiers, keywords,
operators, and types in diagnostics. Correct quoting and spelling
issues.
* read-rtl-function.c (parse_edge_flag_token): Same.
(function_reader::parse_enum_value): Same.
* reg-stack.c (check_asm_stack_operands): Same.
* regcprop.c (validate_value_data): Same.
* sched-rgn.c (make_pass_sched_fusion): Same.
* stmt.c (check_unique_operand_names): Same.
* targhooks.c (default_target_option_pragma_parse): Same.
* tlink.c (recompile_files): Same.
* toplev.c (process_options): Same.
(do_compile): Same.
* trans-mem.c (diagnose_tm_1): Same.
(ipa_tm_scan_irr_block): Same.
(ipa_tm_diagnose_transaction): Same.
* tree-cfg.c (verify_address): Same. Use get_tree_code_name to
format a tree code name in a diagnostic.
(verify_types_in_gimple_min_lval): Same.
(verify_types_in_gimple_reference): Same.
(verify_gimple_call): Same.
(verify_gimple_assign_unary): Same.
(verify_gimple_assign_binary): Same.
(verify_gimple_assign_ternary): Same.
(verify_gimple_assign_single): Same.
(verify_gimple_switch): Same.
(verify_gimple_label): Same.
(verify_gimple_phi): Same.
(verify_gimple_in_seq): Same.
(verify_eh_throw_stmt_node): Same.
(collect_subblocks): Same.
(gimple_verify_flow_info): Same.
(do_warn_unused_result): Same.
* tree-inline.c (expand_call_inline): Same.
* tree-into-ssa.c (update_ssa): Same.
* tree.c (tree_int_cst_elt_check_failed): Same.
(tree_vec_elt_check_failed): Same.
(omp_clause_operand_check_failed): Same.
(verify_type_variant): Same.
(verify_type): Same.
* value-prof.c (verify_histograms): Same.
* varasm.c (assemble_start_function): Same.
gcc/lto/ChangeLog:
* lto-dump.c (lto_main): Same.
* lto.c (stream_out): Same.
gcc/objc/ChangeLog:
* objc-act.c (objc_begin_catch_clause): Quote keywords and options
in diagnostics.
(objc_build_throw_stmt): Same.
(objc_finish_message_expr): Same.
(get_super_receiver): Same.
* objc-next-runtime-abi-01.c (objc_next_runtime_abi_01_init): Spell
out "less than" in English./
* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Spell
out "greater" in English.
gcc/testsuite/ChangeLog:
* c-c++-common/Wbool-operation-1.c: Adjust text of expected diagnostics.
* c-c++-common/Wvarargs-2.c: Same.
* c-c++-common/Wvarargs.c: Same.
* c-c++-common/pr51768.c: Same.
* c-c++-common/tm/inline-asm.c: Same.
* c-c++-common/tm/safe-1.c: Same.
* g++.dg/asm-qual-1.C: Same.
* g++.dg/asm-qual-3.C: Same.
* g++.dg/conversion/dynamic1.C: Same.
* g++.dg/cpp0x/constexpr-89599.C: Same.
* g++.dg/cpp0x/constexpr-cast.C: Same.
* g++.dg/cpp0x/constexpr-shift1.C: Same.
* g++.dg/cpp0x/lambda/lambda-conv11.C: Same.
* g++.dg/cpp0x/nullptr04.C: Same.
* g++.dg/cpp0x/static_assert12.C: Same.
* g++.dg/cpp0x/static_assert8.C: Same.
* g++.dg/cpp1y/lambda-conv1.C: Same.
* g++.dg/cpp1y/pr79393-3.C: Same.
* g++.dg/cpp1y/static_assert1.C: Same.
* g++.dg/cpp1z/constexpr-if4.C: Same.
* g++.dg/cpp1z/constexpr-if5.C: Same.
* g++.dg/cpp1z/constexpr-if9.C: Same.
* g++.dg/eh/goto2.C: Same.
* g++.dg/eh/goto3.C: Same.
* g++.dg/expr/static_cast8.C: Same.
* g++.dg/ext/flexary5.C: Same.
* g++.dg/ext/utf-array-short-wchar.C: Same.
* g++.dg/ext/utf-array.C: Same.
* g++.dg/ext/utf8-2.C: Same.
* g++.dg/gomp/loop-4.C: Same.
* g++.dg/gomp/macro-4.C: Same.
* g++.dg/gomp/udr-1.C: Same.
* g++.dg/init/initializer-string-too-long.C: Same.
* g++.dg/other/offsetof9.C: Same.
* g++.dg/ubsan/pr63956.C: Same.
* g++.dg/warn/Wbool-operation-1.C: Same.
* g++.dg/warn/Wtype-limits-Wextra.C: Same.
* g++.dg/warn/Wtype-limits.C: Same.
* g++.dg/wrappers/pr88680.C: Same.
* g++.old-deja/g++.mike/eh55.C: Same.
* gcc.dg/Wsign-compare-1.c: Same.
* gcc.dg/Wtype-limits-Wextra.c: Same.
* gcc.dg/Wtype-limits.c: Same.
* gcc.dg/Wunknownprag.c: Same.
* gcc.dg/Wunsuffixed-float-constants-1.c: Same.
* gcc.dg/asm-6.c: Same.
* gcc.dg/asm-qual-1.c: Same.
* gcc.dg/cast-1.c: Same.
* gcc.dg/cast-2.c: Same.
* gcc.dg/cast-3.c: Same.
* gcc.dg/cpp/source_date_epoch-2.c: Same.
* gcc.dg/debug/pr85252.c: Same.
* gcc.dg/dfp/cast-bad.c: Same.
* gcc.dg/format/gcc_diag-1.c: Same.
* gcc.dg/format/gcc_diag-11.c: Same.New test.
* gcc.dg/gcc_diag-11.c: Same.New test.
* gcc.dg/gnu-cond-expr-2.c: Same.
* gcc.dg/gnu-cond-expr-3.c: Same.
* gcc.dg/gomp/macro-4.c: Same.
* gcc.dg/init-bad-1.c: Same.
* gcc.dg/init-bad-2.c: Same.
* gcc.dg/init-bad-3.c: Same.
* gcc.dg/pr27528.c: Same.
* gcc.dg/pr48552-1.c: Same.
* gcc.dg/pr48552-2.c: Same.
* gcc.dg/pr59846.c: Same.
* gcc.dg/pr61096-1.c: Same.
* gcc.dg/pr8788-1.c: Same.
* gcc.dg/pr90082.c: Same.
* gcc.dg/simd-2.c: Same.
* gcc.dg/spellcheck-params-2.c: Same.
* gcc.dg/spellcheck-params.c: Same.
* gcc.dg/strlenopt-49.c: Same.
* gcc.dg/tm/pr52141.c: Same.
* gcc.dg/torture/pr51106-1.c: Same.
* gcc.dg/torture/pr51106-2.c: Same.
* gcc.dg/utf-array-short-wchar.c: Same.
* gcc.dg/utf-array.c: Same.
* gcc.dg/utf8-2.c: Same.
* gcc.dg/warn-sprintf-no-nul.c: Same.
* gcc.target/i386/asm-flag-0.c: Same.
* gcc.target/i386/inline_error.c: Same.
* gcc.target/i386/pr30848.c: Same.
* gcc.target/i386/pr39082-1.c: Same.
* gcc.target/i386/pr39678.c: Same.
* gcc.target/i386/pr57756.c: Same.
* gcc.target/i386/pr68843-1.c: Same.
* gcc.target/i386/pr79804.c: Same.
* gcc.target/i386/pr82673.c: Same.
* obj-c++.dg/class-protocol-1.mm: Same.
* obj-c++.dg/exceptions-3.mm: Same.
* obj-c++.dg/exceptions-4.mm: Same.
* obj-c++.dg/exceptions-5.mm: Same.
* obj-c++.dg/exceptions-6.mm: Same.
* obj-c++.dg/method-12.mm: Same.
* obj-c++.dg/method-13.mm: Same.
* obj-c++.dg/method-6.mm: Same.
* obj-c++.dg/method-7.mm: Same.
* obj-c++.dg/method-9.mm: Same.
* obj-c++.dg/method-lookup-1.mm: Same.
* obj-c++.dg/proto-lossage-4.mm: Same.
* obj-c++.dg/protocol-qualifier-2.mm: Same.
* objc.dg/call-super-2.m: Same.
* objc.dg/class-protocol-1.m: Same.
* objc.dg/desig-init-1.m: Same.
* objc.dg/exceptions-3.m: Same.
* objc.dg/exceptions-4.m: Same.
* objc.dg/exceptions-5.m: Same.
* objc.dg/exceptions-6.m: Same.
* objc.dg/method-19.m: Same.
* objc.dg/method-2.m: Same.
* objc.dg/method-5.m: Same.
* objc.dg/method-6.m: Same.
* objc.dg/method-7.m: Same.
* objc.dg/method-lookup-1.m: Same.
* objc.dg/proto-hier-1.m: Same.
* objc.dg/proto-lossage-4.m: Same.
From-SVN: r271338
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 211 |
1 files changed, 122 insertions, 89 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index c6a70c8..4655d7f 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2961,12 +2961,12 @@ verify_address (tree t, bool verify_addressable) if (old_constant != new_constant) { - error ("constant not recomputed when ADDR_EXPR changed"); + error ("constant not recomputed when %<ADDR_EXPR%> changed"); return true; } if (old_side_effects != new_side_effects) { - error ("side effects not recomputed when ADDR_EXPR changed"); + error ("side effects not recomputed when %<ADDR_EXPR%> changed"); return true; } @@ -2981,13 +2981,13 @@ verify_address (tree t, bool verify_addressable) if (DECL_GIMPLE_REG_P (base)) { - error ("DECL_GIMPLE_REG_P set on a variable with address taken"); + error ("%<DECL_GIMPLE_REG_P%> set on a variable with address taken"); return true; } if (verify_addressable && !TREE_ADDRESSABLE (base)) { - error ("address taken, but ADDRESSABLE bit not set"); + error ("address taken but %<TREE_ADDRESSABLE%> bit not set"); return true; } @@ -3036,6 +3036,8 @@ verify_types_in_gimple_min_lval (tree expr) static bool verify_types_in_gimple_reference (tree expr, bool require_lvalue) { + const char *code_name = get_tree_code_name (TREE_CODE (expr)); + if (TREE_CODE (expr) == REALPART_EXPR || TREE_CODE (expr) == IMAGPART_EXPR || TREE_CODE (expr) == BIT_FIELD_REF) @@ -3043,7 +3045,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) tree op = TREE_OPERAND (expr, 0); if (!is_gimple_reg_type (TREE_TYPE (expr))) { - error ("non-scalar BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR"); + error ("non-scalar %qs", code_name); return true; } @@ -3057,14 +3059,14 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) || !types_compatible_p (bitsizetype, TREE_TYPE (t1)) || !types_compatible_p (bitsizetype, TREE_TYPE (t2))) { - error ("invalid position or size operand to BIT_FIELD_REF"); + error ("invalid position or size operand to %qs", code_name); return true; } if (INTEGRAL_TYPE_P (TREE_TYPE (expr)) && maybe_ne (TYPE_PRECISION (TREE_TYPE (expr)), size)) { error ("integral result type precision does not match " - "field size of BIT_FIELD_REF"); + "field size of %qs", code_name); return true; } else if (!INTEGRAL_TYPE_P (TREE_TYPE (expr)) @@ -3073,13 +3075,14 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) size)) { error ("mode size of non-integral result does not " - "match field size of BIT_FIELD_REF"); + "match field size of %qs", + code_name); return true; } if (INTEGRAL_TYPE_P (TREE_TYPE (op)) && !type_has_mode_precision_p (TREE_TYPE (op))) { - error ("BIT_FIELD_REF of non-mode-precision operand"); + error ("%qs of non-mode-precision operand", code_name); return true; } if (!AGGREGATE_TYPE_P (TREE_TYPE (op)) @@ -3087,7 +3090,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) tree_to_poly_uint64 (TYPE_SIZE (TREE_TYPE (op))))) { error ("position plus size exceeds size of referenced object in " - "BIT_FIELD_REF"); + "%qs", code_name); return true; } } @@ -3097,7 +3100,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) && !useless_type_conversion_p (TREE_TYPE (expr), TREE_TYPE (TREE_TYPE (op)))) { - error ("type mismatch in real/imagpart reference"); + error ("type mismatch in %qs reference", code_name); debug_generic_stmt (TREE_TYPE (expr)); debug_generic_stmt (TREE_TYPE (TREE_TYPE (op))); return true; @@ -3107,11 +3110,13 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) while (handled_component_p (expr)) { + code_name = get_tree_code_name (TREE_CODE (expr)); + if (TREE_CODE (expr) == REALPART_EXPR || TREE_CODE (expr) == IMAGPART_EXPR || TREE_CODE (expr) == BIT_FIELD_REF) { - error ("non-top-level BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR"); + error ("non-top-level %qs", code_name); return true; } @@ -3126,7 +3131,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) || (TREE_OPERAND (expr, 3) && !is_gimple_val (TREE_OPERAND (expr, 3)))) { - error ("invalid operands to array reference"); + error ("invalid operands to %qs", code_name); debug_generic_stmt (expr); return true; } @@ -3137,7 +3142,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) && !useless_type_conversion_p (TREE_TYPE (expr), TREE_TYPE (TREE_TYPE (op)))) { - error ("type mismatch in array reference"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (TREE_TYPE (expr)); debug_generic_stmt (TREE_TYPE (TREE_TYPE (op))); return true; @@ -3146,7 +3151,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) && !useless_type_conversion_p (TREE_TYPE (TREE_TYPE (expr)), TREE_TYPE (TREE_TYPE (op)))) { - error ("type mismatch in array range reference"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (TREE_TYPE (TREE_TYPE (expr))); debug_generic_stmt (TREE_TYPE (TREE_TYPE (op))); return true; @@ -3157,13 +3162,13 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) if (TREE_OPERAND (expr, 2) && !is_gimple_val (TREE_OPERAND (expr, 2))) { - error ("invalid COMPONENT_REF offset operator"); + error ("invalid %qs offset operator", code_name); return true; } if (!useless_type_conversion_p (TREE_TYPE (expr), TREE_TYPE (TREE_OPERAND (expr, 1)))) { - error ("type mismatch in component reference"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (TREE_TYPE (expr)); debug_generic_stmt (TREE_TYPE (TREE_OPERAND (expr, 1))); return true; @@ -3181,14 +3186,16 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) && (TREE_CODE (op) == SSA_NAME || is_gimple_min_invariant (op))) { - error ("conversion of an SSA_NAME on the left hand side"); + error ("conversion of %qs on the left hand side of %qs", + get_tree_code_name (TREE_CODE (op)), code_name); debug_generic_stmt (expr); return true; } else if (TREE_CODE (op) == SSA_NAME && TYPE_SIZE (TREE_TYPE (expr)) != TYPE_SIZE (TREE_TYPE (op))) { - error ("conversion of register to a different size"); + error ("conversion of register to a different size in %qs", + code_name); debug_generic_stmt (expr); return true; } @@ -3199,20 +3206,22 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) expr = op; } + code_name = get_tree_code_name (TREE_CODE (expr)); + if (TREE_CODE (expr) == MEM_REF) { if (!is_gimple_mem_ref_addr (TREE_OPERAND (expr, 0)) || (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR && verify_address (TREE_OPERAND (expr, 0), false))) { - error ("invalid address operand in MEM_REF"); + error ("invalid address operand in %qs", code_name); debug_generic_stmt (expr); return true; } if (!poly_int_tree_p (TREE_OPERAND (expr, 1)) || !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1)))) { - error ("invalid offset operand in MEM_REF"); + error ("invalid offset operand in %qs", code_name); debug_generic_stmt (expr); return true; } @@ -3224,21 +3233,21 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) || (TREE_CODE (TMR_BASE (expr)) == ADDR_EXPR && verify_address (TMR_BASE (expr), false))) { - error ("invalid address operand in TARGET_MEM_REF"); + error ("invalid address operand in %qs", code_name); return true; } if (!TMR_OFFSET (expr) || !poly_int_tree_p (TMR_OFFSET (expr)) || !POINTER_TYPE_P (TREE_TYPE (TMR_OFFSET (expr)))) { - error ("invalid offset operand in TARGET_MEM_REF"); + error ("invalid offset operand in %qs", code_name); debug_generic_stmt (expr); return true; } } else if (TREE_CODE (expr) == INDIRECT_REF) { - error ("INDIRECT_REF in gimple IL"); + error ("%qs in gimple IL", code_name); debug_generic_stmt (expr); return true; } @@ -3345,7 +3354,7 @@ verify_gimple_call (gcall *stmt) && gimple_call_noreturn_p (stmt) && should_remove_lhs_p (lhs)) { - error ("LHS in noreturn call"); + error ("LHS in %<noreturn%> call"); return true; } @@ -3536,6 +3545,8 @@ verify_gimple_assign_unary (gassign *stmt) return true; } + const char* const code_name = get_tree_code_name (rhs_code); + /* First handle conversions. */ switch (rhs_code) { @@ -3663,7 +3674,7 @@ verify_gimple_assign_unary (gassign *stmt) || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (lhs_type), TYPE_VECTOR_SUBPARTS (rhs1_type))) { - error ("type mismatch in vector unpack expression"); + error ("type mismatch in %qs expression", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -3685,7 +3696,7 @@ verify_gimple_assign_unary (gassign *stmt) || TYPE_UNSIGNED (rhs1_type) || element_precision (lhs_type) != element_precision (rhs1_type)) { - error ("invalid types for ABSU_EXPR"); + error ("invalid types for %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -3696,7 +3707,7 @@ verify_gimple_assign_unary (gassign *stmt) if (TREE_CODE (lhs_type) != VECTOR_TYPE || !useless_type_conversion_p (TREE_TYPE (lhs_type), rhs1_type)) { - error ("vec_duplicate should be from a scalar to a like vector"); + error ("%qs should be from a scalar to a like vector", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -3746,6 +3757,8 @@ verify_gimple_assign_binary (gassign *stmt) return true; } + const char* const code_name = get_tree_code_name (rhs_code); + /* First handle operations that involve different types. */ switch (rhs_code) { @@ -3757,7 +3770,7 @@ verify_gimple_assign_binary (gassign *stmt) || !(INTEGRAL_TYPE_P (rhs2_type) || SCALAR_FLOAT_TYPE_P (rhs2_type))) { - error ("type mismatch in complex expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3786,7 +3799,7 @@ verify_gimple_assign_binary (gassign *stmt) && INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type)))) || !useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("type mismatch in shift expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3803,7 +3816,7 @@ verify_gimple_assign_binary (gassign *stmt) || TREE_CODE (rhs2) != INTEGER_CST || (2 * TYPE_PRECISION (rhs1_type) > TYPE_PRECISION (lhs_type))) { - error ("type mismatch in widening vector shift expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3824,7 +3837,7 @@ verify_gimple_assign_binary (gassign *stmt) || (2 * TYPE_PRECISION (TREE_TYPE (rhs1_type)) > TYPE_PRECISION (TREE_TYPE (lhs_type)))) { - error ("type mismatch in widening vector shift expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3845,7 +3858,7 @@ verify_gimple_assign_binary (gassign *stmt) if (TREE_CODE (rhs1_type) != VECTOR_TYPE || TREE_CODE (rhs2_type) != VECTOR_TYPE) { - error ("invalid non-vector operands to vector valued plus"); + error ("invalid non-vector operands to %qs", code_name); return true; } lhs_etype = TREE_TYPE (lhs_type); @@ -3856,7 +3869,7 @@ verify_gimple_assign_binary (gassign *stmt) || POINTER_TYPE_P (rhs1_etype) || POINTER_TYPE_P (rhs2_etype)) { - error ("invalid (pointer) operands to plus/minus"); + error ("invalid (pointer) operands %qs", code_name); return true; } @@ -3870,7 +3883,7 @@ verify_gimple_assign_binary (gassign *stmt) || !useless_type_conversion_p (lhs_type, rhs1_type) || !ptrofftype_p (rhs2_type)) { - error ("type mismatch in pointer plus expression"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (lhs_type); debug_generic_stmt (rhs1_type); debug_generic_stmt (rhs2_type); @@ -3891,7 +3904,7 @@ verify_gimple_assign_binary (gassign *stmt) || TYPE_UNSIGNED (lhs_type) || TYPE_PRECISION (lhs_type) != TYPE_PRECISION (rhs1_type)) { - error ("type mismatch in pointer diff expression"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (lhs_type); debug_generic_stmt (rhs1_type); debug_generic_stmt (rhs2_type); @@ -3945,7 +3958,7 @@ verify_gimple_assign_binary (gassign *stmt) || maybe_lt (GET_MODE_SIZE (element_mode (rhs2_type)), 2 * GET_MODE_SIZE (element_mode (rhs1_type)))) { - error ("type mismatch in widening sum reduction"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3965,7 +3978,7 @@ verify_gimple_assign_binary (gassign *stmt) || maybe_ne (GET_MODE_SIZE (element_mode (lhs_type)), 2 * GET_MODE_SIZE (element_mode (rhs1_type)))) { - error ("type mismatch in vector widening multiplication"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4001,7 +4014,7 @@ verify_gimple_assign_binary (gassign *stmt) || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (rhs1_type), TYPE_VECTOR_SUBPARTS (lhs_type))) { - error ("type mismatch in vector pack expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4022,7 +4035,7 @@ verify_gimple_assign_binary (gassign *stmt) || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (rhs1_type), TYPE_VECTOR_SUBPARTS (lhs_type))) { - error ("type mismatch in vector pack expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4054,7 +4067,7 @@ verify_gimple_assign_binary (gassign *stmt) case VEC_SERIES_EXPR: if (!useless_type_conversion_p (rhs1_type, rhs2_type)) { - error ("type mismatch in series expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); return true; @@ -4062,7 +4075,7 @@ verify_gimple_assign_binary (gassign *stmt) if (TREE_CODE (lhs_type) != VECTOR_TYPE || !useless_type_conversion_p (TREE_TYPE (lhs_type), rhs1_type)) { - error ("vector type expected in series expression"); + error ("vector type expected in %qs", code_name); debug_generic_expr (lhs_type); return true; } @@ -4116,6 +4129,8 @@ verify_gimple_assign_ternary (gassign *stmt) return true; } + const char* const code_name = get_tree_code_name (rhs_code); + /* First handle operations that involve different types. */ switch (rhs_code) { @@ -4128,7 +4143,7 @@ verify_gimple_assign_ternary (gassign *stmt) || 2 * TYPE_PRECISION (rhs1_type) > TYPE_PRECISION (lhs_type) || TYPE_PRECISION (rhs1_type) != TYPE_PRECISION (rhs2_type)) { - error ("type mismatch in widening multiply-accumulate expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4142,9 +4157,9 @@ verify_gimple_assign_ternary (gassign *stmt) || maybe_ne (TYPE_VECTOR_SUBPARTS (rhs1_type), TYPE_VECTOR_SUBPARTS (lhs_type))) { - error ("the first argument of a VEC_COND_EXPR must be of a " + error ("the first argument of a %qs must be of a " "boolean vector type of the same number of elements " - "as the result"); + "as the result", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -4160,7 +4175,7 @@ verify_gimple_assign_ternary (gassign *stmt) if (!useless_type_conversion_p (lhs_type, rhs2_type) || !useless_type_conversion_p (lhs_type, rhs3_type)) { - error ("type mismatch in conditional expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs2_type); debug_generic_expr (rhs3_type); @@ -4172,7 +4187,7 @@ verify_gimple_assign_ternary (gassign *stmt) if (!useless_type_conversion_p (lhs_type, rhs1_type) || !useless_type_conversion_p (lhs_type, rhs2_type)) { - error ("type mismatch in vector permute expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4184,7 +4199,7 @@ verify_gimple_assign_ternary (gassign *stmt) || TREE_CODE (rhs2_type) != VECTOR_TYPE || TREE_CODE (rhs3_type) != VECTOR_TYPE) { - error ("vector types expected in vector permute expression"); + error ("vector types expected in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4199,8 +4214,8 @@ verify_gimple_assign_ternary (gassign *stmt) || maybe_ne (TYPE_VECTOR_SUBPARTS (rhs3_type), TYPE_VECTOR_SUBPARTS (lhs_type))) { - error ("vectors with different element number found " - "in vector permute expression"); + error ("vectors with different element number found in %qs", + code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4215,7 +4230,7 @@ verify_gimple_assign_ternary (gassign *stmt) != GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (rhs1_type)))))) { - error ("invalid mask type in vector permute expression"); + error ("invalid mask type in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4231,7 +4246,7 @@ verify_gimple_assign_ternary (gassign *stmt) || 2 * GET_MODE_UNIT_BITSIZE (TYPE_MODE (TREE_TYPE (rhs1_type))) > GET_MODE_UNIT_BITSIZE (TYPE_MODE (TREE_TYPE (lhs_type)))) { - error ("type mismatch in sad expression"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4243,7 +4258,7 @@ verify_gimple_assign_ternary (gassign *stmt) || TREE_CODE (rhs2_type) != VECTOR_TYPE || TREE_CODE (rhs3_type) != VECTOR_TYPE) { - error ("vector types expected in sad expression"); + error ("vector types expected in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4256,7 +4271,7 @@ verify_gimple_assign_ternary (gassign *stmt) case BIT_INSERT_EXPR: if (! useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("type mismatch in BIT_INSERT_EXPR"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -4275,7 +4290,7 @@ verify_gimple_assign_ternary (gassign *stmt) TYPE_VECTOR_SUBPARTS (rhs2_type)) && multiple_of_p (bitsizetype, rhs3, TYPE_SIZE (rhs2_type))))) { - error ("not allowed type combination in BIT_INSERT_EXPR"); + error ("not allowed type combination in %qs", code_name); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); return true; @@ -4284,13 +4299,13 @@ verify_gimple_assign_ternary (gassign *stmt) || ! types_compatible_p (bitsizetype, TREE_TYPE (rhs3)) || ! tree_fits_uhwi_p (TYPE_SIZE (rhs2_type))) { - error ("invalid position or size in BIT_INSERT_EXPR"); + error ("invalid position or size in %qs", code_name); return true; } if (INTEGRAL_TYPE_P (rhs1_type) && !type_has_mode_precision_p (rhs1_type)) { - error ("BIT_INSERT_EXPR into non-mode-precision operand"); + error ("%qs into non-mode-precision operand", code_name); return true; } if (INTEGRAL_TYPE_P (rhs1_type)) @@ -4300,7 +4315,7 @@ verify_gimple_assign_ternary (gassign *stmt) || (bitpos + TYPE_PRECISION (rhs2_type) > TYPE_PRECISION (rhs1_type))) { - error ("insertion out of range in BIT_INSERT_EXPR"); + error ("insertion out of range in %qs", code_name); return true; } } @@ -4310,7 +4325,7 @@ verify_gimple_assign_ternary (gassign *stmt) unsigned HOST_WIDE_INT bitsize = tree_to_uhwi (TYPE_SIZE (rhs2_type)); if (bitpos % bitsize != 0) { - error ("vector insertion not at element boundary"); + error ("%qs not at element boundary", code_name); return true; } } @@ -4329,7 +4344,7 @@ verify_gimple_assign_ternary (gassign *stmt) || maybe_lt (GET_MODE_SIZE (element_mode (rhs3_type)), 2 * GET_MODE_SIZE (element_mode (rhs1_type)))) { - error ("type mismatch in dot product reduction"); + error ("type mismatch in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -4361,9 +4376,11 @@ verify_gimple_assign_single (gassign *stmt) tree rhs1_type = TREE_TYPE (rhs1); bool res = false; + const char* const code_name = get_tree_code_name (rhs_code); + if (!useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("non-trivial conversion at assignment"); + error ("non-trivial conversion in %qs", code_name); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -4372,7 +4389,8 @@ verify_gimple_assign_single (gassign *stmt) if (gimple_clobber_p (stmt) && !(DECL_P (lhs) || TREE_CODE (lhs) == MEM_REF)) { - error ("non-decl/MEM_REF LHS in clobber statement"); + error ("%qs LHS in clobber statement", + get_tree_code_name (TREE_CODE (lhs))); debug_generic_expr (lhs); return true; } @@ -4390,7 +4408,7 @@ verify_gimple_assign_single (gassign *stmt) tree op = TREE_OPERAND (rhs1, 0); if (!is_gimple_addressable (op)) { - error ("invalid operand in unary expression"); + error ("invalid operand in %qs", code_name); return true; } @@ -4404,7 +4422,7 @@ verify_gimple_assign_single (gassign *stmt) && !one_pointer_to_useless_type_conversion_p (TREE_TYPE (rhs1), TREE_TYPE (op))) { - error ("type mismatch in address expression"); + error ("type mismatch in %qs", code_name); debug_generic_stmt (TREE_TYPE (rhs1)); debug_generic_stmt (TREE_TYPE (op)); return true; @@ -4416,7 +4434,7 @@ verify_gimple_assign_single (gassign *stmt) /* tcc_reference */ case INDIRECT_REF: - error ("INDIRECT_REF in gimple IL"); + error ("%qs in gimple IL", code_name); return true; case COMPONENT_REF: @@ -4431,7 +4449,7 @@ verify_gimple_assign_single (gassign *stmt) if (!is_gimple_reg (lhs) && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("invalid rhs for gimple memory store"); + error ("invalid RHS for gimple memory store: %qs", code_name); debug_generic_stmt (lhs); debug_generic_stmt (rhs1); return true; @@ -4457,7 +4475,7 @@ verify_gimple_assign_single (gassign *stmt) && !is_gimple_reg (rhs1) && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("invalid rhs for gimple memory store"); + error ("invalid RHS for gimple memory store: %qs", code_name); debug_generic_stmt (lhs); debug_generic_stmt (rhs1); return true; @@ -4491,8 +4509,8 @@ verify_gimple_assign_single (gassign *stmt) if (!useless_type_conversion_p (TREE_TYPE (rhs1_type), TREE_TYPE (elt_t))) { - error ("incorrect type of vector CONSTRUCTOR" - " elements"); + error ("incorrect type of vector %qs elements", + code_name); debug_generic_stmt (rhs1); return true; } @@ -4500,8 +4518,8 @@ verify_gimple_assign_single (gassign *stmt) * TYPE_VECTOR_SUBPARTS (elt_t), TYPE_VECTOR_SUBPARTS (rhs1_type))) { - error ("incorrect number of vector CONSTRUCTOR" - " elements"); + error ("incorrect number of vector %qs elements", + code_name); debug_generic_stmt (rhs1); return true; } @@ -4509,14 +4527,16 @@ verify_gimple_assign_single (gassign *stmt) else if (!useless_type_conversion_p (TREE_TYPE (rhs1_type), elt_t)) { - error ("incorrect type of vector CONSTRUCTOR elements"); + error ("incorrect type of vector %qs elements", + code_name); debug_generic_stmt (rhs1); return true; } else if (maybe_gt (CONSTRUCTOR_NELTS (rhs1), TYPE_VECTOR_SUBPARTS (rhs1_type))) { - error ("incorrect number of vector CONSTRUCTOR elements"); + error ("incorrect number of vector %qs elements", + code_name); debug_generic_stmt (rhs1); return true; } @@ -4532,13 +4552,15 @@ verify_gimple_assign_single (gassign *stmt) || TREE_CODE (elt_i) != INTEGER_CST || compare_tree_int (elt_i, i) != 0)) { - error ("vector CONSTRUCTOR with non-NULL element index"); + error ("vector %qs with non-NULL element index", + code_name); debug_generic_stmt (rhs1); return true; } if (!is_gimple_val (elt_v)) { - error ("vector CONSTRUCTOR element is not a GIMPLE value"); + error ("vector %qs element is not a GIMPLE value", + code_name); debug_generic_stmt (rhs1); return true; } @@ -4546,7 +4568,7 @@ verify_gimple_assign_single (gassign *stmt) } else if (CONSTRUCTOR_NELTS (rhs1) != 0) { - error ("non-vector CONSTRUCTOR with elements"); + error ("non-vector %qs with elements", code_name); debug_generic_stmt (rhs1); return true; } @@ -4557,7 +4579,7 @@ verify_gimple_assign_single (gassign *stmt) rhs1 = fold (ASSERT_EXPR_COND (rhs1)); if (rhs1 == boolean_false_node) { - error ("ASSERT_EXPR with an always-false condition"); + error ("%qs with an always-false condition", code_name); debug_generic_stmt (rhs1); return true; } @@ -4704,7 +4726,7 @@ verify_gimple_switch (gswitch *stmt) if (CASE_CHAIN (elt)) { - error ("invalid CASE_CHAIN"); + error ("invalid %<CASE_CHAIN%>"); debug_generic_expr (elt); return true; } @@ -4798,7 +4820,7 @@ verify_gimple_label (glabel *stmt) && (uid == -1 || (*label_to_block_map_for_fn (cfun))[uid] != gimple_bb (stmt))) { - error ("incorrect entry in label_to_block_map"); + error ("incorrect entry in %<label_to_block_map%>"); err |= true; } @@ -4915,7 +4937,7 @@ verify_gimple_phi (gphi *phi) if (!phi_result) { - error ("invalid PHI result"); + error ("invalid %<PHI%> result"); return true; } @@ -4924,7 +4946,7 @@ verify_gimple_phi (gphi *phi) || (virtual_p && SSA_NAME_VAR (phi_result) != gimple_vop (cfun))) { - error ("invalid PHI result"); + error ("invalid %<PHI%> result"); err = true; } @@ -4934,7 +4956,7 @@ verify_gimple_phi (gphi *phi) if (!t) { - error ("missing PHI def"); + error ("missing %<PHI%> def"); err |= true; continue; } @@ -4948,14 +4970,14 @@ verify_gimple_phi (gphi *phi) || (!virtual_p && !is_gimple_val (t))) { - error ("invalid PHI argument"); + error ("invalid %<PHI%> argument"); debug_generic_expr (t); err |= true; } #ifdef ENABLE_TYPES_CHECKING if (!useless_type_conversion_p (TREE_TYPE (phi_result), TREE_TYPE (t))) { - error ("incompatible types in PHI argument %u", i); + error ("incompatible types in %<PHI%> argument %u", i); debug_generic_stmt (TREE_TYPE (phi_result)); debug_generic_stmt (TREE_TYPE (t)); err |= true; @@ -5053,7 +5075,7 @@ verify_gimple_in_seq (gimple_seq stmts) { timevar_push (TV_TREE_STMT_VERIFY); if (verify_gimple_in_seq_2 (stmts)) - internal_error ("verify_gimple failed"); + internal_error ("%<verify_gimple%> failed"); timevar_pop (TV_TREE_STMT_VERIFY); } @@ -5110,7 +5132,7 @@ verify_eh_throw_stmt_node (gimple *const &stmt, const int &, { if (!visited->contains (stmt)) { - error ("dead STMT in EH table"); + error ("dead statement in EH table"); debug_gimple_stmt (stmt); eh_error_found = true; } @@ -5234,6 +5256,14 @@ collect_subblocks (hash_set<tree> *blocks, tree block) } } +/* Disable warnings about missing quoting in GCC diagnostics for + the verification errors. Their format strings don't follow + GCC diagnostic conventions and trigger an ICE in the end. */ +#if __GNUC__ >= 10 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-diag" +#endif + /* Verify the GIMPLE statements in the CFG of FN. */ DEBUG_FUNCTION void @@ -5711,6 +5741,9 @@ gimple_verify_flow_info (void) return err; } +#if __GNUC__ >= 10 +# pragma GCC diagnostic pop +#endif /* Updates phi nodes after creating a forwarder block joined by edge FALLTHRU. */ @@ -9413,13 +9446,13 @@ do_warn_unused_result (gimple_seq seq) if (fdecl) warning_at (loc, OPT_Wunused_result, - "ignoring return value of %qD, " - "declared with attribute warn_unused_result", + "ignoring return value of %qD " + "declared with attribute %<warn_unused_result%>", fdecl); else warning_at (loc, OPT_Wunused_result, "ignoring return value of function " - "declared with attribute warn_unused_result"); + "declared with attribute %<warn_unused_result%>"); } break; |