- 21 Aug, 2018 3 commits
-
-
* wide-int-range.cc (wide_int_range_abs): New. (wide_int_range_order_set): Rename from wide_int_range_min_max. * wide-int-range.h (wide_int_range_abs): New. (wide_int_range_min_max): New. * tree-vrp.c (extract_range_from_unary_expr): Rewrite ABS_EXPR case to call wide_int_range_abs. Rewrite MIN/MAX_EXPR to call wide_int_range_min_max. (extract_range_from_abs_expr): Delete. From-SVN: r263685
Aldy Hernandez committed -
From-SVN: r263683
GCC Administrator committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01170.html * pex-unix.c (pex_child_error): Delete. (pex_unix_exec_child): Commonize error paths to single message & exit. From-SVN: r263679
Nathan Sidwell committed
-
- 20 Aug, 2018 18 commits
-
-
[gcc] 2018-08-20 Michael Meissner <meissner@linux.ibm.com> PR target/87033 * config/rs6000/rs6000.md (extendsi<mode>2): Change constraints from 'Y' to 'YZ' to enable the LWAX instruction to be generated for indexed loads. [gcc/testsuite] 2018-08-20 Michael Meissner <meissner@linux.ibm.com> PR target/87033 * gcc.target/powerpc/pr87033.c: New test. From-SVN: r263678
Michael Meissner committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01214.html * config/s390/s390-c (s390_macro_to_expand): Use cpp_macro_p. * config/spu/spu-c.c (spu_macro_to_expand): Likewise. Co-Authored-By: Jeff Law <law@redhat.com> From-SVN: r263677
Nathan Sidwell committed -
gcc/testsuite/ChangeLog: * gcc.dg/builtin-sprintf-warn-20.c: New test. From-SVN: r263676
Martin Sebor committed -
We often emit logically-related groups of diagnostics. A relatively simple case is this: if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); where the "note" diagnostic issued by the "inform" call is guarded by the -Wmultistatement_macros warning. More complicated examples can be seen in the C++ frontend, where e.g. print_z_candidates can lead to numerous "note" diagnostics being emitted. I'm looking at various ways to improve how we handle such related diagnostics, but, prior to this patch, there was no explicit relationship between these diagnostics: the diagnostics subsystem had no way of "knowing" that these were related. This patch introduces a simple way to group the diagnostics: an auto_diagnostic_group class: all diagnostics emitted within the lifetime of an auto_diagnostic_group instance are logically grouped. Hence in the above example, the two diagnostics can be grouped by simply adding an auto_diagnostic_group instance: auto_diagnostic_group d; if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); Some more awkard cases are of the form: if (some_condition && warning_at (...) && more_conditions) inform (...); which thus need restructuring to: if (some_condition) { auto_diagnostic_group d; warning_at (...); if (more_conditions) inform (...); } so that the lifetime of the auto_diagnostic_group groups the warning_at and the inform call. Nesting is handled by simply tracking a nesting depth within the diagnostic_context.: all diagnostics are treated as grouped until the final auto_diagnostic_group is popped. diagnostic.c uses this internally, so that all diagnostics are part of a group - those that are "by themselves" are treated as being part of a group with one element. The diagnostic_context gains optional callbacks for displaying the start of a group (when the first diagnostic is emitted within it), and the end of a group (for when the group was non-empty); these callbacks are unused by default, but a test plugin demonstrates them (and verifies that the machinery is working). As noted above, I'm looking at various ways to use the grouping to improve how we output the diagnostics. FWIW, I experimented with a more involved implementation, of the form: diagnostic_group d; if (d.warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) d.inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); which had the advantage of allowing auto-detection of the places where groups were needed (by converting ::warning_at's return type to bool), but it was a much more invasive patch, especially when dealing with the places in the C++ frontend that can emit numerous notes after an error or warning (and thus having to pass the group around) Hence I went with this simpler approach. gcc/c-family/ChangeLog: PR other/84889 * c-attribs.c (common_handle_aligned_attribute): Add auto_diagnostic_group instance. * c-indentation.c (warn_for_misleading_indentation): Likewise. * c-opts.c (c_common_post_options): Likewise. * c-warn.c (warn_logical_not_parentheses): Likewise. (warn_duplicated_cond_add_or_warn): Likewise. (warn_for_multistatement_macros): Likewise. gcc/c/ChangeLog: PR other/84889 * c-decl.c (pushtag): Add auto_diagnostic_group instance. (diagnose_mismatched_decls): Likewise, in various places. (warn_if_shadowing): Likewise. (implicit_decl_warning): Likewise. (implicitly_declare): Likewise. (undeclared_variable): Likewise. (declare_label): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. * c-parser.c (c_parser_declaration_or_fndef): Likewise. (c_parser_parameter_declaration): Likewise. (c_parser_binary_expression): Likewise. * c-typeck.c (c_expr_sizeof_expr): Likewise. (parser_build_binary_op): Likewise. (build_unary_op): Likewise. (error_init): Likewise. (pedwarn_init): Likewise. (warning_init): Likewise. (convert_for_assignment): Likewise. gcc/cp/ChangeLog: PR other/84889 * call.c (build_user_type_conversion_1): Add auto_diagnostic_group instance(s). (print_error_for_call_failure): Likewise. (build_op_call_1): Likewise. (build_conditional_expr_1): Likewise. (build_new_op_1): Likewise. (build_op_delete_call): Likewise. (convert_like_real): Likewise. (build_over_call): Likewise. (build_new_method_call_1): Likewise. (joust): Likewise. * class.c (check_tag): Likewise. (finish_struct_anon_r): Likewise. (one_inherited_ctor): Likewise. (finalize_literal_type_property): Likewise. (explain_non_literal_class): Likewise. (find_flexarrays): Likewise. (resolve_address_of_overloaded_function): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. (is_valid_constexpr_fn): Likewise. (cx_check_missing_mem_inits): Likewise. * cp-gimplify.c (cp_genericize_r): Likewise. * cvt.c (maybe_warn_nodiscard): Likewise. * decl.c (warn_extern_redeclared_static): Likewise. (check_redeclaration_exception_specification): Likewise. (check_no_redeclaration_friend_default_args): Likewise. (duplicate_decls): Likewise. (redeclaration_error_message): Likewise. (warn_misplaced_attr_for_class_type): Likewise. * decl2.c (finish_static_data_member_decl): Likewise. (no_linkage_error): Likewise. (cp_warn_deprecated_use): Likewise. * error.c (qualified_name_lookup_error): Likewise. * friend.c (make_friend_class): Likewise. (do_friend): Likewise. * init.c (perform_member_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_delete): Likewise. * lex.c (unqualified_name_lookup_error): Likewise. * name-lookup.c (check_extern_c_conflict): Likewise. (inform_shadowed): New function. (check_local_shadow): Add auto_diagnostic_group instances, replacing goto "inform_shadowed" label with call to subroutine. (set_local_extern_decl_linkage): Add auto_diagnostic_group instance(s). * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. (cp_parser_namespace_name): Likewise. * pt.c (check_specialization_namespace): Likewise. (check_template_variable): Likewise. (warn_spec_missing_attributes): Likewise. (check_explicit_specialization): Likewise. (process_partial_specialization): Likewise. (lookup_template_class_1): Likewise. (finish_template_variable): Likewise. (do_auto_deduction): Likewise. * search.c (check_final_overrider): Likewise. (look_for_overrides_r): Likewise. * tree.c (maybe_warn_parm_abi): Likewise. * typeck.c (cxx_sizeof_expr): Likewise. (cp_build_function_call_vec): Likewise. (cp_build_binary_op): Likewise. (convert_for_assignment): Likewise. (maybe_warn_about_returning_address_of_local): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. (check_narrowing): Likewise. gcc/ChangeLog: PR other/84889 * attribs.c (diag_attr_exclusions): Add auto_diagnostic_group instance. (decl_attributes): Likewise. * calls.c (maybe_warn_nonstring_arg): Add auto_diagnostic_group instance. * cgraphunit.c (maybe_diag_incompatible_alias): Likewise. * diagnostic-core.h (class auto_diagnostic_group): New class. * diagnostic.c (diagnostic_initialize): Initialize the new fields. (diagnostic_report_diagnostic): Handle the first diagnostics within a group. (emit_diagnostic): Add auto_diagnostic_group instance. (inform): Likewise. (inform_n): Likewise. (warning): Likewise. (warning_at): Likewise. (warning_n): Likewise. (pedwarn): Likewise. (permerror): Likewise. (error): Likewise. (error_n): Likewise. (error_at): Likewise. (sorry): Likewise. (fatal_error): Likewise. (internal_error): Likewise. (internal_error_no_backtrace): Likewise. (auto_diagnostic_group::auto_diagnostic_group): New ctor. (auto_diagnostic_group::~auto_diagnostic_group): New dtor. * diagnostic.h (struct diagnostic_context): Add fields "diagnostic_group_nesting_depth", "diagnostic_group_emission_count", "begin_group_cb", "end_group_cb". * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior): Add auto_diagnostic_group instance(s). (find_explicit_erroneous_behavior): Likewise. * gimple-ssa-warn-alloca.c (pass_walloca::execute): Likewise. * gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Likewise. * gimplify.c (warn_implicit_fallthrough_r): Likewise. (gimplify_va_arg_expr): Likewise. * hsa-gen.c (HSA_SORRY_ATV): Likewise. (HSA_SORRY_AT): Likewise. * ipa-devirt.c (compare_virtual_tables): Likewise. (warn_odr): Likewise. * multiple_target.c (expand_target_clones): Likewise. * opts-common.c (cmdline_handle_error): Likewise. * reginfo.c (globalize_reg): Likewise. * substring-locations.c (format_warning_n_va): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise. * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): Likewise. * tree-ssa-uninit.c (warn_uninit): Likewise. * tree.c (warn_deprecated_use): Likewise. gcc/testsuite/ChangeLog: PR other/84889 * gcc.dg/plugin/diagnostic-group-test-1.c: New test. * gcc.dg/plugin/diagnostic_group_plugin.c: New test. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests. From-SVN: r263675
David Malcolm committed -
On x86, return address is always popped in word_mode. eh_return needs to put EH return address in word_mode on stack. gcc/ PR target/87014 * config/i386/i386.md (eh_return): Always update EH return address in word_mode. gcc/testsuite/ PR target/87014 * g++.dg/torture/pr87014.C: New file. From-SVN: r263672
H.J. Lu committed -
targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when TARGET_SPLIT_COMPLEX_ARG is defined. * targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when TARGET_SPLIT_COMPLEX_ARG is defined. From-SVN: r263671
Chung-Lin Tang committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01171.html * include/cpplib.h: Fixup some whitespace. (cpp_hashnode): Reduce type to 2 bit & flags to 8. From-SVN: r263669
Nathan Sidwell committed -
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
Nathan Sidwell committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01162.html * directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p. * include/cpplib.h (enum cpp_macro_kind): Remove trailing comma. (cpp_fun_like_macro_p): Make inline, define. * macro.c (cpp_define_lazily): Use UCHAR_MAX. (cpp_fun_like_macro_p): Delete. From-SVN: r263666
Nathan Sidwell committed -
2018-08-20 Bernd Edlinger <bernd.edlinger@hotmail.de> * expr.c (store_field): Change gcc_assert to gcc_checking_assert. From-SVN: r263665
Bernd Edlinger committed -
PR target/86984 * expr.c (expand_assignment): Assert that bitpos is positive. (store_field): Likewise (expand_expr_real_1): Make sure that bitpos is positive. * config/alpha/alpha.h (CONSTANT_ADDRESS_P): Avoid signed integer overflow. PR target/86984 * gcc.target/alpha/pr86984.c: New test. From-SVN: r263664
Bernd Edlinger committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01149.html libcpp/ * Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h. * include/cpp-id-data.h: Delete. * internal.h: Include cpplib.h not cpp-id-data.h. gcc/ * Makefile.in (CPP_ID_DATA_H): Delete. (CPP_INTERNAL_H): Don't add it. (GTFILES): Replace CPP_ID_DATA_H with CPPLIB_H. * gengtype.c (open_base_files): Replace cpp-id-data.h with cpplib.h From-SVN: r263663
Nathan Sidwell committed -
re PR c++/78655 (gcc doesn't exploit the fact that the result of pointer addition can not be nullptr) 2018-08-20 Richard Biener <rguenther@suse.de> PR tree-optimization/78655 * tree-vrp.c (extract_range_from_binary_expr_1): Make pointer + offset nonnull if either operand is nonnull work. * gcc.dg/tree-ssa/evrp11.c: New testcase. From-SVN: r263662
Richard Biener committed -
The _Tuple_impl base class can be used to disable copy/move assignment, without requiring an extra base class. Exception specifications on std::tuple assignment and swap functions can be defined directly using is_nothrow_swappable, instead of querying the base classes. PR libstdc++/86963 * include/std/tuple (_Tuple_impl::operator=): Define as deleted. (_Tuple_impl::_M_assign): New functions to perform assignment instead of assignment operators. (_Tuple_impl::_M_swap): Remove exception specification. (_Tuple_impl<_Idx, _Head>): Likewise. (_TC::_NonNestedTuple, _TC::_NotSameTuple): Use __remove_cvref_t. (__tuple_base): Remove. (tuple, tuple<_T1, _T2>): Remove inheritance from __tuple_base. (tuple::operator=, tuple<_T1, _T2>::operator=): Call _M_assign. (tuple::swap, tuple<_T1, _T2>::swap): Define exception specification using __is_nothrow_swappable. (tuple<_T1, _T2>::tuple(_U1&&, _U2&&)): Use __remove_cvref_t. From-SVN: r263661
Jonathan Wakely committed -
Atm, when running vla-1.c with -O0 -flto, we have: ... FAIL: gcc.dg/guality/vla-1.c -O0 -flto -fuse-linker-plugin \ -fno-fat-lto-objects line 17 sizeof (a) == 6 ... The vla a[i + 1] in f1 is gimplified into: ... f1 (int i) { char a[0:D.1922] [value-expr: *a.0]; char[0:D.1922] * a.0; D.1921 = i + 1; D.1926 = (sizetype) D.1921; a.0 = __builtin_alloca_with_align (D.1926, 8); ... The early debug info for the upper bound of the type of vla a that we stream out is: ... DIE 0: DW_TAG_subrange_type (0x7f85029a90f0) DW_AT_upper_bound: location descriptor: (0x7f85029a9230) DW_OP_GNU_variable_value die -> 0 (0x7f85029a94b0), 0 DIE 0: DW_TAG_variable (0x7f85029a94b0) DW_AT_name: "D.1922" DW_AT_type: die -> 0 (0x7f85029a3d70) DW_AT_artificial: 1 ... and in ltrans we have for that same upper bound: ... DIE 0: DW_TAG_subrange_type (0x7f5183b57d70) DW_AT_upper_bound: die -> 0 (0x7f5183b576e0) DIE 0: DW_TAG_variable (0x7f5183b576e0) DW_AT_name: "D.4278" DW_AT_abstract_origin: die -> label: vla_1.c.6719312a + 193 (0x7f5183b57730) ... where D.4278 has abstract origin D.1922. The D.4278 die has no DW_AT_location, so when evaluting "sizeof (a)" in the debugger, we can't find the information to get the value of D.4278, and the debugger prints "<optimized out>". This patch fixes that by either: - adding DW_AT_location to the referenced variable die, or - instead of using a ref for the upper bound, using an exprloc. When changing gcc.dg/guality/guality.exp to run the usual flto flavours "-fno-use-linker-plugin -flto-partition=none" and "-fuse-linker-plugin -fno-fat-lto-objects" in combination with O0, Og, O1, O2, O3 and Os, this patch fixes all (20) failures in vla-1.c, leaving only: ... No symbol "i" in current context. UNSUPPORTED: gcc.dg/guality/vla-1.c -O3 -flto -fno-use-linker-plugin \ -flto-partition=none line 17 i == 5 'a' has unknown type; cast it to its declared type UNSUPPORTED: gcc.dg/guality/vla-1.c -O3 -flto -fno-use-linker-plugin \ -flto-partition=none line 17 sizeof (a) == 6 ... Bootstrapped and reg-tested on x86_64. 2018-08-20 Tom de Vries <tdevries@suse.de> * dwarf2out.c (add_scalar_info): Don't add reference to existing die unless the referenced die describes the added property using DW_AT_location or DW_AT_const_value. Fall back to exprloc case. Otherwise, add a DW_AT_location to the referenced die. From-SVN: r263660
Tom de Vries committed -
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01140.html libcpp/ * include/cpp-id-data.h (struct answer): Delete. * include/cpplib.h (struct answer): Don't forward-declare. (enum cpp_macro_kind): Add cmk_assert. (struct cpp_macro): Union parms and next assert chain. (union _cpp_hashnode_value): 'answer' field is cpp_macro. * directives.c (parse_answer): Convert to use cpp_macro. Return true on success. (parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert) (cpp_do_unassert): Convert to use cpp_macro. * macro.c (warn_of_redefinition, _cpp_new_macro) (check_trad_stringification, cpp_macro_definition): Adjust macro parm access. * traditional.c (_cpp_replacement_text_len) (_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise. gcc/c-family/ * c-ada-spec.c (macro_length, dump_ada_macros): Adjust macro parm access. From-SVN: r263658
Nathan Sidwell committed -
* include/std/optional (_Optional_payload): Use variable templates for conditions in default template arguments and exception specifications. (optional): Likewise. Adjust indentation. (optional::__not_self, optional::__not_tag, optional::_Requires): New SFINAE helpers. (optional::optional): Use new helpers in constructor constraints. * include/std/type_traits (__or_v, __and_v): New variable templates. * testsuite/20_util/optional/cons/value_neg.cc: Change dg-error to dg-prune-output. Remove unused header. From-SVN: r263657
Jonathan Wakely committed -
From-SVN: r263656
GCC Administrator committed
-
- 19 Aug, 2018 2 commits
-
-
PR target/86994 * config/i386/i386.c (ix86_rtx_costs) [case SET]: Check source for register_operand when calling ix86_set_reg_reg_cost. [case CONST_INT, case CONST, case LABEL_REF, case SYMBOL_REF]: Set *total to 0 for operands that satisfy x86_64_immediate_operand predicate and to 1 otherwise. From-SVN: r263652
Uros Bizjak committed -
From-SVN: r263651
GCC Administrator committed
-
- 18 Aug, 2018 4 commits
-
-
2018-08-18 François Dumont <fdumont@gcc.gnu.org> * testsuite/25_algorithms/copy/86658.cc: Use dg-options to define _GLIBCXX_DEBUG. From-SVN: r263647
François Dumont committed -
gcc/testsuite 2018-08-18 Iain Sandoe <iain@sandoe.co.uk> * gcc.dg/debug/dwarf2/pr80263.c: Suppress pubtypes output for Darwin. From-SVN: r263646
Iain Sandoe committed -
2018-08-18 Iain Sandoe <iain@sandoe.co.uk> gcc/ * config/darwin.c (darwin_override_options): If -gsplit-dwarf is set, emit a diagnostic that it is not supported and reset the option. * config/darwin.h (DRIVER_SELF_SPECS): Note that gsplit-dwarf is not supported and consume the option. (ASM_FINAL_SPEC): New. gcc/testsuite * g++.dg/debug/dwarf2/pr85302.C: Skip unsupported split DWARF test on Darwin. * g++.dg/debug/dwarf2/pr85302.C: Likewise. * gcc.dg/lto/pr83719_0.c: Likewise. From-SVN: r263645
Iain Sandoe committed -
From-SVN: r263644
GCC Administrator committed
-
- 17 Aug, 2018 13 commits
-
-
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01072.html libcpp/ * include/cpplib.h (struct cpp_callbacks): Replace user_builtin_macro with user_lazy_macro. (struct cpp_macro): add lazy field. (enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER. (cpp_define_lazily): Declare. * macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use. (warn_of_redefinition): Use cpp_builtin_macro_p, directly call user_lazy_macro hook. (_cpp_new_macro): Clear lazy field. (cpp_define_lazily): Define. (_cpp_notify_macro_use): Adjust lazy definition code. (cpp_macro_definition): No need to do lazy definition here. * pch.c (write_macdef, save_macros): Likewise. gcc/c-family/ * c-cppbuiltin.c (struct lazy_hex_fp_value_struct): Remove macro field. (laxy_hex_fp_value_count): Make unsigned. (lazy_hex_fp_value): Provided with macro & lazy number. Directly manipulate the macro. (builtin_defin_with_hex_fp_value): Adjust callback name, use cpp_define_lazily. From-SVN: r263640
Nathan Sidwell committed -
PR testsuite/86996 gcc/testsuite/CHangeLog: * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust. From-SVN: r263636
Martin Sebor committed -
Consider: extern int callee (const char *one, char *two, const char *three); int test () { return callee ("first", "second", "third"); } for which -Wwrite-strings was emitting: Wwrite-strings.C: In function 'int test()': Wwrite-strings.C:10:44: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 10 | return callee ("first", "second", "third"); | ^ This patch fixes the warning so that it underlines the pertinent argument at the callsite: Wwrite-strings.C: In function 'int test()': Wwrite-strings.C:10:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 10 | return callee ("first", "second", "third"); | ^~~~~~~~ Ideally we ought to also issue a "note" highlighting the pertinent parameter within the decl, but that's not readily available, so I'm saving it for another patch. gcc/cp/ChangeLog: * typeck.c (string_conv_p): Extract location from EXP and use it in preference to input_location when issuing warnings. gcc/testsuite/ChangeLog: * g++.dg/conversion/Wwrite-strings.C: New test. From-SVN: r263635
David Malcolm committed -
makeinfo warns about this. * doc/md.texi (Patterns): Use @ref instead of @xref in the middle of a sentence. From-SVN: r263633
Segher Boessenkool committed -
MAINTAINERS: Add c-sky port maintainers. From-SVN: r263632
Sandra Loosemore committed -
2018-08-17 Jojo <jijie_rong@c-sky.com> Huibin Wang <huibin_wang@c-sky.com> Sandra Loosemore <sandra@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> C-SKY port: libgcc libgcc/ * config.host: Add C-SKY support. * config/csky/*: New. Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com> Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r263631
Jojo committed -
2018-08-17 Sandra Loosemore <sandra@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> Xianmiao Qu <xianmiao_qu@c-sky.com> C-SKY port: Testsuite gcc/testsuite/ * g++.dg/Wno-frame-address.C: Adjust for C-SKY. * g++.dg/torture/type-generic-1.C: Likewise. * gcc.c-torture/compile/20000804-1.c: Likewise. * gcc.c-torture/execute/20101011-1.c: Likewise. * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: Likewise. * gcc.dg/20020312-2.c: Likewise. * gcc.dg/Wno-frame-address.c: Likewise. * gcc.dg/c11-true_min-1.c: Likewise. * gcc.dg/sibcall-10.c: Likewise. * gcc.dg/sibcall-9.c: Likewise. * gcc.dg/stack-usage-1.c: Likewise. * gcc.dg/torture/float32-tg-3.c: Likewise. * gcc.dg/torture/float32x-tg-3.c: Likewise. * gcc.dg/torture/float64-tg-3.c: Likewise. * gcc.dg/torture/float64x-tg-3.c: Likewise. * gcc.dg/torture/type-generic-1.c: Likewise. * gcc.target/csky/*: New. * lib/target-supports.exp (check_profiling_available): Add csky-*-elf. (check_effective_target_hard_float): Handle C-SKY targets with single-precision hard float only. (check_effective_target_logical_op_short_circuit): Handle C-SKY. Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com> Co-Authored-By: Xianmiao Qu <xianmiao_qu@c-sky.com> From-SVN: r263630
Sandra Loosemore committed -
2018-08-17 Sandra Loosemore <sandra@codesourcery.com> C-SKY port: Documentation gcc/ * doc/extend.texi (C-SKY Function Attributes): New section. * doc/invoke.texi (Option Summary): Add C-SKY options. (C-SKY Options): New section. * doc/md.texi (Machine Constraints): Document C-SKY constraints. From-SVN: r263629
Sandra Loosemore committed -
2018-08-17 Jojo <jijie_rong@c-sky.com> Huibin Wang <huibin_wang@c-sky.com> Sandra Loosemore <sandra@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> C-SKY port: Backend implementation gcc/ * config/csky/*: New. * common/config/csky/*: New. Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com> Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r263628
Jojo committed -
2018-08-17 Jojo <jijie_rong@c-sky.com> Huibin Wang <huibin_wang@c-sky.com> Sandra Loosemore <sandra@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> Andrew Jenner <andrew@codesourcery.com> C-SKY port: Configury gcc/ * config.gcc (csky-*-*): New. * configure.ac: Add csky to targets for dwarf2 debug_line support. * configure: Regenerated. contrib/ * config-list.mk (LIST): Add csky-elf and csky-linux-gnu. Co-Authored-By: Andrew Jenner <andrew@codesourcery.com> Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com> Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r263627
Jojo committed -
This patch converts dump_print and dump_printf_loc from using printf (and thus ATTRIBUTE_PRINTF) to using a new pretty-printer based on pp_format, which supports formatting middle-end types. In particular, the following codes are implemented (in addition to the standard pretty_printer ones): %E: gimple *: Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0) %G: gimple *: Equivalent to: dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0) %T: tree: Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM). Hence it becomes possible to convert e.g.: if (dump_enabled_p ()) { dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: different sized vector " "types in statement, "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, vectype); dump_printf (MSG_MISSED_OPTIMIZATION, " and "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, nunits_vectype); dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } into a one-liner: if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: different sized vector " "types in statement, %T and %T\n", vectype, nunits_vectype); Unlike regular pretty-printers, this one captures optinfo_item instances for the formatted chunks as appropriate, so that when written out to a JSON optimization record, the relevant parts of the message are labelled by type, and by source location (so that e.g. %G is entirely equivalent to using dump_gimple_stmt). dump_printf and dump_printf_loc become marked with ATTRIBUTE_GCC_DUMP_PRINTF, which the patch also implements. gcc/c-family/ChangeLog: * c-format.c (enum format_type): Add gcc_dump_printf_format_type. (gcc_dump_printf_length_specs): New. (gcc_dump_printf_flag_pairs): New. (gcc_dump_printf_flag_specs): New. (gcc_dump_printf_char_table): New. (format_types_orig): Add entry for "gcc_dump_printf". (init_dynamic_diag_info): Set up length_char_specs and conversion_specs for gcc_dump_printf_format_type. (handle_format_attribute): Handle gcc_dump_printf_format_type. gcc/ChangeLog: * dump-context.h: Include "dumpfile.h". (dump_context::dump_printf_va): Convert final param from va_list to va_list *. Convert from ATTRIBUTE_PRINTF to ATTRIBUTE_GCC_DUMP_PRINTF. (dump_context::dump_printf_loc_va): Likewise. * dumpfile.c: Include "stringpool.h". (make_item_for_dump_printf_va): Delete. (make_item_for_dump_printf): Delete. (class dump_pretty_printer): New class. (dump_pretty_printer::dump_pretty_printer): New ctor. (dump_pretty_printer::emit_items): New member function. (dump_pretty_printer::emit_any_pending_textual_chunks): New member function. (dump_pretty_printer::emit_item): New member function. (dump_pretty_printer::stash_item): New member function. (dump_pretty_printer::format_decoder_cb): New member function. (dump_pretty_printer::decode_format): New member function. (dump_context::dump_printf_va): Reimplement in terms of dump_pretty_printer. (dump_context::dump_printf_loc_va): Convert final param from va_list to va_list *. (dump_context::begin_scope): Reimplement call to make_item_for_dump_printf. (dump_printf): Update for change to dump_printf_va. (dump_printf_loc): Likewise. (selftest::test_capture_of_dump_calls): Convert "stmt" from greturn * to gimple *. Add a test_decl. Add tests of dump_printf with %T, %E, and %G. * dumpfile.h (ATTRIBUTE_GCC_DUMP_PRINTF): New macro. (dump_printf): Replace ATTRIBUTE_PRINTF_2 with ATTRIBUTE_GCC_DUMP_PRINTF (2, 3). (dump_printf_loc): Replace ATTRIBUTE_PRINTF_3 with ATTRIBUTE_GCC_DUMP_PRINTF (3, 0). * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Convert use of HOST_WIDE_INT_PRINT_DEC on unsigned HOST_WIDE_INT "count" within a dump_printf_loc call to "%wu". (vector_alignment_reachable_p): Merge two dump_printf[_loc] calls, converting a use of HOST_WIDE_INT_PRINT_DEC to "%wd". Add a missing space after "=". * tree-vect-loop.c (vect_analyze_loop_2) Within a dump_printf call, convert use of HOST_WIDE_INT_PRINT_DEC to "%wd". * tree-vect-slp.c (vect_slp_bb): Within a dump_printf_loc call, convert use of HOST_WIDE_INT_PRINT_UNSIGNED to "%wu". * tree-vectorizer.c (try_vectorize_loop_1): Likewise. Remove duplicate "vectorized" from message. gcc/testsuite/ChangeLog: * gcc.dg/format/gcc_diag-1.c: Fix typo. Add test coverage for gcc_dump_printf. * gcc.dg/format/gcc_diag-10.c: Add gimple typedef. Add test coverage for gcc_dump_printf. From-SVN: r263626
David Malcolm committed -
PR libstdc++/86963 * include/std/tuple (__tuple_base): New class template with deleted copy assignment operator. (tuple, tuple<_T1, _T2>): Derive from __tuple_base<tuple> so that implicit copy/move assignment operator will be deleted/suppressed. (tuple::__assignable, tuple<_T1, _T2>::__assignable): New helper functions for SFINAE constraints on assignment operators. (tuple::__nothrow_assignable, tuple<_T1, _T2>::__nothrow_assignable): New helper functions for exception specifications. (tuple::operator=(const tuple&), tuple::operator=(tuple&&)) (tuple<_T1, _T2>::operator=(const tuple&)) (tuple<_T1, _T2>::operator=(tuple&&)): Change parameter types to __nonesuch_no_braces when the operator should be defined implicitly. Use __nothrow_assignable for exception specifications. (tuple::operator=(const tuple<_UElements...>&)) (tuple::operator=(tuple<_UElements...>&&)) (tuple<_T1, _T2>::operator=(const tuple<_U1, _U2>&)) (tuple<_T1, _T2>::operator=(tuple<_U1, _U2>&&)) (tuple<_T1, _T2>::operator=(const pair<_U1, _U2>&)) (tuple<_T1, _T2>::operator=(pair<_U1, _U2>&&)): Constrain using __assignable and use __nothrow_assignable for exception specifications. * python/libstdcxx/v6/printers.py (is_specialization_of): Accept gdb.Type as first argument, instead of a string. (StdTuplePrinter._iterator._is_nonempty_tuple): New method to check tuple for expected structure. (StdTuplePrinter._iterator.__init__): Use _is_nonempty_tuple. * testsuite/20_util/tuple/dr2729.cc: New test. * testsuite/20_util/tuple/element_access/get_neg.cc: Change dg-error to dg-prune-output. From-SVN: r263625
Jonathan Wakely committed -
Same as r263561, but for arm: avoid compilation errors caused by poly initializers getting treated as string literals. Tested on arm-none-linux-gnueabihf. gcc/ChangeLog: * config/arm/arm-builtins.c (arm_init_simd_builtin_types): Clear polyNxK_t element's TYPE_STRING_FLAG. From-SVN: r263624
Szabolcs Nagy committed
-